Oracle11gR2--克隆安装数据库软件

1. 删除oracle之前的产品信息

环境是前篇中通过静默方式安装的,这里只删除产品信息,假设ORACLE_HOME目录是从其他地方拷贝过来的

[oracle@localhost ContentsXML]$ pwd
/home/oracle/oraInventory/ContentsXML
[oracle@localhost ContentsXML]$ cat inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2013, Oracle and/or its affiliates.
All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>11.2.0.4.0</SAVED_WITH>
   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="OraDb11g_home1" LOC="/home/oracle/app/oracle/product/11.2.0/dbhome_1" TYPE="O" IDX="1"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>

#删除LIST里的内容
[oracle@localhost ContentsXML]$ cat inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2013, Oracle and/or its affiliates.
All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>11.2.0.4.0</SAVED_WITH>
   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>

2. 执行克隆安装命令

[oracle@localhost bin]$ pwd
/home/oracle/app/oracle/product/11.2.0/dbhome_1/clone/bin
[oracle@localhost bin]$ perl clone.pl ORACLE_BASE=$ORACLE_BASE ORACLE_HOME=$ORACLE_HOME  ORACLE_HOME_NAME=OraDb11g_home1 
./runInstaller -clone -waitForCompletion  "ORACLE_BASE=/home/oracle/app" "ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1" "ORACLE_HOME_NAME=OraDb11g_home1" -silent -noConfig -nowait 
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 3990 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-01-31_05-17-41PM. 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:
 /home/oracle/oraInventory/logs/cloneActions2018-01-31_05-17-41PM.log
.................................................................................................... 100% Done.



Installation in progress (Wednesday, January 31, 2018 5:18:39 PM CST)
..............................................................................                                                  78% Done.
Install successful

Linking in progress (Wednesday, January 31, 2018 5:18:46 PM CST)
Link successful

Setup in progress (Wednesday, January 31, 2018 5:19:52 PM CST)
Setup successful

End of install phases.(Wednesday, January 31, 2018 5:20:22 PM CST)
WARNING:
The following configuration scripts need to be executed as the "root" user.
/home/oracle/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 OraDb11g_home1 was successful.
Please check '/home/oracle/oraInventory/logs/cloneActions2018-01-31_05-17-41PM.log' for more details.

#root执行
[oracle@localhost bin]$ exit
logout
[root@localhost ~]# /home/oracle/app/oracle/product/11.2.0/dbhome_1/root.sh
Check /home/oracle/app/oracle/product/11.2.0/dbhome_1/install/root_localhost.localdomain_2018-01-31_17-21-55.log for the output of root script

3.总结

可以看到通过克隆的方式时间会快很多,因为文件已经实现copy,只剩下link的工作

posted @ 2018-01-31 17:30  chinesern  阅读(2033)  评论(0编辑  收藏  举报