2010-04-30

Clone oracle 10g database software on Solaris

Environment
Oracle 10.2.0.4, Solaris 10

Cloning
1. Install oracle software, recommended patches and CPU on source host.
2. Oracle recommends to shutdown any databases, listeners, agents etc before copying files.
3. prepare exception list
export CLONE=/oracle/stage/clone10.2.0.4
cd $ORACLE_HOME
find . -name "*.log" >$CLONE/ExcludeList.txt
find . -name "*.err" >>$CLONE/ExcludeList.txt
# network/admin can be useful for next installation
#find ./network/admin >>$CLONE/ExcludeList.txt
find ./oc4j/j2ee/OC4J_DBConsole_* >>$CLONE/ExcludeList.txt
find `hostname |cut -d "." -f 1`*_* >>$CLONE/ExcludeList.txt
# DBCA templates, If u have them
find ./assistants/dbca/templates >>$CLONE/ExcludeList.txt
cat $CLONE/ExcludeList.txt

4. archive source Oracle home
cd $ORACLE_HOME
tar -cvfX - $CLONE/ExcludeList.txt . | gzip -c >$CLONE/oracle_home.tar.gz

5. copy tar.gz file to target host
6. extract oracle home as root to preserve permissions
# cd $ORACLE_HOME
cd /oracle/rdbms/10.2.0/ora10P1
gunzip < /oracle/stage/clone10.2.0.4/oracle_home.tar.gz | tar xvf -
# if you need to change owner of installation. Owner group is the same.
find . -user ora10T4 -exec chown ora10P1 {} \;

7. on target host as oracle user
cd $ORACLE_HOME/rdbms/lib
mv config.o config.o_backup

8. Solaris specific. To change group (dba) that owns the installation modify
vi $ORACLE_HOME/rdbms/lib/config.s
otherwise go to next step

9. Solaris specific
IGNORE make -f ins_rdbms.mk config.o It returns: make: Fatal error: Command failed for target `config.o'
make -f ins_rdbms.mk ioracle

10. run Installer
cd $ORACLE_HOME/oui/bin
detach oracle home if it exists
./runInstaller -detachHome ORACLE_HOME="/oracle/rdbms/10.2.0/ora10P1"
./runInstaller -clone -silent -ignorePreReq ORACLE_HOME="/oracle/rdbms/10.2.0/ora10P1" ORACLE_HOME_NAME="db_home_10g2_1"
and run as root
$ORACLE_HOME/root.sh

11. (optional) Let other users use Oracle Home.
cd $ORACLE_HOME/install
./changePerm.sh

Useful links
  1. Metalink DocID 300062.1 How To Clone An Existing RDBMS Installation Using OUI
  2. Metalink DocID 558478.1 Cloning A Database Home And Changing The User/Group That Owns It
  3. Oracle Software Cloning Using Oracle Universal Installer

No comments:

Post a Comment