469,282 Members | 1,743 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

recreate a same database

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
6 1970
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
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
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
<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
for sql procedures, "text" column of syscat.procedures will also help
you in some situation.

Nov 12 '05 #6
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.

Similar topics

9 posts views Thread by Vassago | last post: by
5 posts views Thread by Gustavo Randich | last post: by
2 posts views Thread by Mark | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.