How does SQL Anywhere behave differently when running as a service?
I'm considering writing a service wrapper for dbsrv12.exe to make some changes to its startup and ASSERT behavior, and I would like to know what changes the server makes when running as a service, as opposed to simply being ran from the commandline (other than the obvious service control thread which I'm going to have to simulate, likely with a utility_db connection). Are there certain commandline parameters that should be forced to have it behave properly in a service environment?
asked 27 Jan '14, 13:16
When we run SQL anywhere as a service, there is a hidden switch (-hv) automatically added to the server's command line by Sybase Central /
\\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SQLANYe_<servicename> ImagePath REG_EXPAND_SZ dbsrv16.exe -hvSQLANYe_<servicename>
That is how SQL Anywhere maintains service messaging functions to the Windows Service Manager.
I wouldn't expect that you would be able to successfully alter this behaviour yourself with just a wrapper script.
When the database server asserts, it doesn't necessarily stop the executable right away so your wrapper script may not get 'control' back in these situations. As others have mentioned, SQL Anywhere 16 has been enhanced to provide additional behaviour options upon assertions (dbsrv16 -uf, -ufd).
If you are seeing multiple assertions in the database server, writing a wrapper script is not the appropriate response to the issue - you should resolve the assertion condition, instead. (Contacting SAP technical support may also be appropriate here).
By design, all databases started on the command line with a database server must be started before any requests may be accepted to other databases (which will include automatic recovery behaviour).
An alternative to this design would be to either break out the databases into separate database services, or start none of the databases at start-up with the database server and only start the databases as required by the client using the utility_db with the START DATABASE SQL statement or the database auto-start behaviour from a client connection string (i.e. DBF=filename.db and ASTART=YES).
answered 28 Jan '14, 15:22