When a database is created, the database manager creates a separate subdirectory to store control files (such as log header files) and to allocate containers to default table spaces. Objects associated with the database are not always stored in the database directory; they can be stored in various locations, including directly on devices.
The database is created in the instance that is defined in the DB2INSTANCE environment variable or in the instance to which you have explicitly attached (using the ATTACH command). See the "Using Multiple Instances of the Database Manager" for an introduction to instances.
The naming scheme used on UNIX platforms is
current_path/$DB2INSTANCE/NODE/SQL00001The naming scheme used on Intel platforms is
D:current_path\$DB2INSTANCE\NODE\SQL00001where "D:" is a "drive letter" identifying the volume where the root directory is located.
SQL00001 contains objects associated with the first database created, and subsequent databases are given higher numbers: SQL00002 and so on.
The subdirectories are created in a directory with the same name as the database manager instance to which you are attached when you are creating the database. (On Intel platforms, the subdirectories are created under the root directory on a given volume which is identified by a "drive letter".) These instance and database subdirectories are created within the path specified in the CREATE DATABASE command, and the database manager maintains them automatically. Depending on your platform, each instance might be owned by an instance owner, who has system administrator (SYSADM) authority over the databases belonging to that instance.
To avoid potential problems, do not create directories that use the same naming scheme, and do not manipulate directories that have already been created by the database manager.
The following files are found within the database:
With circular logging, the files are reused and the same numbers will remain. With archival logging, the file numbers will increase in sequence as logs are archived and new logs are allocated. When 9999999 is reached, the number will wrap.
By default, these log files are stored in a directory called SQLOGDIR. SQLOGDIR is found in the SQLnnnnn subdirectory.
Notes: