PROUTIL BUSY qualifier

Determines if the database is currently in use.

Syntax

proutil db-name -C busy

Parameters

db-name
Specifies the database you are using.

Determining if the database is in use 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 an OpenEdge utility program.

To get the database status, you must run PROUTIL with the BUSY qualifier and test the command return code in a UNIX script or Windows batch file. The return codes for the BUSY qualifier are shown in the following table:

Return code Description
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 if 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