Kbase P127978: How to wait for a database started with AdminServer?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Unverified
GOAL:
How to wait for a database started with AdminServer?
GOAL:
How to know when a database started with AdminServer is ready to accept connections?
GOAL:
How to wait for the database to start after dbman in a script?
FACT(s) (Environment):
Progress 9.x
OpenEdge 10.x
All Supported Operating Systems
FIX:
When using Progress Explorer or "dbman" to start a database, the action only sends a request to start the database to AdminServer. The AdminServer then processes this request by spawning the database server asynchronously. This can prove inconvenient in (e.g.) a script that requires the database to be completely started before starting the next step.
In order to wait for the database to start, it is needed to use a combination of "proutil" and "dbman":
1. wait for 1 second
2. use proutil <db> -C busy. This will return a status code (see the documentation) that indicates whether:
- the database is running in multi-user mode (then go to step 4)
- the database is running in single-user mode (a program is using it). In this case, report the situation to an administrator and go to step 1
- the database is not started, go to step 3
3. increment a counter (for a timeout). If the maximum value is exceeded, consider that the database has not started, then fail. Otherwise, go to step 1.
4. continue with the next actions.