If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Create Duplicate Database for Testing?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-14-03, 15:45
mwregan mwregan is offline
Registered User
 
Join Date: Jul 2003
Posts: 2
Red face Create Duplicate Database for Testing?

We have a production Informix 9.21 database that we need to apply some changes to, however, to be on the safe side, I'd like to copy the contents of the entire database into another "test" database first. The test database will reside on the same physical server in the same dbspace - however with a different database name.

Any Ideas on what to do? I've looked into dbexport/dbimport, onunload/onload etc... Is this something I can do in a series of SQL statements?

Help!

Thanks,
Mike
Reply With Quote
  #2 (permalink)  
Old 07-18-03, 08:33
adityanlal adityanlal is offline
Registered User
 
Join Date: Jul 2003
Location: Calcutta, India
Posts: 42
Re: Create Duplicate Database for Testing?

Hi! Mike

Steps to duplicate an Informix Database

1. Dbexport the production database i.e. the original database. Suppose the database name is "test_org" and u give the command "dbexport test_org". This command will create a directory under current working directory "test_org.exp" and create some unl file along with a SQL file called "test_org.sql".
2. Open that SQL file and u will see the first line is "database test_org" now change the database name to ur desired name say "test_dup" and now the first line will look like "database test_dup".
3. Now move the sql file, give the following command
mv test_org.sql test_dup.sql
3. Come to the previous directory and give the following command
mv test_org.exp test_dup.exp
dbimport test_dup -d <name of the DBSpace>

I hope this will solve ur problem. PLease let me know if u find any difficulty.

Thanks
adityanlal

Quote:
Originally posted by mwregan
We have a production Informix 9.21 database that we need to apply some changes to, however, to be on the safe side, I'd like to copy the contents of the entire database into another "test" database first. The test database will reside on the same physical server in the same dbspace - however with a different database name.

Any Ideas on what to do? I've looked into dbexport/dbimport, onunload/onload etc... Is this something I can do in a series of SQL statements?

Help!

Thanks,
Mike
Reply With Quote
  #3 (permalink)  
Old 07-18-03, 19:31
mwregan mwregan is offline
Registered User
 
Join Date: Jul 2003
Posts: 2
Talking Re: Create Duplicate Database for Testing?

Awesome! It worked great!

Thanks!
Mike


Quote:
Originally posted by adityanlal
Hi! Mike

Steps to duplicate an Informix Database

1. Dbexport the production database i.e. the original database. Suppose the database name is "test_org" and u give the command "dbexport test_org". This command will create a directory under current working directory "test_org.exp" and create some unl file along with a SQL file called "test_org.sql".
2. Open that SQL file and u will see the first line is "database test_org" now change the database name to ur desired name say "test_dup" and now the first line will look like "database test_dup".
3. Now move the sql file, give the following command
mv test_org.sql test_dup.sql
3. Come to the previous directory and give the following command
mv test_org.exp test_dup.exp
dbimport test_dup -d <name of the DBSpace>

I hope this will solve ur problem. PLease let me know if u find any difficulty.

Thanks
adityanlal
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On