Home | Previous Page | Next Page   Appendix B. Trapping Errors > The onclean Utility >

Usage

Specify onclean or onclean -v to remove resources when all the coservers are offline. Specify onclean -k to remove resources if one or more coservers are running.

Use onclean to clean up one or more coservers that fail to respond to normal shutdown commands (onmode -yuk or onmode -ky), or when you cannot restart the database server. Perhaps the database server shut down in an uncontrolled way and cannot recover, or it is hung. If the database server fails to restart, the old instance of the database server still has the shared-memory segment.

Check the message log to see if the database server shut down abnormally.

Warning:
Do not use onclean to perform a normal shut down of the database server. The onclean utility kills all processes and removes all shared-memory segments and semaphores that are recorded in the /sqldist/etc/.conf file. Transactions and processes fail to complete, and user sessions are disconnected abruptly. However, the database server rolls back transactions when it comes back up.
To shut down the database server with onclean

If you cannot shut down the database server with onmode -yuk or onmode -ky, follow these steps:

  1. Execute the xctl onclean command.
  2. If onclean cannot clean up any of the coservers but reports that they are still up, try shutting down those coservers with the onmode command.
  3. Issue the UNIX ipcs and ps commands to determine whether user informix still owns system resources. If ipcs displays shared-memory segments and semaphores, or if ps displays processes, issue the xctl onclean -k command to shut down all the coservers.

If the onclean command successfully cleans up the coservers, it issues return code 0. If you use the -v option, onclean displays messages on the screen about which resources it is trying to remove, as the following example shows:

looking for shmem key 5266c802
looking for semaphore ID 21168129

Coserver was shut down cleanly

If no error messages display, it means the resources were successfully removed. You can write a UNIX script to test the return codes.

If onclean is unsuccessful, one of the following error messages displays, and return code 1 is issued:

The coserver is still up, use onmode or "onclean -k"

Must be user informix or root to run this program

INFORMIXDIR env var not set

open of .conf.* filename failed

unknown option: -x
usage: onclean [-v] [-k]
       -v verbose, display full info while cleaning
       -k kill coserver if still running

If onclean encounters an operating-system error while it attempts to remove a process, semaphore, or shared-memory segment, it reports the name of the system call that failed and its error code and issues return code 2.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]