DB2 Version 9.7 for Linux, UNIX, and Windows

Database directories and files

When you create a database, information about the database including default information is stored in a directory hierarchy.

The hierarchical directory structure is created for you at a location that is determined by the information you provide in the CREATE DATABASE command. If you do not specify the location of the directory path or drive when you create the database, the default location is used.

In the directory you specify as the database path in the CREATE DATABASE command, a subdirectory that uses the name of the instance is created. This subdirectory ensures that databases created in different instances under the same directory do not use the same path. Below the instance-name subdirectory, a subdirectory named NODE0000 is created. This subdirectory differentiates database partitions in a logically partitioned database environment. Below the node-name directory, a subdirectory named SQL00001 is created. This name of this subdirectory uses the database token and represents the database being created. SQL00001 contains objects associated with the first database created, and subsequent databases are given higher numbers: SQL00002, and so on. These subdirectories differentiate databases created in this instance on the directory that you specified in the CREATE DATABASE command.

The directory structure appears as follows: your_database_path/your_instance/NODE0000/SQL00001/

The database directory contains the following files that are created as part of the CREATE DATABASE command.

At the same time a database is created, a detailed deadlocks event monitor is also created. The detailed deadlocks event monitor files are stored in the database directory of the catalog node. When the event monitor reaches its maximum number of files to output, it will deactivate and a message is written to the notification log. This prevents the event monitor from consuming too much disk space. Removing output files that are no longer needed will allow the event monitor to activate again on the next database activation.

Additional information for SMS database directories in non-automatic storage databases

In non-automatic storage databases, the SQLT* subdirectories contain the default System Managed Space (SMS) table spaces required for an operational database. Three default table spaces are created:
  • SQLT0000.0 subdirectory contains the catalog table space with the system catalog tables.
  • SQLT0001.0 subdirectory contains the default temporary table space.
  • SQLT0002.0 subdirectory contains the default user data table space.

Each subdirectory or container has a file created in it called SQLTAG.NAM. This file marks the subdirectory as being in use so that subsequent table space creation does not attempt to use these subdirectories.

In addition, a file called SQL*.DAT stores information about each table that the subdirectory or container contains. The asterisk (*) is replaced by a unique set of digits that identifies each table. For each SQL*.DAT file there might be one or more of the following files, depending on the table type, the reorganization status of the table, or whether indexes, LOB, or LONG fields exist for the table:
  • SQL*.BKM (contains block allocation information if it is an MDC table)
  • SQL*.LF (contains LONG VARCHAR or LONG VARGRAPHIC data)
  • SQL*.LB (contains BLOB, CLOB, or DBCLOB data)
  • SQL*.XDA (contains XML data)
  • SQL*.LBA (contains allocation and free space information about SQL*.LB files)
  • SQL*.INX (contains index table data)
  • SQL*.IN1 (contains index table data)
  • SQL*.DTR (contains temporary data for a reorganization of an SQL*.DAT file)
  • SQL*.LFR (contains temporary data for a reorganization of an SQL*.LF file)
  • SQL*.RLB (contains temporary data for a reorganization of an SQL*.LB file)
  • SQL*.RBA (contains temporary data for a reorganization of an SQL*.LBA file)