ORACLE E B S DATABASE CLONE steps
source system: prod
target system:test 1、Log on the source system as the ORACLE user. And run the following commands; Connect 10.0.31.227 User:root Passwd:root #su – oraprod $cd /db/prod/db/tech_st/10.2.0/appsutil/scripts/PROD_erpdb $perl adpreclone.pl dbTier #該步驟的日誌文件是/db/prod/db/tech_st/10.2.0/appsutil/log/PROD_erpdb/StageDBTier_12190904.log 2、copy the source system to the target system connect 10.0.31.221 shutdown the application normally #su – applprod $cd $ADMIN_SCRIPTS_HOME/ $adstpall.sh apps/apps $exit #su – appltest $cd $ADMIN_SCRIPTS_HOME/ $adstpall.sh apps/apps $exit connect 10.0.31.227 SHUTDOWN the databaseserver normally #su – oraprod $cd $ORACLE_HOME/appsutil/scripts/PROD_erpdb/ $ addlnctl.sh stop PROD $addbctl.sh stop $exit #su – oradev $cd $ORACLE_HOME/appsutil/scripts/PROD_erpdb/ $ addlnctl.sh stop PROD $addbctl.sh stop $exit # cp –rp /db/prod/db/tech_st/10.2.0/appsutil/clone / /db/test/db/tech_st/10.2.0/appsutil/ #chown –R oratest:dba /db/test/db/tech_st/10.2.0/appsutil/clone # cp –rp /db/prod/db/apps_st/data/* /db/test/db/apps_st/data/ # chown –R oratest:dba /db/test/db/apps_st/data/* start the source Application database system and application tier processes. 3、configure the target system connect 10.0.31.227 log on the target system as the ORACLE user and run the following commands. #su – oratest $cd /db/test/db/tech_st/10.2.0/appsutil/clone/bin $perl adcfgclone.pl dbTier 運行以上腳本時需要回答以下問題: #查看/etc/hosts文件,如果有虛擬主機就用虛擬主機,否則用實主機 Target hostname (virtual or normal) [erpsv2]:erpdb Target instance is a Real Application Cluster (RAC) instance (y/n) [n]:n Target System database name:DEV #ORACLE 基目錄名,因爲系統中沒有設置ORACLE_BASE環境變量,所以只有自己記住該變量了/db/SID Target system base directory for source homes:/db/dev #utl_file文件的存放目錄,可以隨便指向一個可用的目錄,一般在ORACLE基目錄下面增開一個臨時目錄 Target system utl_file accessible directories list:/db/dev/tmp #ORACLE數據文件存放的目錄數目,有幾個就輸入幾,我們公司的數據文件目錄只有一個 Number of DATA_TOP's on the target system [4]:1 #ORACLE數據文件存放的目標目錄 Target system DATA_TOP 1:/db/dev/db/apps_st/data #ORACLE_HOME環境變量的值,即ORACLE的主目錄 Target system RDBMS ORACLE_HOME directory:/db/dev/db/tech_st/10.2.0 #需要保存相關設置 Do you want to preserve the Display set to null (y/n) [y] ?:y Clone Context uses the same port pool mechanism as the Rapid Install. #目標數據庫的基準端口號,公司的產品環境是0,測試環境是1,開發環境是2 Enter the port pool to be used for the target system node [0-99]: 2 到此,腳本可以順利運行,只需要等待腳本運行完畢就好了。 #運行完上面的腳本後,應檢查數據是否可以讓普通用戶註冊,最好在PL/SQL DEVELOPER裏面用APPS帳號註冊一次,如果成功就行,如果失敗應該查找原因,比如監聽器沒有啓動等。 該腳本運行的日誌文件一般是/db/dev/db/tech_st/10.2.0/appsutil/log/DEV_erpdb/ApplyDBTier_12200032.log /db/dev/db/tech_st/10.2.0/appsutil/clone/bin/CloneContext_12200029.log /db/dev/db/tech_st/10.2.0/appsutil/log/DEV_erpdb/addlnctl.txt connect 10.0.31.221 #此時應用是關閉的,數據庫是啓動狀態 log on the target system as the APPLMGR user and run the following commands. #su – appltest #記住查看/app/test/apps/apps_st/appl/admin/adconfig.txt的所有者,一定要確保該文件的所有者是正在使用的帳號,如果不是應該更改成正在使用的帳號 $cd $ADMIN_SCRIPTS_HOME/ $adautocfg.sh [apps password]:apps Using Context file : /app/dev/inst/apps/DEV_erpapp/appl/admin/DEV_erpapp.xml 日誌文件是/app/dev/inst/apps/DEV_erpapp/admin/log/12200850/adconfig.log 一切都成功執行後,就可以啓動應用了。 Update Workflow configuration settings Cloning an Oracle Applications instance will not update the host and instance specific information used by Oracle Workflow. Review the following tables and columns to verify there is no instance specific data in the Workflow configuration on the target system. Update WF_NOTIFICATION_ATTRIBUTES Set TEXT_VALUE = replace(TEXT_VALUE,’ http://<old web host>’,’ http://<new web host>’) Where TEXT_VALUE like ‘% http://<old web host>%’ Table NameColumn NameColumn Value DetailsWF_NOTIFICATION_ATTRIBUTES TEXT_VALUE Value starts with http://<old web host> : Update to new web host WF_ITEM_ATTRIBUTE_VALUES TEXT_VALUE Value starts with "http://<old web host> : Update to new web host WF_SYSTEMS GUID Create a new system defined as the new global database name using the Workflow Administrator Web Applications responsibility. WF_SYSTEMS NAME Value needs to be replaced with the database global name WF_AGENTS ADDRESS Update database link with the new database global name. FND_FORM_FUNCTIONS WEB_HOST_NAME Update with the new web host name FND_FORM_FUNCTIONS WEB_AGENT_NAME Update to point at the new PLSQL listener name FND_CONCURRENT_REQUESTS LOGFILE_NAME Update with the correct path to the logfile directory FND_CONCURRENT_REQUESTS OUTFILE_NAME Update with the new directory path on the target system 修改完以上表的字段後,還要進入ERP的管理員職責下面的profile>system裏面修改“地點名稱”字段,把相關的SID修改成目標SID。如果虛擬節點沒有註冊成功,此時應到“系統管理員職責”:控制面板-》sitemap->hosts下面註冊該節點。畫面信息如下 |