By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,190 Members | 2,204 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,190 IT Pros & Developers. It's quick & easy.

Database Physical Location in UDB 8.1

P: n/a
Hi,

How do I know the physical database path of a database. When I goto
the DB2INSTANCE users's directory (/home/db2inst1), I see following
folders:

/db2inst1/NODE0000/SQL00001
/db2inst1/NODE0000/SQL00002
/db2inst1/NODE0000/SQL00003
/db2inst1/NODE0000/SQL00004
/db2inst1/NODE0000/SQL00005

How do I know which database is using which of the above directory?

Is there any command, using which, if I supply the DB Name it will
give me the physical location of the database on server?

OS: Solaris 9
DB2: IBM UDB 8.1

Regards,
Kamlesh
Nov 12 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
In article <26*************************@posting.google.com> , Kamlesh
(ka*********@yahoo.com) says...
Hi,

How do I know the physical database path of a database. When I goto
the DB2INSTANCE users's directory (/home/db2inst1), I see following
folders:

/db2inst1/NODE0000/SQL00001
/db2inst1/NODE0000/SQL00002
/db2inst1/NODE0000/SQL00003
/db2inst1/NODE0000/SQL00004
/db2inst1/NODE0000/SQL00005

How do I know which database is using which of the above directory?

Is there any command, using which, if I supply the DB Name it will
give me the physical location of the database on server?


Hi,

You can use the 'list db directory on ....' command to get the
physical path.
Nov 12 '05 #2

P: n/a
If you haven't moved the log files from their default location; you can
examine the database configuration and get the directory from the "Path
to log files" value.

You can also examine ..../NODE0000/sqldbdir/sqldbdir. That file contains
the database names and directory for each but it's not intended to be
read by people.

If you connect to a database; you can use "list tablespace containers
for 0" which will give you the path to the containers.

Phil Sherman
Kamlesh wrote:
Hi,

How do I know the physical database path of a database. When I goto
the DB2INSTANCE users's directory (/home/db2inst1), I see following
folders:

/db2inst1/NODE0000/SQL00001
/db2inst1/NODE0000/SQL00002
/db2inst1/NODE0000/SQL00003
/db2inst1/NODE0000/SQL00004
/db2inst1/NODE0000/SQL00005

How do I know which database is using which of the above directory?

Is there any command, using which, if I supply the DB Name it will
give me the physical location of the database on server?

OS: Solaris 9
DB2: IBM UDB 8.1

Regards,
Kamlesh


Nov 12 '05 #3

P: n/a

"Kamlesh" <ka*********@yahoo.com> wrote in message
news:26*************************@posting.google.co m...
Hi,

How do I know the physical database path of a database. When I goto
the DB2INSTANCE users's directory (/home/db2inst1), I see following
folders:

/db2inst1/NODE0000/SQL00001
/db2inst1/NODE0000/SQL00002
/db2inst1/NODE0000/SQL00003
/db2inst1/NODE0000/SQL00004
/db2inst1/NODE0000/SQL00005

How do I know which database is using which of the above directory?

Is there any command, using which, if I supply the DB Name it will
give me the physical location of the database on server?

OS: Solaris 9
DB2: IBM UDB 8.1

I'm not sure how to get from the directory that you want to the database
name but I can tell you how to get from the database name to the directory.
If you follow these instructions, you should be able to map each of your
databases to a specific directory. Once you have built this map, it will be
easy to determine which database is associated with a specific directory.

1. Execute this command at your DB2 CLP prompt:
db2 list database directory

This will list all of your system database directory.

Find the database that interests you in the result via its database name,
e.g. SAMPLE. Look at the value of 'database drive' for that database.

2. Execute this command at your DB2 CLP prompt:

db2 list database directory on <database_drive>

The directory name you want will appear in the result of that query in the
'database directory' value for the desired database, e.g. SQL00002.

Just in case that is not clear, this is what I did on my system, which is
DB2 V7.2 on Windows XP:
db2 list database directory
Result:

[snip]

Database 6 entry:
Database alias = SAMPLE
Database name = SAMPLE
Database drive = C:\DB2
Database release level = 9.00
Comment = DB2 Sample Database
Directory entry type = Indirect
Catalog node number = 0

Then, using the 'database drive' value for database Sample, I executed:
db2 list database directory for c:\DB2


Result:

[snip]

