After starting the database in a bash shell, the dbstop is either denied access in another shell or the database is stated as being Is there a way top stop the db on the command line?

    $ /opt/sqlanywhere17/bin64s/dbsrv17 -ga -n ftnode_sa /home/bxxxx/sqladb/ftnode_sa.db
SQL Anywhere Network Server Version 17.0.4.2053

Copyright (c) 2016 SAP SE or an SAP affiliate company. All rights reserved. .. .. Trying to start TCPIP link ... Starting on port 2638 TCPIP link started successfully Now accepting requests Press 'q' to shut down the database server

But when I attempt to stop the database the following message appears:
$ ./dbstop -d ftnode_sa -y
SQL Anywhere Stop Server Utility Version 17.0.4.2053
Unable to stop database server -- Specified database is invalid.

I can connect to the database using SQL Anywhere Central.

asked 12 Jul '17, 07:42

bluefrog's gravatar image

bluefrog
183141521
accept rate: 0%

edited 12 Jul '17, 07:44


You are running a network server (dbsrv17) in contrast to a personal engine (dbeng17).

As to the docs:

When stopping a network server, you must supply a connection string with a user ID that has permissions to stop the server.

So you need to supply -c with an appropriate connection string to stop the database and/or network server, without specifying the server name additionally on the command line.

permanent link

answered 12 Jul '17, 09:16

Volker%20Barth's gravatar image

Volker Barth
40.1k361549819
accept rate: 34%

edited 12 Jul '17, 09:18

Thanks, I found my answer in http://sqlanywhere-forum.sap.com/questions/27948/stopping-database-server question.

./dbstop -c "Server=ftnode_sa;uid=sadb;pwd=sadb;" SQL Anywhere Stop Server Utility Version 17.0.4.2053 There are still active connections. Stop anyway? (Y/N) Y

(12 Jul '17, 09:22) bluefrog

dbstop can be used to stop either an individual database or the whole database engine/server . Your start command line is creating a server called ftnode_sa and a database called ft_node_sa (you aren't specifying the database name so it is defaulting to the file name.)

-d is used to stop a specific database only - not the engine. If you want to do that you have to specify a connection string for the database (use -c "keyword=value;..."). You can stop the whole engine unconditionally (-y) by ommitting the -d and just putting the server name at the end eg

dbstop -y ftnode_sa

There are issues about permissions etc which are discussed in the docs - look for "Stop Server utility (dbstop)"

permanent link

answered 12 Jul '17, 08:03

Justin%20Willey's gravatar image

Justin Willey
7.6k137179249
accept rate: 20%

edited 12 Jul '17, 08:04

I did specify ftnode_sa, not ft_node_sa as you suggested.

I tried what you suggested.

$ sudo ./dbstop -y ftnode_sa SQL Anywhere Stop Server Utility Version 17.0.4.2053 Unable to stop database server -- Database server not found.

(12 Jul '17, 08:58) bluefrog
Replies hidden
Comment Text Removed

apologies that's a typo by me - your database will be called ftnode_sa (ie the file name without the extension).

It is now saying it can't find the database server, rather than the database is invalid. I don't know anything about Linux (which I think you are using) - is this command being run in the same "context" as the one that starts the database engine - ie will it be able to see the service? Also you are specifying -ga which means the engine will stop if there are no connections - could that be the case?

You could also try stopping the database specifically using the -d option and supplying a connection string:

dbstop -d ftnode_sa -c="ServerName=ftnode_sa;dbn=ftnode_sa;UID=dba;PWD=****"

Replacing your password as appropriate. Also - I'm not sure if it is a problem here but in order to stop a server you need to set appropriate privileges when you start it. By default only the user DBA can stop the network server (which you are using) unless you specify -gk all when you start it. see the docs for details.

(12 Jul '17, 09:24) Justin Willey
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:

×16
×4

question asked: 12 Jul '17, 07:42

question was seen: 4,828 times

last updated: 12 Jul '17, 09:25