473,508 Members | 2,229 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2144
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3836
by: D | last post by:
Database 1 is corrupted. Database 2 was created by dba but none of the primary or foreign key constraints were ported over. TOAD won't let me export. I will try ErWin next. What is the best way...
2
2119
by: Alberto | last post by:
I need a tool that creates a script to recreate a db, including tables' data. Does it exists freeware ? thanks!
9
2331
by: Vassago | last post by:
Hi! I need to recreate the system tables (sysobjects, syscolumns, sysindexes, sysforeignkeys, sysconstraints, sysreferences, sysindexkeys at least) in another SQL server. You may say "Thats easy!...
5
3085
by: Gustavo Randich | last post by:
Hello, (Using DB2/LINUX 8.2.0) HOW-TO: recreate a big set of interdependent UDFs... without having to do it manually because of the imposed drop order due to the RESTRICT keyword of the DROP...
4
3650
by: Lisa | last post by:
I upsized a database to SQL and accidentally deleted a table, how can I recreate that linked table?
3
1356
by: -DG- | last post by:
In C++, there is a compelling reason to recreate projects for the VS2005 compiler rather than simply copy and recompile older code (reason being C++/CLI syntax). I'm wondering if there is any...
2
1311
by: Mark | last post by:
Any suggestions or documentation links on how to recreate the look and feel of the MSDN website with the drill down menus on the left? We have some intranet applications that we can restrict to...
3
1950
by: Sin Jeong-hun | last post by:
If I use something like this, string html = "<h1>C# is great</h1>"; Console.WriteLine(html.Replace("&lt;","<").Replace("&gt;",">")); Does this recreate new string objects two times, even though it...
1
2058
by: traceable1 | last post by:
I created a new database instance, but I forgot to script out the scheduled jobs before I wiped out the original database instance. I have attached the original msdb database as msdb_old onto the...
0
7229
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7129
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.