Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old March 14th, 2006, 03:05 PM
Frank
Guest
 
Posts: n/a
Default Relocate DB2 databases

Hi,

I have two databases in DB2 v8.2 (Windows 2003 Server platform) and right
now both databases are on my c-drive.

Unfortunately space on this drive is becoming low and I want to relocate the
databases to my d-drive.

You can change properties of an instance (default database path), but this
applies to new databases.

Can somebody explain to me in detail how to get my databases and logging
files to the d-drive (same db2 folder) please? I am trying to find this info
all over the place, but I cannot find the exact info.

Already I tried to uncatalog one of the databases, copied folder c:\db2 and
its subfolders to the d-drive, but when I issue the command catalog database
X on d: I get an error that there was no informatie or something in the
config file and I cannot get the database back online.

Your help is very much appreciated.

Kind regards,

Frank

PS I know in MS SQL server you just have to detach the database, move the
files (data and log) to the new location and then attach the database, but
it seems DB2 is very different.





  #2  
Old March 14th, 2006, 03:45 PM
Ian
Guest
 
Posts: n/a
Default Re: Relocate DB2 databases

Frank wrote:
[color=blue]
> Can somebody explain to me in detail how to get my databases and logging
> files to the d-drive (same db2 folder) please? I am trying to find this info
> all over the place, but I cannot find the exact info.[/color]

There are two ways to do it in DB2:

1) backup database and use a redirected restore to tell DB2 to restore
the data on the D: drive

http://publib.boulder.ibm.com/infoce...n/c0006249.htm


2) Use the db2relocatedb command after moving the files manually.

http://publib.boulder.ibm.com/infoce...e/r0004500.htm




Note, to move your logfiles, you need to set the NEWLOGPATH database
config parameter. The next time DB2 starts, it will use the new path
for your log files.

  #3  
Old March 14th, 2006, 03:45 PM
Dave Hughes
Guest
 
Posts: n/a
Default Re: Relocate DB2 databases

Frank wrote:
[color=blue]
> Hi,
>
> I have two databases in DB2 v8.2 (Windows 2003 Server platform) and
> right now both databases are on my c-drive.
>
> Unfortunately space on this drive is becoming low and I want to
> relocate the databases to my d-drive.
>
> You can change properties of an instance (default database path), but
> this applies to new databases.
>
> Can somebody explain to me in detail how to get my databases and
> logging files to the d-drive (same db2 folder) please? I am trying to
> find this info all over the place, but I cannot find the exact info.
>
> Already I tried to uncatalog one of the databases, copied folder
> c:\db2 and its subfolders to the d-drive, but when I issue the
> command catalog database X on d: I get an error that there was no
> informatie or something in the config file and I cannot get the
> database back online.[/color]

Generally speaking, I get the impression DB2 considers its database
files sacrosanct (it doesn't appreciate the files being tampered with
by anything other than its own tools :-)

I'm really not sure about this, but it's probably worth a shot:

1. Take a back up of the database (BACKUP DB dbname)
2. Drop the database (DROP DB dbname)
3. Create a new database (with the same name as the old one) on your D:
drive (CREATE DB dbname ... ON D ...)
4. Restore the backup into the new database (RESTORE DB dbname ... INTO
....)


HTH,

Dave.
--

  #4  
Old March 14th, 2006, 04:55 PM
Gert van der Kooij
Guest
 
Posts: n/a
Default Re: Relocate DB2 databases

In article <4416d977$0$93008$dbd49001@news.euronet.nl>,
frankie_mulder@hotmail.com says...[color=blue]
> Hi,
>
> I have two databases in DB2 v8.2 (Windows 2003 Server platform) and right
> now both databases are on my c-drive.
>
> Unfortunately space on this drive is becoming low and I want to relocate the
> databases to my d-drive.
>[/color]

You can backup the database, drop it and restore it on the new drive
with the command:
db2 "restore <dbname> to 'd:\'"

This is the easiest way if your db isn't very large, otherwise it's
better to use the db2relocatedb. Check the online documentation at
http://tinyurl.com/mmgvt

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.