Tuesday, January 19, 2010

DB2 Physical Database Layout














































DB2 Physical Database Layout


It's important to know the physical file
locations where DB2 has been installed and this varies from operating
system to operating system. We'll look at the default locations for
Windows and Linux.




DB2 on Windows


When DB2 is installed on Windows the main database server files are installed in C:\Program Files\IBM\SQLLIB.
For each DB2 instance a directory is created in the SQLLIB directory,
for example, DB2 and DB2CTLSV. In these directories, you can find dump
files that relate to access violations and so on. It is often useful to
look through these because they can show interesting bits of
information. Another interesting file is the db2diag.log file. This
contains all sorts of useful information.


The actual data files can be found in directories
off the root of the drive. For each database instance there is a
directory off the root, for example, C:\DB2 and C:\DB2CTLSV.
Under these directories is another called NODE0000, and under this is
SQL00001 to SQL0000X and SQLDBDIR. Various files relating to the
instance and each database in the instance can be found in here.





DB2 on Linux


The main database server files can be found in the /opt/IBM/db2/
directory but many of these files are linked to from elsewhere. When
DB2 is installed three new accounts are created: dasusr1, db2fenc1, and
db2inst1. Each of these accounts is given a home directory, off /home, and these directories contain (or link to) the relevant files.


The dasusr1 is responsible for running the DAS. /home/dasusr1
contains a directory called das and under here are directories such as
adm, which contains the DAS binaries, and dump. This dump directory
contains a file called db2dasdiag.log, which can contain useful
information.


The db2inst1 user is responsible for running DB2 instances. /home/db2inst1
contains two important directories: sqllib and db2inst1. The former
contains database server–specific files and the latter contains the
data files.


The db2fenc1 user is the account used for running fenced routines but nothing interesting can be found in its home directory.






































No comments: