Hello,

I am trying to create and start a mobilink server service with dbsvc with the following command:

dbsvc -y -as -s Automatic -t MobiLink -sd SYCLOML -w SAAPML -u SAAPML "C:\Program Files\SQL Anywhere 16\bin64\mlsrv16.exe" dbsvc -u -c dsn=oracle_cons;uid=rbasu;pwd=rbasu -x tcpip(port=5555) -o "C:\MobiLink\logs\ml_log.txt" -on 2M -zu+ -zp -dl -zw 0 -w 25 -v -ftr "D:\usr\sap\TA1\USR" -ftru "D:\usr\sap\TA1\USR"

It is creating the service successfully.

When I am trying to start the service with

dbsvc -u SAAMPL

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:

SQL Anywhere Service Utility Version 16.0.0.1324 Service "SAAPML": MobiLink Real service name: SQLANYm_SAAPML Display Name: SQL Anywhere - SAAPML Display Description: SYCLOML Service group: SQLANYMobiLink Automatic Startup Using LocalSystem account Not allowed to interact with desktop Executable: -u Service command line options: SAAPML "C:\Program Files\SQL Anywhere 16\bin64\mlsrv16.exe" dbsvc -u -c dsn=oracle_cons;uid=ML_R1;pwd=ML_R1 -x tcpip(port=5555) -o C:\MobiLink\logs\ml_log.txt -on 2M -zu+ -zp -dl -zw 0 -w 25 -v -ftr D:\usr\sap\TA1\TARS -ftru D:\usr\sap\TA1\TARS

What file path do I need to check?

asked 19 Jan '17, 03:28

rohinibasuu's gravatar image

rohinibasuu
567813
accept rate: 0%

edited 19 Jan '17, 04:23


Modified the command to :

dbsvc -y -as -s Automatic -t MobiLink -sd SYCLOML -w SAAPML "C:\Program Files\SQL Anywhere 16\bin64\mlsrv16.exe" -c dsn=oracle_cons;uid=rbasu;pwd=rbasu -x tcpip(port=5555) -o "C:\MobiLink\logs\ml_log.txt" -on 2M -zu+ -zp -dl -zw 0 -w 25 -v -ftr "D:\usr\sap\TA1\USR" -ftru "D:\usr\sap\TA1\USR"

And then started the service as

dbsvc -u SAAPML

SQL Anywhere Service Utility Version 16.0.0.1324 Service "SAAPML" start pending. Service "SAAPML" was started successfully.

Thanks

permanent link

answered 19 Jan '17, 04:37

rohinibasuu's gravatar image

rohinibasuu
567813
accept rate: 0%

converted 19 Jan '17, 06:30

Volker%20Barth's gravatar image

Volker Barth
40.1k361549819

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:

dbdsn -ws SAAP_RCS_rem_0101 -v -y -c "dbf=C:\SAP\SAAP\0101\db\0101\SAAP_RCS.db;uid=rohini;pwd=basu;eng=SAAPDB_RCS_SAPDOC01_0101;dbn=SAAP_RCS_rem_0101;commlinks=shmem"

Then I am trying to create and run SQL Anywhere 16 as windows service:

dbsvc -y -as -i -s Automatic -t Network -sd SAAPDB_RCS_SAPDOC01_0101 -w SAAPDB_RCS_SAPDOC01_0101 "C:\Program Files\SQL Anywhere 16\Bin64\dbsrv16.exe" -c dsn=SAAP_RCS_rem_0101;uid=rohini;pwd=basu -o C:\SAP\SAAP\0101\db\logs\eng_log_0101 -on 4M -x shmem,tcpip(port=5657) -xs http(port=8080;dbn=SAAP_RCS_rem_0101;MaxRequestSize=10M;log=C:\SAP\SAAP\0101\db\logs\web_log_0101.txt) -gd ALL SQL Anywhere Service Utility Version 16.0.0.2043 Service "SAAPDB_RCS_SAPDOC01_0101" was created successfully.

dbsvc -u SAAPDB_RCS_SAPDOC01_0101 SQL Anywhere Service Utility Version 16.0.0.2043 Service "SAAPDB_RCS_SAPDOC01_0101" start pending. Error starting service "SAAPDB_RCS_SAPDOC01_0101".

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.

dbsvc -y -as -i -s Automatic -t Network -sd SAAPDB_RCS_SAPDOC01_0101 -w SAAPDB_RCS_SAPDOC01_0101 "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 C:\SAP\SAAP\0101\db\logs\eng_log_0101 -on 4M -x shmem,tcpip(port=5657) -xs http(port=8080;dbn=SAAP_RCS_rem_0101;MaxRequestSize=10M;log=C:\SAP\SAAP\0101\db\logs\web_log_0101.txt) -gd ALL SQL Anywhere Service Utility Version 16.0.0.2043 Service "SAAPDB_RCS_SAPDOC01_0101" was created successfully.

dbsvc -u SAAPDB_RCS_SAPDOC01_0101 SQL Anywhere Service Utility Version 16.0.0.2043 Service "SAAPDB_RCS_SAPDOC01_0101" start pending. Error starting service "SAAPDB_RCS_SAPDOC01_0101".

(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:

dbsrv16 -n SAAPDB_RCS_SAPDOC01_0101 C:\SAP\SAAP\db\0101\SAAP_RCS.db -n SAAP_RCS_rem_0101 -o C:\SAP\SAAP\db\logs\eng_log_0101 -on 4M -x shmem,tcpip(port=5657) -xs http(port=8080;dbn=SAAP_RCS_rem_0101;MaxRequestSize=10M;log=C:\SAP\SAAP\db\logs\web_log_0101.txt) -gd ALL . The database has started.

(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

net start SAAPDB_RCS_SAPDOC01_0101

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

net start "SQL Anywhere - SAAPDB_RCS_SAPDOC01_0101"

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:

net start "SQL Anywhere - SAAPDB_RCS_SAPDOC01_0101"

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...

"C:\SAP\SAAP\db\logs\eng_log_0101" is an existing file directory.

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:

SQLANYs_SAAPDB_RCS_SAPDOC01_0101: Cannot open transaction log file -- The system cannot find the file specified.

(06 Feb '17, 05:09) rohinibasuu
1

eng_log_0101

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

 ... -o C:\SAP\SAAP\0101\db\logs\eng_log_0101\eng_log_0101 ...

or better

 ... -o C:\SAP\SAAP\0101\db\logs\eng_log_0101\eng_log_0101.txt ...

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

SQL Anywhere Transaction Log Utility Version 16.0.0.2043 "C:\SAP\SAAP\db\0101\SAAP_RCS.db" is using log file "SAAP_RCS.log" "C:\SAP\SAAP\db\0101\SAAP_RCS.db" is using no log mirror file Transaction log starting offset is 0003857522 Transaction log current relative offset is 0000199555

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
showing 5 of 20 show all flat view
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×371
×12

question asked: 19 Jan '17, 03:28

question was seen: 3,260 times

last updated: 09 Feb '17, 03:18