Oracle 8i | Oracle 9i | Oracle 10g | Oracle 11g | Oracle 12c | Miscellaneous | PL/SQL | SQL | Oracle RAC | Oracle Apps | Linux

Manually Cloning an Existing Oracle Database Installation on Linux

This article describes the steps necessary to manually clone an existing Oracle database installation to a new Linux server. It was written in response to a specific request for a manual process for cloning a 9i home on a test system. Before starting this process it's worth reading the following notes:

With those points in mind, here are the list of steps necessary to clone an existing database installation to a new server.

Stop Oracle

Turn off all Oracle-related services, including the Enterprise Manager Grid Control, database and listener.

$ # EM
$ emctl stop dbconsole

$ # database and listener (>=10g)
$ dbshut $ORACLE_HOME

$ # listener (<10g)
$ lsnrctl stop

Create TAR File

TAR and optionally compress the mount point containing the Oracle software. In this case, all Oracle software and datafiles are beneath the "/u01" directory. Perform the following command as the "root" user.

# tar -cvf /tmp/u01.tar /u01
# gzip /tmp/u01.tar

Once this is complete you can restart Oracle on the source server.

Transfer TAR File

Copy the file from the source to the destination server. You can do this transfer using which ever method you like, but here I will use SCP command from the source server.

# scp /tmp/u01.tar.gz root@192.168.2.136:/tmp/u01.tar.gz

Extract TAR File

Decompress and extract the contents of the TAR file on the destination server. Perform the following commands as the "root" user on the destination server.

# gunzip /tmp/u01.tar.gz
# cd /
# tar -xvf /tmp/u01.tar

Check File Ownership

Check the ownership of the "/u01" directory and it's contents. If it doesn't match the ownership of the source server, alter it to match.

# chown -R oracle:oinstall /u01

Root Configuration Scripts

Run the root configutation scripts, generated as part of the original installation, on the destination server as the "root" user.

/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/db_1/root.sh

Modify Config Files

If you have not prepared the ".bash_profile" as part of the destination server setup, copy the file from the source to the destination server.

# scp /home/oracle/.bash_profile oracle@192.168.2.136:/home/oracle/.bash_profile

Edit the ".bash_profile" file on the destination server, giving it the correct value for the ORACLE_HOSTNAME environment variable.

Amend any hostname or IP references in the "listener.ora" and "tnsnames.ora" files in the "$ORACLE_HOME/network/admin" directory.

Edit the "/etc/oratab" making sure all instances are referenced correctly. In my case I need to add the following entry.

DB11G:/u01/app/oracle/product/11.2.0/db_1:Y

Start Oracle

Start the listener and database.

$ # listener (<10g)
$ lsnrctl start

$ # database and listener (>=10g)
$ dbstart $ORACLE_HOME

The database should now be functioning normally on the destination server.

Additional Configuration

If you are using Enterprise Manager Database Control (>= 10g), you will need to reconfigure it using the method described here.

If you require your database to restart automatically after reboot, configure it using the method specified here.

For more information see:

Hope this helps. Regards Tim...

Back to the Top.