Hello, I am trying to create and start a mobilink server service with dbsvc with the following command:
It is creating the service successfully. When I am trying to start the service with
It is throwing an error saying: SQL Anywhere Service Utility Version 16.0.0.1324 The system cannot find the file specified. Error starting service "SAAPML". dbsvc -g SAAPML gives:
What file path do I need to check? |
Modified the command to :
And then started the service as
SQL Anywhere Service Utility Version 16.0.0.1324 Service "SAAPML" start pending. Service "SAAPML" was started successfully. Thanks Yes, as you found out yourself, the command line to create a service should not use the -u option, which is used to start the service. In your original case the "-u" following the "-w SAAPML " has meant that "-u" is the name of the executable, and so that must have failed.
(19 Jan '17, 06:37)
Volker Barth
Replies hidden
Hi Volker, I am creating the following dsn:
Then I am trying to create and run SQL Anywhere 16 as windows service:
Can you please help me out here?
(01 Feb '17, 08:44)
rohinibasuu
1
Hm, IMHO there's a wrong option within the dbsrv16.exe command line, "-c" is used to specify an initial cache size, not to specify a connection string (see, you want to start a database engine with a database, but you do make a connection when starting the database engine)... - In other words, you are not starting a database client here like DBISQL that would use -c to specify a connection string... And therefore you do not specify a DSN when starting a database engine, but you use the -n options (as server option to specify the engine name and as database option to specify the database name) and name the database file path, such as... ..."C:\Program Files\SQL Anywhere 16\Bin64\dbsrv16.exe" -n SAAPDB_RCS_SAPDOC01_0101 C:\SAP\SAAP\0101\db\0101\SAAP_RCS.db -n SAAP_RCS_rem_0101 -o ... I would highly recommend to try to start the engine directly per command line before trying to use the DBSVC statements, it will show you easier whether your command line is correct or not. Once it does work, then use it within DBSVC.
(01 Feb '17, 10:00)
Volker Barth
I replaced the -c option with -n as shown above. But no luck.
(02 Feb '17, 00:25)
rohinibasuu
As stated, I would highly recommend to try the command line without running as a service - does that work?
(02 Feb '17, 02:33)
Volker Barth
Comment Text Removed
I am a SQL Anywhere noob, so not really sure what you meant. Sorry for my ignorance. I did run this command though:
(02 Feb '17, 05:56)
rohinibasuu
Yes, that's what I was trying to suggest. Can you now connect to that database successfully (with whatever application you are working...)? Given the command line is the same as in the DBSVC -w options, and the database engine starts successfully when started manually, it seems that the starting as a service is causing problems here... Is there anything in the Windows event log? Does starting via command line and "net start SAAPDB_RCS_SAPDOC01_0101" does work - or via the Windows Service MMC? FWIW, you may also open a new question as the current issue seems different from the original one...
(02 Feb '17, 06:45)
Volker Barth
1
The event viewer logs the information about the failures in the Application logs. That error might be helpful. There will be one or more with SQLANY64 16.0 as the source name. The only issue that I can identify is that the -o option needs to map to an existing directory structure. And typically the -o option is a path and filename so in you case, -o is trying the directory C:\SAP\SAAP\0101\db\logs\ and will create the file as eng_log_0101. If this is the cause, the application viewer log will contain the error: SQLANYs_SAAPDB_RCS_SAPDOC01_0101: Can't open Message window log file: C:\SAP\SAAP\0101\db\logs\eng_log_0101 You will also get this error at the command line if you follow Volker's recommendation.
(03 Feb '17, 16:34)
Chris Keating
Replies hidden
net start SAAPDB_RCS_SAPDOC01_0101 says "The service name is invalid" And the windows event log says "SQLANYs_SAAPDB_RCS_SAPDOC01_0101: Could not start server"
(05 Feb '17, 23:39)
rohinibasuu
When a dbsrv16 instance was already running in my machine (I started the database from command line instead of service, as per Volker's advice), I tried hitting the dbsrv16 command again. This time I did get the error: "SQLANYs_SAAPDB_RCS_SAPDOC01_0101: Can't open Message window log file: C:\SAP\SAAP\0101\db\logs\eng_log_0101" And the same message was reflected in windows event log also.
(05 Feb '17, 23:51)
rohinibasuu
Sorry, I forgot to mention that SQL Anywhere services by default have the prefix "SQL Anywhere - " before the service name you specify in the dbsvc command (unless you use the -sn option), so you could try
That being said, please follow Chris's advice and make sure the file specification behind the -o option belongs to an existing path and includes the file name, too.
(06 Feb '17, 02:02)
Volker Barth
Two scenarios: a. When dbsrv16 is already running:
Windows event log: 1.SQLANYs_SAAPDB_RCS_SAPDOC01_0101: Can't open Message window log file: C:\SAP\SAAP\db\logs\eng_log_0101 2.SQLANYs_SAAPDB_RCS_SAPDOC01_0101: Could not start server "C:\SAP\SAAP\db\logs\eng_log_0101" is an existing file directory. b. When I stopped dbsrv16 and ran net start:The SQL Anywhere - SAAPDB_RCS_SAPDOC01_0101 service is starting... The SQL Anywhere - SAAPDB_RCS_SAPDOC01_0101 service was started successfully.
(06 Feb '17, 02:47)
rohinibasuu
Well, if the database server is already running, the net start command has to fail when it should start a database engine with the same name - there can only be one at a time on the same machine... (In other words: Starting the database as a service is just another way to start it, if it already runs, why then try to start it twice...) Nevertheless, I think the problem is concealed by the unrecommended usage of -o with a directory instead of a file path...
What is the contents of that directory?
(06 Feb '17, 04:27)
Volker Barth
Sorry my bad. C:\SAP\SAAP\db\logs is the directory and it has two files: eng_log_0101 and SAAP_RCS_dbmlsync_0101
(06 Feb '17, 05:07)
rohinibasuu
Volker and Chris, thanks for introducing me to windows event logs! :) I went back to step 1 i.e running the dbsvc command. Got the following error from windows event logs:
(06 Feb '17, 05:09)
rohinibasuu
1
If that is the console log file (doesn't it have a file extension like ".log" or ".txt"???), I would highly recommend to use the -o switch with the full file path, such as
or better
Note, you can rename the console log of a running database engine via sa_server_option('ConsoleLogFile', <newpathandfilename>);
(06 Feb '17, 07:22)
Volker Barth
1
That means that the database server requires the transaction log and it cannot be found. By default, the database server will create the tranaction log with the same name as the database but with the extension log in the same directory as the database file. This error suggests that the log location is not in the default location. Run a dblog C:\SAP\SAAP\0101\db\0101\SAAP_RCS.db (replacing the path and datbase name to reflect the database that is reporting this error). It will report the following output (based on my install of the demo database): "c:\sa\sa16\Samples\demo.db" is using log file "demo.log" "c:\sa\sa16\Samples\demo.db" is using no log mirror file Make note of the locatoin of the log file and mirror file (if transaction log mirrorring is being used). Make sure that the logs can be located in the location referenced. If there is no path, the log should be maintained in the same directory as the database file.
(06 Feb '17, 09:04)
Chris Keating
Replies hidden
dblog C:\SAP\SAAP\db\0101\SAAP_RCS.db
There's no other file in C:\SAP\SAAP\db\0101\ other then SAAP_RCS.db.
(07 Feb '17, 00:04)
rohinibasuu
So why is there no .log file in that directory? SQL Anyhwere databases usually consist of (at least) one database file (.db) and one current log file (.log), so a .log file should be there. Have you copied the database from another location, and the .log file is missing? When a database has been shutdown normally, you can usually delete the .log file and start the database again, and it will create a new log file. However, that seems not possible in your case because the database seems to need some automatic recovery steps, and the log is required for that. - And additionally, as seem to make use of MobiLink, if the SQL Anywhere database acts as a MobiLink client, you mustn't delete a needed transaction log at all, otherwise your synchronization will fail.
(08 Feb '17, 01:01)
Volker Barth
Found the issue. So, the SQL Anywhere was acting as a mobilink client. The machine where the mobilink server was running, there the download and upload paths were wrong (-ftr nd -ftru options) and the mobilink client database files were supposed to be downloaded. Now both .db and .log files are properly downloaded in the path "C:\SAP\SAAP\db\0101\" and database service has also started.
(09 Feb '17, 03:18)
rohinibasuu
|