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

recreate a same database

P: n/a
how to create a exact replica of a database.

I have a database . There must be some structure of it.
I want to recreate the same structure of the database on some another
new server .

Please help me.
best regards
bikash

Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
in case your target machine is of the same arch., just as win-to-win,
unix-unix(hpux,aix,solaris), you can use backup/restore utility, even
backup on a aix and restore to a hpux (there're detailed description
for the operations on "command referece").

if you use your own dms/sms tablespace, you have big possibility to
have a different directory/file/device set for tablespace, so you can
do a redirect restore.

db2 backup db xx
....
db2 restore db xx (into xxx) redirect
db2 set tablespace containers for tbsid ....
.....
db2 restore db xx continue

Nov 12 '05 #2

P: n/a
Hi Dirk,

Thanks a lot .It worked perfectly fine. After creating the structure I
also moved the data using db2move export /import utility.

Is there any way to move the package information , just like the way i
moved tables for a schema.

Best Regards
Bikash Karan


Dirk Deimeke wrote:
bi******@in.ibm.com <bi******@in.ibm.com> schrieb:
I have a database . There must be some structure of it.
I want to recreate the same structure of the database on some another
new server .


Try the following commands.

On your originating server:
db2look -d <databasename> -e -a -l -x -f -o <filename>

On your destination server:
db2 create database <destination>
db2 connect to databse <destination>
db2 +c -stvf <filename>

Good luck

Dirk


Nov 12 '05 #3

P: n/a
Hi Hardy,

Indeed it wokrd perfectly fine . I migrated another database using the
same command as you have given. I have got the same replicated model
in my new server.

But for another case 1 additional database , I couldn't do the same as
their were some disk space issue. So i used the db2look utility to
create the exact replica structure and their after i used db2move
utility to move the data into the new server.

Here one issue i am facing is how to migrate the packages . please
guide me.

Best Regards
BIkash Karan

Nov 12 '05 #4

P: n/a
<bi******@in.ibm.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi Dirk,

Thanks a lot .It worked perfectly fine. After creating the structure I
also moved the data using db2move export /import utility.

Is there any way to move the package information , just like the way i
moved tables for a schema.

Best Regards
Bikash Karan

If you request the stored procedure and function source code in the db2look,
and recreate them on the new server, then new packages will automatically be
created. However, it is a little tricky creating these from a db2look output
because you have change the default terminator when you run the script and
manually put a terminator at the end of each one (such as "@").
Nov 12 '05 #5

P: n/a
for sql procedures, "text" column of syscat.procedures will also help
you in some situation.

Nov 12 '05 #6

P: n/a
Look at the Command Reference "Chapter 3. CLP Commands" "GET ROUTINE"
and "PUT ROUTINE".

B.

Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.