Search This Blog

Total Pageviews

Wednesday, 19 October 2016

Oracle Home clone or clone oracle home


Oracle  Home clone ...


Clone Oracle Home




aim to clone oracle home on same host from oracle owner to oraaj owner 



From home /u01/app/oracle/product/11.2.0/dbhome_1 as oracle user and owner oracle

To home /u01/app/oraaj/product/11.2.0/dbhome_1 as oracle user and owner oraaj



create new user 

/usr/sbin/useradd -d /home/oraaj -g oinstall -G dba,asmdba -s /bin/bash -u 1500 oraaj

set passwd ...

echo "oracle" | /usr/bin/passwd oraaj --stdin



mkdir -p /u01/app/oraaj/product/11.2.0

cd /u01/app/
ls -ltr
chown -R oraaj:oinstall oraaj/





as root 

For Zip and tar

cd /u01/app/oracle/product/11.2.0/

tar cvf - dbhome_1 | gzip -c > dbhome_1.tar.gz ---------- [or for full path tar cvf - /u01/app/oracle/product/11.2.0/dbhome_1 | gzip -c > dbhome_1.tar.gz]



[root@oraasm11g 11.2.0]# ls -ltr
total 2638088
drwxr-xr-x 77 oracle oinstall 4096 Jun 14 10:27 dbhome_1
-rw-r--r-- 1 root root 2701390392 Oct 14 08:02 dbhome_1.tar.gz

mv dbhome_1.tar.gz /u01/app/oraaj/product/11.2.0/


unzip and untar the file 

[root@oraasm11g 11.2.0]# gunzip -c dbhome_1.tar.gz | tar xf -


chown -R oraaj:oinstall dbhome_1/


[root@oraasm11g ~]# su - oraaj

[oraaj@oraasm11g ~]$ id
uid=1500(oraaj) gid=54321(oinstall) groups=54321(oinstall),1300(asmdba),54322(dba)




export ORACLE_HOME=/u01/app/oraaj/product/11.2.0/dbhome_1



[oraaj@oraasm11g dbhome_1]$ echo $ORACLE_HOME
/u01/app/oraaj/product/11.2.0/dbhome_1



$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/clone/bin/clone.pl ORACLE_BASE="/u01/app/oraaj/" ORACLE_HOME="/u01/app/oraaj/product/11.2.0/dbhome_1" OSDBA_GROUP=dba -defaultHomeName ORACLE_HOME_NAME="ORAAJ_HOME"

./runInstaller -clone -waitForCompletion "ORACLE_BASE=/u01/app/oraaj/" "ORACLE_HOME=/u01/app/oraaj/product/11.2.0/dbhome_1" "oracle_install_OSDBA=dba" -defaultHomeName "ORACLE_HOME_NAME=ORAAJ_HOME" -silent -noConfig -nowait
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 3999 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-10-14_10-07-17AM. Please wait ...
Oracle Universal Installer, Version 11.2.0.4.0 Production
Copyright (C) 1999, 2013, Oracle. All rights reserved.

You can find the log of this install session at:
 /u01/app/oraInventory/logs/cloneActions2016-10-14_10-07-17AM.log
....................................................................................................
 100% Done.



Installation in progress (Friday, October 14, 2016 10:07:48 AM BST)
.............................................................................. 78% Done.
Install successful

Linking in progress (Friday, October 14, 2016 10:08:16 AM BST)
Link successful

Setup in progress (Friday, October 14, 2016 10:11:51 AM BST)
Setup successful

End of install phases.(Friday, October 14, 2016 10:12:30 AM BST)
WARNING:
The following configuration scripts need to be executed as the "root" user.
/u01/app/oraaj/product/11.2.0/dbhome_1/root.sh
To execute the configuration scripts:
 1. Open a terminal window
 2. Log in as "root"
 3. Run the scripts

The cloning of ORAAJ_HOME was successful.
Please check '/u01/app/oraInventory/logs/cloneActions2016-10-14_10-07-17AM.log' for more details.


============

as a root !!!!!!!!!!!!!!


[root@oraasm11g ~]# /u01/app/oraaj/product/11.2.0/dbhome_1/root.sh
Check /u01/app/oraaj/product/11.2.0/dbhome_1/install/root_oraasm11g_2016-10-14_10-13-55.log for the output of root script
[root@oraasm11g ~]# cat /u01/app/oraaj/product/11.2.0/dbhome_1/install/root_oraasm11g_2016-10-14_10-13-55.log
Performing root user operation for Oracle 11g

The following environment variables are set as:
 ORACLE_OWNER= oraaj
 ORACLE_HOME= /u01/app/oraaj/product/11.2.0/dbhome_1
 Copying dbhome to /usr/local/bin ...
 Copying oraenv to /usr/local/bin ...
 Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
Finished product-specific root actions.



*****************************************************************




to detach home if required 


./runInstaller.sh -silent -detachHome ORACLE_HOME="/u01/app/oraaj/product/11.2.0/dbhome_1"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 3999 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'DetachHome' was successful.

Oracle DBA

anuj blog Archive