cancel
Showing results for 
Search instead for 
Did you mean: 

How to check that the database is "registered with the SQL Anywhere Volume Shadow Copy Service writer"?

1,698

I need to verify using the SQL Anywhere 16/17 functions that the database is "registered with the SQL Anywhere Volume Shadow Copy Service module". I created and started the following Windows service:

dbsvc -as -s Automatic -t vss -w SAVSSWriter "C:\\Program Files\\SQL Anywhere 17\\Bin64\\dbvss17.exe"
To find out if the database is ready to interact with the VSS-service, I use "exotic" (from my point of view) functions:
select * from sa_server_messages() where msg_text like '%writer%'
and/or
select xp_cmdshell('NET START | find "SAVSSWriter"', 'no_output' )
Q1: Are there more "natural" functions?
And one more question.
Q2:How to find out the value of -vss database server option without analyzing the ASA-log message (like '24: -vss-')?

VolkerBarth
Contributor

I don't know an answer for Q1, but for Q2:

select property('CommandLine')

lists the full command line option, no matter whether the database server was started normally or as a service. So parsing for -vss should be doable.

VolkerBarth
Contributor
0 Kudos

Besides that, on Windows, you may use service dependencies to assure that VSS is running with the SA server and vice versa. See dbsvc -rg resp. -rs

Vielen Dank, Volker.

0 Kudos

Many clients start the database as a server without using service (for example via ODBC Data Source where Action = Start and connect to a database ...).
In my opinion, in this case we cannot synchronize the start of the VSS-service after starting the database. So I assumed that the VSS-service will be running 24/7.

VolkerBarth
Contributor
0 Kudos

Otherwise you might use a DatabaseStart event to check whether the VSS process is running and otherwise start that? (If the database engine is allowed to start dbvss, that is...)

0 Kudos

"Сheck whether the VSS process is running"-sentence brings us back to Q1.
Windows user rights and SA Windows services is a separate issue. For example, recently for SQLANYs...-service I was not able to change the local system account to the admin account in Central (not enough rights), but managed to do this in services.msc.

VolkerBarth
Contributor

You might also check the output of "vssadmin list writers".

select xp_cmdshell('vssadmin list writers | find "SQLAnywhere VSS Writer"', 'no_output' );

VolkerBarth
Contributor
0 Kudos

Nice solution, particularly as this is independent of the (individually different) DBVSS service name...

Accepted Solutions (0)

Answers (0)