Database 2 entry:
Database alias = SAMPLE
Database name = SAMPLE
Database directory = SQL00002
Database release level = 9.00
Comment =
Directory entry type = Home
Catalog node number = 0
Node number = 0

The directory name you want, SQL00002, is in the 'database directory' field
of this result under the SAMPLE database's entry.

If you simply repeat this process for each of your databases, you will soon
know exactly which database maps to each directory.

Rhino

Nov 12 '05 #4

P: n/a
Thanks for all your response on this topic. I am able to get the
details I require using the following:

db2 list database directory
and then...
db2 list database directory on <database_drive>

I need one clarification here. The solution provided by you all is
only possible I am executing the commands directly on the Server
Console. Can I get the DB Physical Location from my Client System
which is having DB2 Client software installed. I have both Windows
and Unix based clients.

Regards,
Kamlesh
Nov 12 '05 #5

P: n/a

"Kamlesh" <ka*********@yahoo.com> wrote in message
news:26**************************@posting.google.c om...
Thanks for all your response on this topic. I am able to get the
details I require using the following:

db2 list database directory
and then...
db2 list database directory on <database_drive>

I need one clarification here. The solution provided by you all is
only possible I am executing the commands directly on the Server
Console. Can I get the DB Physical Location from my Client System
which is having DB2 Client software installed. I have both Windows
and Unix based clients.

Why don't you try it yourself and see? Use the same commands at the CLP on
your client.

Rhino
Nov 12 '05 #6

P: n/a
"list tablespace containers for 0" is run after establishing a database
connection. This should also work on the client. You will, of course,
need appropriate authorization to run the "list tablespace containers"
command.

Phil Sherman

Kamlesh wrote:
Thanks for all your response on this topic. I am able to get the
details I require using the following:

db2 list database directory
and then...
db2 list database directory on <database_drive>

I need one clarification here. The solution provided by you all is
only possible I am executing the commands directly on the Server
Console. Can I get the DB Physical Location from my Client System
which is having DB2 Client software installed. I have both Windows
and Unix based clients.

Regards,
Kamlesh


Nov 12 '05 #7

P: n/a
The list command for directories runs against the instance (they are
instance objects) that is identified by either the OS environment
variable DB2INSTANCE or by the db2 global registry profile variable
DB2INSDEF.
Both these variables are resolved as the application, the db2cmd command
window, is launched on the local system.
So your command on the server shows where the db's are located on that
server.
The command on your client would show the db's on your client, if any,
never the remote db's on the server.
HTH, Pierre.

Kamlesh wrote:
Thanks for all your response on this topic. I am able to get the
details I require using the following:

db2 list database directory
and then...
db2 list database directory on <database_drive>

I need one clarification here. The solution provided by you all is
only possible I am executing the commands directly on the Server
Console. Can I get the DB Physical Location from my Client System
which is having DB2 Client software installed. I have both Windows
and Unix based clients.

Regards,
Kamlesh


--
Pierre Saint-Jacques - Reply to: sescons at attglobal dot com
IBM DB2 Cerified Solutions Expert - Administration
SES Consultants Inc.
Nov 12 '05 #8

P: n/a
As an add on to this.
The list db directory on the client will show the path, on the server,
where the db exists.
If you map the server target drive to your platform, then you could run
the list db directory on <path>.
HTH, Pierre.
Pierre Saint-Jacques wrote:
The list command for directories runs against the instance (they are
instance objects) that is identified by either the OS environment
variable DB2INSTANCE or by the db2 global registry profile variable
DB2INSDEF.
Both these variables are resolved as the application, the db2cmd command
window, is launched on the local system.
So your command on the server shows where the db's are located on that
server.
The command on your client would show the db's on your client, if any,
never the remote db's on the server.
HTH, Pierre.

Kamlesh wrote:
Thanks for all your response on this topic. I am able to get the
details I require using the following:

db2 list database directory and then...
db2 list database directory on <database_drive>

I need one clarification here. The solution provided by you all is
only possible I am executing the commands directly on the Server
Console. Can I get the DB Physical Location from my Client System
which is having DB2 Client software installed. I have both Windows
and Unix based clients.

Regards,
Kamlesh



--
Pierre Saint-Jacques - Reply to: sescons at attglobal dot com
IBM DB2 Cerified Solutions Expert - Administration
SES Consultants Inc.
Nov 12 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.