Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

changing Local database directory

1,337 views
Skip to first unread message

Shashi Shekhar

unread,
Mar 22, 2016, 9:32:28 PM3/22/16
to
Hi All,

I found a discrepancy. in output of "db2 list db directory" the "local database directory" is showing as "/db2home/db2inst1". and "db2 get dbm cfg | grep DBPATH" as /db_data.

I don't understand why there is difference and how can we change from "/db2home/db2inst1" to "/db_data".

could you please share any idea, Thanks in advance.

Shashi

Ian

unread,
Mar 23, 2016, 3:37:23 PM3/23/16
to
The DFTDBPATH database manager (DBM) configuration parameter is just a
default value –
if you create a database without specifying `DBPATH ON /path`, then DB2
will use the value
of `DFTDBPATH` specified in the DBM configuration.







Shashi Shekhar

unread,
Mar 23, 2016, 4:43:19 PM3/23/16
to
On Thursday, March 24, 2016 at 1:07:23 AM UTC+5:30, Ian wrote:
> On 2016-03-23 01:32:27 +0000, Shashi Shekhar said:
>
> > Hi All,
> >
> > I found a discrepancy. in output of "db2 list db directory" the "local
> > database directory" is showing as "/db2home/db2inst1". and "db2 get dbm
> > cfg | grep DBPATH" as /db_data.
> >
> > I don't understand why there is difference and how can we change from
> > "/db2home/db2inst1" to "/db_data".
> > could you please share any idea, Thanks in advance.
>
>
> The DFTDBPATH database manager (DBM) configuration parameter is just a
> default value -
> if you create a database without specifying `DBPATH ON /path`, then DB2
> will use the value
> of `DFTDBPATH` specified in the DBM configuration.

Thanks Ian for reply.

Just clarifying my concept, Data will be stored at path referred by "DBPATH" ?

What is significance of path "/db2home/db2inst1" of below command -

"db2 list db directory" the "local database directory" is showing as "/db2home/db2inst1". "

Can we be able to change to /db_data ?

Thanks in advance.

Shashi

Lennart Jonsson

unread,
Mar 23, 2016, 11:05:33 PM3/23/16
to
dbm cfg is a default value, if you don't specify anything during
create/restore this cfg will be used. It's easiest to
backup/drop/restore if you want to move your database. If you're not
familiar with how to restore a backup you can ask db2 to generate a
script for you that you can tweak:

db2 restore db ... taken at ... redirect generate script myscript.sql

modify myscript.sql to your needs and then run the script like:

db2 -tf myscript.sql


/Lennart

Ian

unread,
Mar 24, 2016, 9:09:56 PM3/24/16
to
On 2016-03-23 20:43:17 +0000, Shashi Shekhar said:

> On Thursday, March 24, 2016 at 1:07:23 AM UTC+5:30, Ian wrote:
>> On 2016-03-23 01:32:27 +0000, Shashi Shekhar said:
>>
>>> Hi All,
>>>
>>> I found a discrepancy. in output of "db2 list db directory" the "local
>>> database directory" is showing as "/db2home/db2inst1". and "db2 get dbm
>>> cfg | grep DBPATH" as /db_data.
>>>
>>> I don't understand why there is difference and how can we change from
>>> "/db2home/db2inst1" to "/db_data".
>>> could you please share any idea, Thanks in advance.
>>
>>
>> The DFTDBPATH database manager (DBM) configuration parameter is just a
>> default value -
>> if you create a database without specifying `DBPATH ON /path`, then DB2
>> will use the value
>> of `DFTDBPATH` specified in the DBM configuration.
>
> Thanks Ian for reply.
>
> Just clarifying my concept, Data will be stored at path referred by "DBPATH" ?

Not necessarily. The database path always configuration information (database
configuration file, location of tablespace containers, the log file header,
etc.) in the database path. Tablespace containers may reside in the database
path, but that's far less common.

Please read the documentation for the CREATE DATABASE command,
paying attention to the 'ON' and 'DBPATH ON' parameters.

http://www.ibm.com/support/knowledgecenter/#!/SSEPGG_10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0001941.html?cp=SSEPGG_10.5.0%2F3-6-2-4-21



> What is significance of path "/db2home/db2inst1" of below command -
>
> "db2 list db directory" the "local database directory" is showing as
> "/db2home/db2inst1". "
>
> Can we be able to change to /db_data ?

The path /db2home/db2inst1 is the database path (i.e. what DB2 used for
DBPATH ON
for the create database statement).

You can change this. The easiest way to do it is via backup/restore.


>

0 new messages