f



changing Local database directory

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 
0
Shashi
3/23/2016 1:32:27 AM
comp.databases.ibm-db2 12448 articles. 3 followers. arunrocks (9) is leader. Post Follow

4 Replies
856 Views

Similar Articles

[PageSpeed] 44

On 03/23/2016 02:32 AM, Shashi Shekhar wrote:
> 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
>

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

0
Lennart
3/23/2016 6:44:17 PM
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.







0
Ian
3/23/2016 7:37:18 PM
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 
0
Shashi
3/23/2016 8:43:17 PM
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
Ian
3/25/2016 1:09:28 AM
Reply: