Kbase P43261: Using proutil holder to determine if database is in use
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  9/22/2003 |
|
Status: Verified
GOAL:
Using proutil holder to determine if database is in use
GOAL:
How to find out if a database is in use
GOAL:
What is the proutil holder qualifier?
FIX:
The following is extracted from the documentation.
The PROUTIL HOLDER qualifier determines whether the database currently in use is in single-user mode, multi-user mode, or in use by a Progress utility. This information is useful before performing a database backup or shutting down a database.
When you execute this command, PROUTIL returns a different return code depending on how you are running Progress. To get the information, you must run PROUTIL with the HOLDER qualifier and test the command return code in a UNIX script or Windows batch file.
SYNTAX: proutil db-name -C holder
db-name specifies the database you are using.
NOTES
1. When the HOLDER qualifier completes, it sets a return code that you can test in a UNIX script or Windows batch file. The return codes for the HOLDER qualifier on UNIX are as follows:
0 Database not in use.
14 Database locked by single user, PROUTIL, or RFUTIL.
16 Database open in multi-user mode.
Any other nonzero return code indicates that an error has occurred.
2. Return codes can be added or changed from one release to the next. Use scripts that depend on a specific return code with caution.
EXAMPLE
This example shows how you might use the HOLDER qualifier on UNIX in a script that performs a database backup.
proutil mydb -C holder
retcode=$? # this saves the return code
case $retcode in
0) echo "The database is not busy, ok to backup"
;;
14) echo "The database is locked, no backup done"
exit $retcode
;;
16) echo "The database is busy in multi-user mode, no backup done"
exit $retcode
;;
*) proutil failed, no backup done
echo error code = $retcode
exit $retcode
;;
esac
proutil mydb -C truncate bi
<<test the return value from proutil here>>
<<put the backup command here>>
rfutil mydb -C mark backedup