Linux: Reference: IBM Db2 commands for IBM Spectrum Protect server databases
Use this list as reference when you are directed to issue Db2® commands by IBM® support.
Purpose
After using the wizards to install and configure IBM Spectrum Protect™, you seldom need to issue Db2 commands. A limited set of Db2 commands that you might use or be asked to issue are listed in the table.This list is supplemental material only and is not a comprehensive list. There is no implication that an IBM Spectrum Protect administrator will use it on a daily or ongoing basis. Samples of some commands are provided. Details of output are not listed.
For a full explanation of the commands described here and of their syntax, see the Db2 product documentation.
Command | Description | Example |
---|---|---|
db2icrt | Creates Db2 instances in the home directory
of the instance owner.
Tip: The IBM
Spectrum Protect configuration wizard creates the instance used by the server and database. After a server is
installed and configured through the configuration wizard, the db2icrt command is
generally not used.
This utility is in the DB2DIR/instance directory, where DB2DIR represents the installation location where the current version of the Db2 database system is installed. |
Manually create an IBM
Spectrum Protect instance. Enter the command on one line:
|
db2set | Displays Db2 variables. | List Db2 variables:
|
CATALOG DATABASE | Stores database location information in the system database directory. The database can be located either on the local workstation or on a remote database partition server. The server configuration wizard takes care of any catalog needed for using the server database. Run this command manually, after a server is configured and running, only if something in the environment changes or is damaged. | Catalog the database:
|
CONNECT TO DATABASE | Connects to a specified database for command-line interface (CLI) use. | Connect to the IBM
Spectrum Protect
database from a Db2 CLI:
|
GET DATABASE CONFIGURATION | Returns the values of individual entries in a specific database configuration
file.
Important: This command and parameters are set and managed directly by Db2. They are listed here for informational purposes
and a means to view the existing settings. Changing these settings might be advised by IBM support or through service bulletins such as APARs or
Technical Guidance documents (technotes). Do not change these settings manually. Change them only at
the direction of IBM and only through the use of IBM
Spectrum Protect server commands or procedures.
|
Show the configuration information for a database alias:
Retrieve information in order to verify settings
such as database configuration, log mode, and
maintenance.
|
GET DATABASE MANAGER CONFIGURATION | Returns the values of individual entries in a specific database configuration
file.
Important: This command and parameters are set and managed directly by Db2. They are listed here for informational purposes
and a means to view the existing settings. Changing these settings might be advised by IBM support or through service bulletins such as APARs or
Technical Guidance documents (technotes). Do not change these settings manually. Change them only at
the direction of IBM and only through the use of IBM
Spectrum Protect server commands or procedures.
|
Retrieve configuration information for the database manager:
|
GET HEALTH SNAPSHOT | Retrieves the health status information for the database manager and its
databases. The information returned represents a snapshot of the health state at the time the
command was issued. IBM Spectrum Protect monitors the state of the database using the health snapshot and other mechanisms that are provided by Db2. There might be cases where the health snapshot or other documentation indicates that an item or database resource might be in an alert state. Such a case indicates that action must be considered to remedy the situation. IBM Spectrum Protect monitors the condition and responds appropriately. Not all declared alerts by the Db2 database are acted on. |
Receive a report on Db2 health monitor indicators:
|
GRANT (Database Authorities) | Grants authorities that apply to the entire database rather than privileges that apply to specific objects within the database. | Grant access to the user ID itmuser:
|
RUNSTATS | Updates statistics about the characteristics of a table and associated indexes
or statistical views. These characteristics include number of records, number of pages, and average
record length. To see a table, issue this utility after updating or reorganizing the table. A view must be enabled for optimization before its statistics can be used to optimize a query. A view that is enabled for optimization is known as a statistical view. Use the Db2 ALTER VIEW statement to enable a view for optimization. Issue the RUNSTATS utility when changes to underlying tables substantially affect the rows returned by the view. Tip: The server configures Db2 to run the RUNSTATS command as
needed.
|
Update statistics on a single table.
|
SET SCHEMA | Changes the value of the CURRENT SCHEMA special register,
in preparation for issuing SQL commands directly through the Db2 CLI. Tip: A special register is a
storage area that is defined for an application process by the database manager. It is used to store
information that can be referenced in SQL statements.
|
Set the schema for IBM
Spectrum Protect:
|
START DATABASE MANAGER | Starts the current database manager instance background processes. The server
starts and stops the instance and database whenever the server starts and halts. Important: Allow the server to manage the starting and stopping of the
instance and database unless otherwise directed by IBM
support.
|
Start the database manager:
|
STOP DATABASE MANAGER | Stops the current database manager instance. Unless explicitly stopped, the
database manager continues to be active. This command does not stop the database manager instance if
any applications are connected to databases. If there are no database connections, but there are
instance attachments, the command forces the instance attachments to stop first. Then, it stops the
database manager. This command also deactivates any outstanding database activations before stopping
the database manager. This command is not valid on a client. The server starts and stops the instance and database whenever the server starts and halts. Important: Allow the server to manage the starting and stopping of the
instance and database unless otherwise directed by IBM
support.
|
Stop the database manager:
|