# 本文为该系列第三部分,描述AIX 6.1克隆ORACLE HOME(克隆A机的ORACLE HOME完成B机的Oracle软件安装)

1.      确保A机Oracle软件安装成功

#     检查安装日志/orainventory_location/logs/installActionsdate_time.log就可以了.


2.      检查A机Oracle补丁状态

$ $ORACLE_HOME/OPatch/opatch lsinventory
Invoking OPatch 11.2.0.1.7

Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
  from           : /etc/oraInst.loc
OPatch version    : 11.2.0.1.7
OUI version       : 11.2.0.3.0
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2013-06-23_10-34-23AM.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2013-06-23_10-34-23AM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 11g                                                  11.2.0.3.0
There are 1 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.


--------------------------------------------------------------------------------

OPatch succeeded.
$


3.      A机停止任何与ORACLE HOME有关的进程


4.      A机归档ORACLE HOME

$ tar cvf Oracle.tar dbhome_1


5.      A机将Tar包发送到B机

$ scp Oracle.tar 192.168.128.100:/u01/app/oracle/product/11.2.0
The authenticity of host '192.168.128.100 (192.168.128.100)' can't be established.
RSA key fingerprint is 64:04:bd:1a:2a:a1:8d:e9:5a:35:a9:31:24:eb:31:64.
Are you sure you want to continue connecting (yes/no)?
yes
Warning: Permanently added '192.168.128.100' (RSA) to the list of known hosts.
oracle@192.168.128.100's password:
Oracle.tar                                                                                                                                                                                                 100% 7209MB  11.3MB/s   10:39  
$


6.      B机解Tar包

$ cd /u01/app/oracle/product/11.2.0
$ tar xvf Oracle.tar


7.      B机删除Oracle Net配置文件

$ rm -f $ORACLE_HOME/network/admin/*.ora


8.      B机oracle用户执行脚本


$ cd $ORACLE_HOME/clone/bin
$ $ORACLE_HOME/perl/bin/perl clone.pl ORACLE_BASE="/u01/app/oracle" ORACLE_HOME="/u01/app/oracle/product/11.2.0/dbhome_1" OSDBA_GROUP=dba -defaultHomeName
********************************************************************************

Your platform requires the root user to perform certain pre-clone
OS preparation.  The root user should run the shell script 'rootpre.sh' before
you proceed with cloning.  rootpre.sh can be found at
/u01/app/oracle/product/11.2.0/dbhome_1/clone directory.
Answer 'y' if the root user has run 'rootpre.sh' script.

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

Has 'rootpre.sh' been run by the root user? [y/n] (n)
y
./runInstaller -clone -waitForCompletion  "ORACLE_BASE=/u01/app/oracle" "ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1" "oracle_install_OSDBA=dba" -defaultHomeName  -defaultHomeName -silent -noConfig -nowait
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 7936 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-06-23_11-25-29AM. Please wait ...Oracle Universal Installer, Version 11.2.0.3.0 Production
Copyright (C) 1999, 2011, Oracle. All rights reserved.

You can find the log of this install session at:
/u01/app/oraInventory/logs/cloneActions2013-06-23_11-25-29AM.log
.................................................................................................... 100% Done.



Installation in progress (Sunday, June 23, 2013 11:26:06 AM CDT)
...............................................................................                                                 79% Done.
Install successful

Linking in progress (Sunday, June 23, 2013 11:26:36 AM CDT)
Link successful

Setup in progress (Sunday, June 23, 2013 11:29:50 AM CDT)
Setup successful

End of install phases.(Sunday, June 23, 2013 11:30:25 AM CDT)
WARNING:A new inventory has been created in this session. However, it has not yet been registered as the central inventory of this system.
To register the new inventory please run the script '/u01/app/oraInventory/orainstRoot.sh' with root privileges.
If you do not register the inventory, you may not be able to update or patch the products you installed.
The following configuration scripts need to be executed as the "root" user.
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/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 OraHome1 was successful.
Please check '/u01/app/oraInventory/logs/cloneActions2013-06-23_11-25-29AM.log' for more details.
$


9.      B机root用户执行脚本

# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
#
/u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Check /u01/app/oracle/product/11.2.0/dbhome_1/install/root_hacmp2_2013-06-23_11-40-53.log for the output of root script
#


#    至此B机的Oracle软件就安装好了.