Unix Technical Forum

moving a local database to another instance

This is a discussion on moving a local database to another instance within the DB2 forums, part of the Database Server Software category; --> Hello. I have two databases under 1 instance (w2003, v8 ese, fp3). I created a second instance and want ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 04:37 PM
Mark Barinstein
 
Posts: n/a
Default moving a local database to another instance

Hello.

I have two databases under 1 instance (w2003, v8 ese, fp3).
I created a second instance and want to start 1 of my databases under new
instance.
Can I do this without backup / restore?

Mark.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 04:37 PM
Fabrizio Napolitano
 
Posts: n/a
Default Re: moving a local database to another instance


Hi Mark ,

you can without problems, but you can also give a look at the command:
db2relocatedb
just a snip from the command reference...

If the instance that a database belongs to is changing, the following
must be done before running this command to ensure that changes to the
instance and database support files will be made:

If a database is being moved to another instance, create the new
instance.
Copy the files/devices belonging to the databases being copied onto the
system where the new instance resides. The path names must be changed as
necessary.
Change the permission of the files/devices that were copied so that they
are owned by the instance owner.
If the instance is changing, the tool must be run by the new instance
owner.

In a partitioned database environment, this tool must be run against
every partition that requires changes. A separate configuration file
must be supplied for each partition, that includes the NODENUM value of
the partition being changed. For example, if the name of a database is
being changed, every partition will be affected and the db2relocatedb
command must be run with a separate configuration file on each
partition. If containers belonging to a single database partition are
being moved, the db2relocatedb command only needs to be run once on that
partition.

Example 2

To move the database DATAB1 from the instance jsmith on the path /dbpath
to the instance prodinst do the following:

Move the files in the directory /dbpath/jsmith to /dbpath/prodinst.
Use the following configuration file with the db2relocatedb command to
make the changes to the database files:
DB_NAME=DATAB1
DB_PATH=/dbpath
INSTANCE=jsmith,prodinst
NODENUM=0

Hope this helps
Fabrizio


"Mark Barinstein" <mark@crk.vsi.ru> wrote in message
news:bm5l0g$1l0f$1@serv.vrn.ru

> Hello.
>
> I have two databases under 1 instance (w2003, v8 ese, fp3).
> I created a second instance and want to start 1 of my databases under new
> instance.
> Can I do this without backup / restore?
>
> Mark.





--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:34 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com