on 2012 Jun 06 7:17 AM
Hi,
I have 1 server with 2 databases on it. How can I stop both database? This would seem easy but for me to stop a database I have to connect to one first. So when I connect to db1 on server x I can stop db2 and vice versa. But this would mean that I always have to be connected to at least 1 db and thus can never stop both...
Request clarification before answering.
Two options. You can use the -d switch on dbstop, which tells it to stop the database rather than the server:
dbstop -d -c "links=tcpip;eng=server_name;DBN=database1;uid=dba;pwd=sql" dbstop -d -c "links=tcpip;eng=server_name;DBN=database2;uid=dba;pwd=sql"
Alternatively, you can connect to the utility database and issue stop database
statements. You will need to use the -su
switch when starting the server:
dbisql -c "links=tcpip;eng=server_name;dbn=utility_db;uid=dba;pwd=sql" > stop database database1 > stop database database2
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
dbstop.exe -c "commlinks=tcpip;eng=MYSERVER;uid=DBA;pwd=SQL"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Note that this will stop the entire server, not just the two databases.
Not necessarily, you can still have a running server - though the question is not clear about whether the database server should be stopped, as well, and I would assume that stopping the server is part of the requirement, too...
User | Count |
---|---|
60 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.