Administering databases with built-in routines

You can easily administer databases in your applications with use of database built-in routines.

About this task

You can use a set of database built-in procedures and function to perform administrative tasks. For example, database built-in procedures can perform the following tasks:
  • Run a database command through an SQL interface
  • Modify configuration parameters
  • Manage packages
  • Run snapshot-related tasks
Database built-in procedures and functions are found in the SYSPROC, SYSFUN, and SYSTOOLS schemas. Your application can implement database built-in routines to perform administrative tasks or if you want to access the results of administrative tasks through an SQL interface. Your application can filter, sort, modify, or reuse the results of administrative tasks in another query without the need to create your own routines.

The ADMIN_CMD command along with other built-in routines provide comprehensive administration support.

ADMIN_CMD for running database commands through a SQL interface

You can use the ADMIN_CMD routine to execute database commands through an SQL interface. The ADMIN_CMD routine accepts a database command with appropriate options and values as a string argument. The ADMIN_CMD routine runs the database command that is contained in the argument string and returns the results in a tabular or scalar format that can be used as part of a larger query or operation.

Built-in administrative routines
Database built-in routines can be used from the CLP or database applications wherever invocation of the specified routine is supported. Examples of built-in routines include the following routines:
  • ADMIN_CMD
  • MON_GET_CONNECTION
  • MON_GET_DATABASE
  • MON_GET_TABLE
  • REBIND_ROUTINE_PACKAGE

The ADMIN_CMD routine and the other built-in routines are available for use if you have the SYSPROC, SYSFUN, and SYSTOOLS schema names included in the CURRENT PATH special register value, which they are by default.

For examples of a built-in routine usage, refer to the built-in routine specific reference documentation.