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

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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.


cplusplus030999Author Commented:
Thanks. I will get you back soon once I review and test it.
Sorry I should have said backup and restore rather than export import... apologies!  
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

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>
cplusplus030999Author Commented:
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)

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cplusplus030999Author Commented:
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.

> 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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.