Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Posts
    2

    Red face Unanswered: 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

  2. #2
    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

    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

  3. #3
    Join Date
    Jul 2003
    Posts
    2

    Talking Re: Create Duplicate Database for Testing?

    Awesome! It worked great!

    Thanks!
    Mike


    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •