Consultor Eletrônico



Kbase P43260: Using proutil busy 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 busy to determine if database is in use

GOAL:

How to find out if a database is in use

GOAL:

What is the proutil busy qualifier?

FIX:

The following is extracted from the documentation.

The PROUTIL BUSY Qualifier determines whether the database is currently in use. This information is useful before performing a database backup or shutting down a database. A database is in use if it is being used in single-user mode, multi-user mode, or by a Progress utility program.

To get the information, you must run PROUTIL with the BUSY qualifier and test the command return code in a UNIX script or Windows batch file.

SYNTAX: proutil db-name -C busy

db-name specifies the database you are using.

NOTE
When the PROUTIL command completes, it returns a code you can test in a UNIX script or Windows batch file. The return codes for the BUSY qualifier are as follows:

0 Database is not in use.
6 Database is in use.
64 Database is in process of starting up.

EXAMPLE
This example shows how you might use the BUSY qualifier on UNIX in a script that tests whether the database is busy:

proutil mydb -C busy
if [ $? != 0 ]
then
  echo
  echo "Do you want to use 'proshut' to force users off\
    the system?"
  read ans
  if [ "$ans" = y ]
  then
    proshut -by mydb
  else
    echo "Backup will not be performed."
    exit
  fi
fi
echo "Beginning backup."
# Backup procedure