If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Path to active log files

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-12-09, 15:57
savethytrees savethytrees is offline
Registered User
 
Join Date: Dec 2006
Posts: 25
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?
Reply With Quote
  #2 (permalink)  
Old 05-12-09, 16:49
chinatrain99 chinatrain99 is offline
Registered User
 
Join Date: Sep 2003
Posts: 73
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.
Reply With Quote
  #3 (permalink)  
Old 05-12-09, 16:56
savethytrees savethytrees is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 05-13-09, 09:48
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Try "db2 list db directory on /db2inst1" - this should tell you each database path along with its name and alias.
Reply With Quote
  #5 (permalink)  
Old 05-13-09, 10:59
savethytrees savethytrees is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On