When using scripts to shutdown Database Brokers, the recommendation is that the script validate that these brokers have been stopped prior to stopping the AdminServer. Failure to ensure that these brokers have stopped prior to stopping the AdminServer can result in these Servers no longer being registered with or able to communicate with the AdminServer, until the AdminServer is restarted.
To check on the status of a databaseOne of the following commands can be used to check the current status of the database broker:
1. Query the Connection Manager for the status of the database while the AdminServer is running:
$ dbman -query -db dbname
2. Independent of the AdminServer, the
PROUTIL BUSY qualifier can be used to test the command return code in a UNIX script or Windows batch file to get the current state of the database.
$ proutil dbname -C busy
The return codes for the BUSY qualifier are:
Return Code: Description:
0 Database is not in use.
6 Database is in use.
64 Database is in process of starting up.
3. Independent of the AdminServer, the PROUTIL HOLDER qualifier will return a message indicating the state of the database. The command also has return codes which can be queried via a UNIX or Windows command line or script for the state of the database:
$ proutil dbname -C holder
The return codes for the HOLDER qualifier are:
Return Code: Description:
0 Database is not in use.
14 Database locked by single user, PROUTIL or RFUTIL.
16 Database open in multi-user mode.
Sample scripts making use of the PROUTIL command line options (BUSY and HOLDER) are available within the documentation in the Database Administration Guide.