?
Solved

I want to have exact same database from server to my local

Posted on 2004-11-11
8
Medium Priority
?
432 Views
Last Modified: 2012-05-05
I need to get the exact same database (all of database objects should be same, everything must be same except that I want to have different database name on my local machine) from server to my local machine. What is the easy way to do so (copy or backup whatever). I have DB2 8.x installed on both server and local. I need to do it soon. It is just small database so that I can develop and test from my local machine. I worked with Oracle before. There are lots of ways to do. Thanks.
0
Comment
Question by:cplusplus030999
  • 3
  • 3
  • 2
8 Comments
 
LVL 3

Expert Comment

by:granbajo
ID: 12565099
Look at the comments on this question for some good pointers.  The easier way would be to do an export, and then an import.  Also, take a look at the db2move utility in the manuals.

http://www.experts-exchange.com/Databases/IBM_UDB/Q_21149952.html

0
 

Author Comment

by:cplusplus030999
ID: 12565819
Thanks. I will get you back soon once I review and test it.
0
 
LVL 3

Expert Comment

by:granbajo
ID: 12567224
Sorry I should have said backup and restore rather than export import... apologies!  
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 13

Expert Comment

by:ghp7000
ID: 12569167
easiest way is to take the most recent backup image of the production database and restore it to your test environment.
if you have access to the backup image, simply copy the entire directory structure of the backup image to your test machine.
From test machine, open command line processor and navigate to the top level directory of the backup image, this is typically <dbname.0>.
Issue command:
db2 restore database <dbname> into <new_db_name>
after restore completes:
db2 connect to <new_db_name>
0
 

Author Comment

by:cplusplus030999
ID: 12571199
Hi guys:

I tried but I got SQL4414N "The DB2 Administration Server is not active". After I issued "db2admin start". Then I got SQL 1032 "No start database manager command was issued". Also I only can do backup online (no offline allowed for production database). But for local testing, I don't need to have most recent transaction. I mean that I dont have to have most recent data, not backup to current time (allowing lost some data)

Thanks.
0
 
LVL 13

Accepted Solution

by:
ghp7000 earned 200 total points
ID: 12575945
issue: db2start, this should start the instance on your machine
on production side, do you have access to the administartion server? If so, start the db2 control center, drill down do the database, right click on database name and choose generate ddl. This will export the db structure to a file, move this file to your test machine and from command line, issue db2 -tvf <file_name>. This will clone the production db structure on your test machine.
For the data, export the tables to del files for any where condition and then load or import these files into your test database.
0
 

Author Comment

by:cplusplus030999
ID: 12576891
Hi ghp7000:

After opening command line processor, how could I navigate to the top level directory or any directory from there then. Thanks. I already got the backup image following your instructions. Thanks.
0
 
LVL 3

Assisted Solution

by:granbajo
granbajo earned 200 total points
ID: 12577734

> After opening command line processor, how could I navigate to the top level directory or any
> directory from there then.

If you are using windows, use the command line window and prefix all your commands with db2, it is the same thing, except that you are basically working from a DOS box.  You can achieve the same thing by typing db2cmd from a DOS prompt.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question