How to Copy Oracle Schema to Another Server Using Schema Compare for Oracle

Read this article to learn how to use two special products developed by Devart - dbForge Schema Compare and Data Compare. With the help of these two products, you will be able to:

Ways to copy a server

In order to copy everything from one server to another, you first need to create an empty schema on the selected target server.

1. In Schema Compare, click New SQL on the Standard toolbar.

2. Select a connection in the Connect to Server window.

3. Type the following code and press Execute:

CREATE USER clone_sakila IDENTIFIED BY pass;
GRANT CONNECT TO clone_sakila;
GRANT RESOURCE TO clone_sakila;

You have now prepared the grounds for copying schema and data to a new server.

Create an empty schema in Oracle

How to copy Oracle schema

The next step after creating an empty target schema is to copy it from the source. In Schema Compare, you need to:

1. Click New Schema Comparison on the Standard toolbar.

2. Choose the needed Source and Target connections and schemas.

The Source should be the schema you are going to export, and Target - the empty schema you've created previously.

3. Click Compare once done.

4. Review the comparison results and choose the required objects for synchronization.

5. Click Synchronize.

 How to copy structure, not data of a Oracle table

Oracle schema synchronization

On comparing Source and Target, we saw a number of tables that are present in the former and missing in the latter. Let's continue by fixing that:

6. In the Schema Synchronization Wizard that opens, select what you wish to do with the synchronization script:

  • See it in the editor
  • Save to a file for further execution
  • Immediately execute

7. On executing the script, you will see that the Target schema is not empty anymore, as it now contains the schema from the Source.

Synchronize schema

How to copy data to Oracle schema

Since we have already copied the schema, it is time to copy the data as well. For this, we will be using dbForge Data Compare for Oracle. The process will be similar to schema comparison.

1. Click New Data Comparison on the Standard toolbar.

2. Choose the same Source and Target as before and then click Compare.

3. Review the comparison results to choose the required objects for synchronization.

4. Click Synchronize.

Duplicate all rows from one table to another

Oracle data synchronization

dbForge Data Compare for Oracle will copy all the data from Source to Target during the synchronization process.

4. In the Data Synchronization Wizard that opens, select what you wish to do with the synchronization script:

  • See it in the editor
  • Save to a file for further execution
  • Immediately execute

5. On executing the script, you will have all the previously selected data copied to the destination server.

Synchronize data

Conclusion

In this article, you've learned how to copy an Oracle schema, along with its data, to another server. dbForge Schema Compare for Oracle simplifies this process, allowing you to quickly compare Oracle schemas and obtain results with just a few easy steps using the Data Comparison Wizard.

dbForge Compare Bundle for Oracle

All you need to compare, analyze, and synchronize Oracle database schemas and data. Handle changes in your Oracle databases easily!