現有環境已經有一台作為 production 的 Oracle DB,且該 DB 已有最後的 Patchset,此篇教學應用為:
從一台已安裝有最新 patchset 且很穩定的 DB 裡,在不用停機狀態下,直接將 $ORACLE_HOME 目錄,以 tar 方式複製
echo $ORACLE_HOME /opt/oracle/product/10.2.0/db_1 cd /opt/oracle/product/ tar czf Oracle_Home_102054_Clone.tar 10.2.0/
以下步驟要在另一部準備安裝 DB 的 Linux 機器上執行,並將 OracleHome 複製檔 Oracle_Home_102054_Clone.tar 上傳至機器上。
環境變數為
ORACLE_BASE=/opt/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/10.2.0.5.4/db_1; export ORACLE_HOME ORACLE_SID=win; export ORACLE_SID
安裝步驟
用 root 執行
mkdir -p /opt/oracle/product/10.2.0.5.4/db_1 chown -R oracle:dba /opt/oracle
用 oracle 執行
su - oracle cd /opt/oracle/product mkdir clone_oracle/ cd clone_oracle/ tar xf /mnt/nas_na/alang/Oracle_Home_102054_Clone.tar mv 10.2.0/* ../10.2.0.5.4/db_1/ cd $ORACLE_HOME/network/admin/ rm *.ora cd $ORACLE_HOME/dbs rm -rf * cd $ORACLE_HOME/oui/bin/ ./runInstaller -silent -clone ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=ora_102054
Setup in progress (Thursday, March 20, 2014 5:28:40 PM CST) Setup successful End of install phases.(Thursday, March 20, 2014 5:28:44 PM CST) WARNING: The following configuration scripts need to be executed as the "root" user. #!/bin/sh #Root script to run /opt/oracle2/product/10.2.0.5.4/db_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 ora_102054 was successful. Please check '/opt/oracle2/oraInventory/logs/cloneActions2014-03-20_05-27-04PM.log' for more details.
TIP:
如果出現 oraInventory 路徑錯誤,檢查檔案 /etc/oraInst.loc 內容
su - /opt/oracle2/product/10.2.0.5.4/db_1/root.sh