The following sections outline some of the tools available to help you perform database administration tasks and DB2 troubleshooting. See Improving Database Performance for additional performance-related tools.
The following graphical user interface (GUI) tools are available from the DB2 folder on OS/2, and from the Start --> Programs menu choice on the Windows 95, Windows 98, and Windows NT operating systems. UNIX platforms also have GUI tools. For information on these tools, see the online help for each platform and the Administration Guide.
Use the Control Center to perform administrative tasks, such as configuring databases, managing directories, backing up and recovering databases, scheduling jobs, collecting statistics for data, and managing media.
Use graphical interfaces to perform the following tasks:
Note: | With IBM DB2 Universal Database Version 7, Visual Explain is no longer invoked from the command line. It can still, however, be invoked from various database objects in the Control Center. For this version, the documentation continues to use the name Visual Explain. |
Use DB2 wizards to help you simplify some monotonous jobs:
DB2 wizards prompt you step-by-step on how to fill in the information necessary for the task you are doing. Calculations and recommendations based on the information you supply are done by the wizards.
All of the tools mentioned above apply to the DB2 Universal Database Enterprise - Extended Edition (EEE) environment. In addition, you can identify database nodes that are down, run user exits, or display alerts.
Standalone tools are provided for troubleshooting. You can find these tools in the bin, misc, and adm subdirectories of the sqllib directory. In UNIX-based systems, the sqllib directory is a subdirectory of the instance owner's home directory. On other operating systems, you can specify the directory where you would like the sqllib directory to be placed. Typically, this is under the drive where you install DB2.
These tools provide syntax help, which you can access by typing the command followed by a question mark. (Example: db2look ?)
The following list highlights some of the tools available to you:
Note: | A packed descriptor is a column within the system catalog tables that DB2 uses to identify the details of a database object. |
Note: | If db2dart reports a problem with an index, use the tool's /MI option to mark the index as invalid. The index is rebuilt based on the value of the indexrec database and database manager configuration parameters (see the Administration Guide: Performance for details). |
You must run this tool on the DB2 server where the database resides. You must also ensure that there are no active connections to the database. (Use the LIST APPLICATIONS FOR DATABASE database-alias command and disconnect any applications that are listed.)
In a DB2 UDB Enterprise - Extended Edition (EEE) environment, db2dart must be run on each database partition server.
For information on db2dart options, type db2dart without any options.
The log header control file sqlogctl.lfh must reside in the current directory before using this tool. The tool also uses the logfilsiz database configuration parameter. This tool can only be used with recoverable databases.
For introductory information on db2look, type db2look. For detailed information, type db2look -h.
For more information on the options available on db2look, see the Command Reference.
Use this tool if a DROP TABLESPACE command does not work. Typically, the SQL0294N message is received.
Attention: Use this tool in consultation with DB2 Customer Support, and only if you are an experienced database administrator. You must be completely sure that the container is not used by any other database, because this command is equivalent to dropping the container. Running this command on a container that has data results in the loss of all the data from that container.
The DB2 database manager maintains data about its operation and performance as it runs. This data can provide important troubleshooting information. For example, you can find out:
Because collecting some of this data introduces overhead on the operation of DB2, monitor switches are available to control which information is collected. To set monitor switches explicitly, use the UPDATE MONITOR SWITCHES command or the sqlmmon() API. (You must have SYSADM, SYSCTRL, or SYSMAINT authority.)
There are two ways to access the data maintained by the database manager:
To use an event monitor:
SET EVENT MONITOR evname STATE 1
If you are writing to a named pipe, start the application reading from the named pipe before activating the event monitor. You can either write your own application to do this, or use db2evmon. When the event monitor is active and starts writing events to the pipe, db2evmon will read them as they are being generated and write them to standard output.
For information on the system database monitor and the event monitor, see the System Monitor Guide and Reference. For a scenario of how to use them from the Control Center, see the Administration Guide: Implementation.