Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2006
    Posts
    25

    Unanswered: Path to active log files

    Hi,
    DB2 UDB V9.5 on SUN OS 10

    I understnd that when you create a database the path to active log path is something like this.
    /db2home/db2inst1/NODE0000/SQL0001/SQLOGDIR

    I have multiple directory like the one above for each database under each of the following directories.
    drwxr-x--- 4 db2inst1 db2grp 512 Apr 12 19:28 SQL00001
    drwxr-x--- 4 db2inst1 db2grp 512 Apr 12 19:32 SQL00003
    drwxr-x--- 4 db2inst1 db2grp 512 Apr 12 19:36 SQL00005
    drwxr-x--- 4 db2inst1 db2grp 512 Apr 12 19:41 SQL00007
    drwxr-x--- 4 db2inst1 db2grp 512 Apr 12 19:43 SQL00008

    Recently I changed the path to my active log files to a different filesystem. Now I want to move them back to the above filesystem and use the same directory as it used to use before. But my problem is that now I am not able to associate the correct SQL0000* directory with each database. I dont want to keep the active log files for one database under a different SQL0000* dir.
    How can I map these directories to the database name?

  2. #2
    Join Date
    Sep 2003
    Posts
    78
    I wouldn't think you would want to "map" them. DB2 will rewrite them when it switches over to the new log path. I believe that you will need to remove the defined but unused logs from the db2home/db2inst1/NODE0000/SQL0001/SQLOGDIR directory.

  3. #3
    Join Date
    Dec 2006
    Posts
    25

    path to log files

    I know I dont need to map them but heres the reason why I am trying to do this.

    For each database there is dbpath like this
    /db2home/db2inst1/NODE0000/SQL0001

    Under this directory DB2 creates the recovery history file, the systoolspace containers and the dead lock event monitor among other things. So I want to use the exact SQL0000* directory as the one that DB2 is currently using for each that database.

    I found that if I run the db2evmon command for each path then in the output I get the database name

    [SQL00001]$ db2evmon -path /db2inst1/NODE0000/SQL00001/db2event/*

    Reading /db2inst1/NODE0000/SQL00001/db2event/db2detaildeadlock/00000000.evt ...
    --------------------------------------------------------------------------
    EVENT LOG HEADER
    Event Monitor name: DB2DETAILDEADLOCK
    Server Product ID:
    Version of event monitor data:
    Byte order:
    Number of nodes in db2 instance: 1
    Codepage of database:
    Territory code of database: 1
    Server instance name: db2inst1
    --------------------------------------------------------------------------

    --------------------------------------------------------------------------
    Database Name: SAMPLE
    Database Path: /DB2/db2inst1/NODE0000/SQL00001/
    First connection timestamp: 03/19/2009 22:48:53.353407
    Event Monitor Start time: 03/19/2009 22:48:53.951967
    --------------------------------------------------------------------------

    This is the best way I could find out for now. I know what I am doing is not neccessary but I just to be systematic so that when someone else looks at it. It looks organized and its easy to find things.

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Try "db2 list db directory on /db2inst1" - this should tell you each database path along with its name and alias.
    ---
    "It does not work" is not a valid problem statement.

  5. #5
    Join Date
    Dec 2006
    Posts
    25

    PAth to logs files

    That worked perfect. This is the output i got.

    db2 list db directory on /db2home/db2inst1

    Local Database Directory on db2home/db2inst1

    Number of entries in the directory = 19

    Database 1 entry:

    Database alias = database1
    Database name = database1
    Database directory = SQL00025
    Database release level = a.00
    Comment =
    Directory entry type = Home
    Catalog database partition number = 0
    Database partition number = 0

    Database 2 entry:

    Database alias = database2
    Database name = database2
    Database directory = SQL00018
    Database release level = a.00
    Comment =
    Directory entry type = Home
    Catalog database partition number = 0
    Database partition number = 0

    Database 3 entry:

    Database alias = database3
    Database name = database3
    Database directory = SQL00038
    Database release level = a.00
    Comment =
    Directory entry type = Home
    Catalog database partition number = 0
    Database partition number = 0

    So I guess the exact term that I should be looking for is the database directory.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •