How To Clone A Database Home From One Server To Other(same SID,directory,path)
2012-03-12 15:29
513 查看
Check the oracle home to clone
[oracle@lnx1 dbhome_1]$ opatch lsinv
Invoking OPatch 11.2.0.1.3
Oracle Interim Patch Installer version 11.2.0.1.3
Copyright (c) 2010, Oracle Corporation. All rights reserved.
Oracle Home : /oracle/app/product/11.2.0/dbhome_1
Central Inventory : /home/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.3
OUI version : 11.2.0.1.0
OUI location : /oracle/app/product/11.2.0/dbhome_1/oui
Log file location : /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2010-11-05_08-52-30AM.log
Patch history file: /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2010
11-05_08-52-30AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.1.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch 9952216 : applied on Fri Nov 05 07:13:34 PDT 2010
Unique Patch ID: 12825033
Created on 13 Sep 2010, 04:55:09 hrs PST8PDT
…………………………………
--------------------------------------------------------------------------------
OPatch succeeded.
Check the oracle home size
[oracle@lnx1 ~]$ cd /oracle/app/product/11.2.0/dbhome_1
[oracle@lnx1 dbhome_1]$
[oracle@lnx1 dbhome_1]$ du -h . | tail -1
4.5G .
Create the directory tree on the remote server and change ownership to oracle
[oracle@lnx2 ~]$ su -
Password:
[root@lnx2 ~]# mkdir -p /oracle/app/product/11.2.0/dbhome_1
[root@lnx2 ~]# chown -R oracle:dba /oracle
On source execute tar command to copy over the network the oracle_home directories to the target server
[oracle@lnx1 ~]$ cd /oracle/app/product/11.2.0/dbhome_1
[oracle@lnx1 dbhome_1]$ tar cvf - . | ( ssh lnx2 "cd /oracle/app/product/11.2.0/dbhome_1 ; tar xvf -" )
Once the tar finishes to copy on the target oracle home check the total size
[oracle@lnx2 ~]$ cd /oracle/app/product/11.2.0/dbhome_1
[oracle@lnx2 dbhome_1]$ du -h . | tail -1
4.5G .
Using the OUI to finish the cloning process
First I need to detach the inventory because the server was itself a clone of the source
[oracle@lnx2 ~]$ cd /oracle/app/product/11.2.0/dbhome_1/oui/bin
[oracle@lnx2 bin]$ ./runInstaller -detachHome
ORACLE_HOME="/oracle/app/product/11.2.0/dbhome_1"
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 1992 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /home/oracle/oraInventory
'DetachHome' was successful.
Once the inventory was detached from the old server version I can run the
cloning procedure:
[oracle@lnx2 bin]$ ./runInstaller -clone -silent -ignorePreReq
ORACLE_HOME="/oracle/app/product/11.2.0/dbhome_1" ORACLE_HOME_NAME="dbhome_11gR2"
ORACLE_BASE="/oracle/app" OSDBA_GROUP=dba OSOPER_GROUP=dba
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 1992 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-11-05_11-28-15AM. Please
wait ...[oracle@lnx2 bin]$ Oracle Universal Installer, Version 11.2.0.1.0 Production
Copyright (C) 1999, 2009, Oracle. All rights reserved.
You can find the log of this install session at:
/home/oracle/oraInventory/logs/cloneActions2010-11-05_11-28-15AM.log
.................................................................................................... 100% Done.
Installation in progress (Friday, November 5, 2010 11:28:48 AM PDT)
.............................................................................. 78% Done.
Install successful
Linking in progress (Friday, November 5, 2010 11:29:21 AM PDT)
Link successful
Setup in progress (Friday, November 5, 2010 11:31:59 AM PDT)
Setup successful
End of install phases.(Friday, November 5, 2010 11:35:50 AM PDT)
Starting to execute configuration assistants
Configuration assistant "Oracle Configuration Manager Clone" succeeded
WARNING:
The following configuration scripts need to be executed as the "root" user.
/oracle/app/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 dbhome_11gR2 was successful.
Please check '/home/oracle/oraInventory/logs/cloneActions2010-11-05_11-28-15AM.log' for more details.
The last step is to execute as root the root.sh script:
[root@lnx2 ~]# /oracle/app/product/11.2.0/dbhome_1/root.sh
Check /oracle/app/product/11.2.0/dbhome_1/install/root_lnx2_2010-11-05_11-39-06.log for the output of root script
[oracle@lnx2 ~]$ opatch lsinv
Invoking OPatch 11.2.0.1.3
Oracle Interim Patch Installer version 11.2.0.1.3
Copyright (c) 2010, Oracle Corporation. All rights reserved.
Oracle Home : /oracle/app/product/11.2.0/dbhome_1
Central Inventory : /home/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.3
OUI version : 11.2.0.1.0
OUI location : /oracle/app/product/11.2.0/dbhome_1/oui
Log file location : /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2010-11-05_11-46-19AM.log
Patch history file: /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2010-
11-05_11-46-19AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.1.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch 9952216 : applied on Fri Nov 05 07:13:34 PDT 2010
Unique Patch ID: 12825033
Created on 13 Sep 2010, 04:55:09 hrs PST8PDT
Bugs fixed:
9068088, 9363384, 8865718, 8898852, 8801119, 9054253, 8725286, 8974548
9093300, 8909984, 8755082, 8780372, 9952216, 8664189, 8769569, 7519406
9471411, 9302343, 8822531, 7705591, 8650719, 9637033, 8883722, 8639114
8723477, 8729793, 8919682, 8856478, 9001453, 8733749, 8565708, 8735201
…………………..
--------------------------------------------------------------------------------
OPatch succeeded.
Post Clone Checkups
It may be needed to update $ORACLE_HOME/dbs, $ORACLE_HOME/network/admin files to make them match
the new server.
References:
Master Note For Cloning Oracle Database Server ORACLE_HOME's Using the Oracle Universal Installer (OUI)
(Doc ID 1154613.1)
Cloning An Existing Oracle11g Release 2 (11.2.0.x) RDBMS Installation Using OUI (Doc ID 1221705.1)
FAQs on RDBMS Oracle Home Cloning Using OUI (Doc ID 565009.1)
[oracle@lnx1 dbhome_1]$ opatch lsinv
Invoking OPatch 11.2.0.1.3
Oracle Interim Patch Installer version 11.2.0.1.3
Copyright (c) 2010, Oracle Corporation. All rights reserved.
Oracle Home : /oracle/app/product/11.2.0/dbhome_1
Central Inventory : /home/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.3
OUI version : 11.2.0.1.0
OUI location : /oracle/app/product/11.2.0/dbhome_1/oui
Log file location : /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2010-11-05_08-52-30AM.log
Patch history file: /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2010
11-05_08-52-30AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.1.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch 9952216 : applied on Fri Nov 05 07:13:34 PDT 2010
Unique Patch ID: 12825033
Created on 13 Sep 2010, 04:55:09 hrs PST8PDT
…………………………………
--------------------------------------------------------------------------------
OPatch succeeded.
Check the oracle home size
[oracle@lnx1 ~]$ cd /oracle/app/product/11.2.0/dbhome_1
[oracle@lnx1 dbhome_1]$
[oracle@lnx1 dbhome_1]$ du -h . | tail -1
4.5G .
Create the directory tree on the remote server and change ownership to oracle
[oracle@lnx2 ~]$ su -
Password:
[root@lnx2 ~]# mkdir -p /oracle/app/product/11.2.0/dbhome_1
[root@lnx2 ~]# chown -R oracle:dba /oracle
On source execute tar command to copy over the network the oracle_home directories to the target server
[oracle@lnx1 ~]$ cd /oracle/app/product/11.2.0/dbhome_1
[oracle@lnx1 dbhome_1]$ tar cvf - . | ( ssh lnx2 "cd /oracle/app/product/11.2.0/dbhome_1 ; tar xvf -" )
Once the tar finishes to copy on the target oracle home check the total size
[oracle@lnx2 ~]$ cd /oracle/app/product/11.2.0/dbhome_1
[oracle@lnx2 dbhome_1]$ du -h . | tail -1
4.5G .
Using the OUI to finish the cloning process
First I need to detach the inventory because the server was itself a clone of the source
[oracle@lnx2 ~]$ cd /oracle/app/product/11.2.0/dbhome_1/oui/bin
[oracle@lnx2 bin]$ ./runInstaller -detachHome
ORACLE_HOME="/oracle/app/product/11.2.0/dbhome_1"
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 1992 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /home/oracle/oraInventory
'DetachHome' was successful.
Once the inventory was detached from the old server version I can run the
cloning procedure:
[oracle@lnx2 bin]$ ./runInstaller -clone -silent -ignorePreReq
ORACLE_HOME="/oracle/app/product/11.2.0/dbhome_1" ORACLE_HOME_NAME="dbhome_11gR2"
ORACLE_BASE="/oracle/app" OSDBA_GROUP=dba OSOPER_GROUP=dba
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 1992 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-11-05_11-28-15AM. Please
wait ...[oracle@lnx2 bin]$ Oracle Universal Installer, Version 11.2.0.1.0 Production
Copyright (C) 1999, 2009, Oracle. All rights reserved.
You can find the log of this install session at:
/home/oracle/oraInventory/logs/cloneActions2010-11-05_11-28-15AM.log
.................................................................................................... 100% Done.
Installation in progress (Friday, November 5, 2010 11:28:48 AM PDT)
.............................................................................. 78% Done.
Install successful
Linking in progress (Friday, November 5, 2010 11:29:21 AM PDT)
Link successful
Setup in progress (Friday, November 5, 2010 11:31:59 AM PDT)
Setup successful
End of install phases.(Friday, November 5, 2010 11:35:50 AM PDT)
Starting to execute configuration assistants
Configuration assistant "Oracle Configuration Manager Clone" succeeded
WARNING:
The following configuration scripts need to be executed as the "root" user.
/oracle/app/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 dbhome_11gR2 was successful.
Please check '/home/oracle/oraInventory/logs/cloneActions2010-11-05_11-28-15AM.log' for more details.
The last step is to execute as root the root.sh script:
[root@lnx2 ~]# /oracle/app/product/11.2.0/dbhome_1/root.sh
Check /oracle/app/product/11.2.0/dbhome_1/install/root_lnx2_2010-11-05_11-39-06.log for the output of root script
[oracle@lnx2 ~]$ opatch lsinv
Invoking OPatch 11.2.0.1.3
Oracle Interim Patch Installer version 11.2.0.1.3
Copyright (c) 2010, Oracle Corporation. All rights reserved.
Oracle Home : /oracle/app/product/11.2.0/dbhome_1
Central Inventory : /home/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.3
OUI version : 11.2.0.1.0
OUI location : /oracle/app/product/11.2.0/dbhome_1/oui
Log file location : /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2010-11-05_11-46-19AM.log
Patch history file: /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2010-
11-05_11-46-19AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.1.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch 9952216 : applied on Fri Nov 05 07:13:34 PDT 2010
Unique Patch ID: 12825033
Created on 13 Sep 2010, 04:55:09 hrs PST8PDT
Bugs fixed:
9068088, 9363384, 8865718, 8898852, 8801119, 9054253, 8725286, 8974548
9093300, 8909984, 8755082, 8780372, 9952216, 8664189, 8769569, 7519406
9471411, 9302343, 8822531, 7705591, 8650719, 9637033, 8883722, 8639114
8723477, 8729793, 8919682, 8856478, 9001453, 8733749, 8565708, 8735201
…………………..
--------------------------------------------------------------------------------
OPatch succeeded.
Post Clone Checkups
It may be needed to update $ORACLE_HOME/dbs, $ORACLE_HOME/network/admin files to make them match
the new server.
References:
Master Note For Cloning Oracle Database Server ORACLE_HOME's Using the Oracle Universal Installer (OUI)
(Doc ID 1154613.1)
Cloning An Existing Oracle11g Release 2 (11.2.0.x) RDBMS Installation Using OUI (Doc ID 1221705.1)
FAQs on RDBMS Oracle Home Cloning Using OUI (Doc ID 565009.1)
相关文章推荐
- How to move RAC Database ORACLE_HOME from one location to another one (Doc ID 1438719.1)
- How to move ASM database files from one diskgroup to another
- How to transform a pdf file from database@server side to client ?
- How to Downgrade a Database from SQL Server 2005 to SQL Server 2000
- Copy a table from one database to another in SQL Server 2005
- How to Export and Import the AWR Repository From One Database to Another (文档 ID 785730.1)
- How to move ASM database files from one diskgroup to another
- Computing the Relative Path from One Directory to Another(Python cookbook 2-22)
- How do i prevent end users from connecting to the database other than my application?", version 8.1.5
- 在服务器上远程链接另一台服务器的数据库的方法how to connet the database from the other host
- How to delete one database in DB2
- how to get the space size of some tables in one database?
- How to convert an input image from one color space to another space
- How to use virtual path providers to dynamically load and compile content from virtual paths in
- How to move databases between computers that are running SQL Server
- Microsoft SQL Server 2008 R2 XML处理 One solution is to increase the number of characters retrieved from the server for XML data.
- How Do I Enable Remote Access To MySQL Database Server?
- How to move the databases that are used by SharePoint Portal Server 2003 to a computer that is running SQL Server
- How to change the SQL Server 2008 default install path
- Transfer Statistics from one Database to Another