Thursday, December 11, 2014

Cloning an Oracle Home in Oracle 12c

1. Create a TAR file with the Oracle home (but not the Oracle base) directory (ZIP has problems to preserve permission and ownerships) ("-p" option in tar is default if run with super user)

root@solaris:/u01/stage# tar cvf - /u01/app/oracle/product/12.1.0/dbhome_1 | gzip -c > dbhome_1.tar.gz

2. Copy the TAR file to the root directory of the target computer. If you use File Transfer Protocol (FTP), then transfer the TAR file in binary mode only.

root@solaris:/u01/stage# scp dbhome_1.tar.gz   oracle@192.168.6.101:/u01/
dbhome_1.tar.gz      100% |*************************************|  2648 MB    14:31


3. Extract the TAR file content using the following command:

root@solaris112:/# gunzip -c dbhome_1.tar.gz | tar xf -


root@solaris112:/u01# chown oracle:oinstall app
root@solaris112:/u01# chown oracle:oinstall app/oracle/
root@solaris112:/u01# chown oracle:oinstall app/oracle/product/
root@solaris112:/u01# chown oracle:oinstall app/oracle/product/12.1.0/

4. On the target computer, change the directory to the unzipped Oracle home directory, and remove all the .ora (*.ora) files present in the unzipped $ORACLE_HOME/network/admin directory.

oracle@solaris112:~$ rm /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/*.ora

5. From the $ORACLE_HOME/clone/bin directory, run the clone.pl file for the unzipped Oracle home.

oracle@solaris112:~$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1

oracle@solaris112:~$ $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/clone/bin/clone.pl ORACLE_BASE="/u01/app/oracle/" ORACLE_HOME="/u01/app/oracle/product/12.1.0/dbhome_1" OSDBA_GROUP=dba -defaultHomeName

./runInstaller -clone -waitForCompletion  "ORACLE_BASE=/u01/app/oracle/" "ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1" "oracle_install_OSDBA=dba" -defaultHomeName  -silent -paramFile /u01/app/oracle/product/12.1.0/dbhome_1/clone/clone_oraparam.ini
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB.   Actual 1371 MB    Passed
Checking swap space: must be greater than 500 MB.   Actual 1570 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-12-11_03-29-21PM. Please wait ...You can find the log of this install session at:
/u01/app/oraInventory/logs/cloneActions2014-12-11_03-29-21PM.log
..................................................   5% Done.
..................................................   10% Done.
..................................................   15% Done.
..................................................   20% Done.
..................................................   25% Done.
..................................................   30% Done.
..................................................   35% Done.
..................................................   40% Done.
..................................................   45% Done.
..................................................   50% Done.
..................................................   55% Done.
..................................................   60% Done.
..................................................   65% Done.
..................................................   70% Done.
..................................................   75% Done.
..................................................   80% Done.
..................................................   85% Done.
..........
Copy files in progress.

Copy files successful.

Link binaries in progress.

Link binaries successful.

Setup files in progress.

Setup files successful.

Setup Inventory in progress.

Setup Inventory successful.

Finish Setup successful.
The cloning of OraHome1 was successful.
Please check '/u01/app/oraInventory/logs/cloneActions2014-12-11_03-29-21PM.log' for more details.

Setup Oracle Base in progress.

Setup Oracle Base successful.
..................................................   95% Done.

As a root user, execute the following script(s):
        1. /u01/app/oraInventory/orainstRoot.sh
        2. /u01/app/oracle/product/12.1.0/dbhome_1/root.sh

..................................................   100% Done.


root@solaris112:/u01# /u01/app/oraInventory/orainstRoot.sh
root@solaris112:/u01# /u01/app/oracle/product/12.1.0/dbhome_1/root.sh

6. To configure the connection information for the new database, run Net Configuration Assistant:

$ cd $ORACLE_HOME/bin
$ ./netca

7. To create a new database for the newly cloned Oracle home, run Database Configuration Assistant:

$ cd $ORACLE_HOME/bin
$ ./dbca


Error 1:

..........SEVERE:Unable to create directory /u01/app/oracle. You may not have the proper permission to create the directory, or there is no space left in the volume.
Unable to create the Oracle Base you have specified.
The cloning of OraHome1 was unsuccessful.
Please check '/export/home/oracle/oraInventory/logs/cloneActions2014-12-11_03-25-50PM.log' for more details.

Fix: Change folder permission (Refer to step 3)

No comments:

Post a Comment