共計 9604 個字符,預計需要花費 25 分鐘才能閱讀完成。
這篇文章將為大家詳細講解有關 EBS 在線克隆 DB 和應用的實例分析,文章內容質量較高,因此丸趣 TV 小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關知識有一定的了解。
本次克隆學習到的有 1 點
只要 A 數據庫可以正常啟動,保證 A 數據庫文件(redo、undo、datafile、archivelog、tempfile)和控制文件不在 ORACLE_HOME 目錄情況下,
備份好 A 數據庫的 pfile,可以隨便刪除 A 的 ORACLE_HOME 并從別的地方拷貝 ORACLE_HOME 過來進行軟件克隆操作,軟件克隆過程中會產生新的 pfile,把原來的 pfile 拿過來覆蓋就可以了
本次克隆從 21.16 克隆到 128.118,克隆為測試環境,所以 DB duplicate 后測試環境關閉了歸檔
21.16 服務器信息
96CPU、256G、CentOS release 6.5 (Final)、hostname 是 ebsdba、base 是 /db/PROD,SID 是 PROD、數據文件路徑 /db/prod/db/apps_st/data、oracle 用戶 oraprod,應用用戶是 applprod
128.118 服務器信息
48CPU、64G、Red Hat Enterprise Linux Server release 5.4 (Tikanga)、hostname 是 ebsdev、base 是 /db/DEV,SID 是 DEV、數據文件路徑 /db/DEV/db/apps_st/data、oracle 用戶 oradev、應用用戶是 appldev、ORACLE_HOME 是 /u01/DEV/db/tech_st/11.2.0/
一:ORACLE 軟件克隆(此過程會生成新的 pfile 文件,一般克隆時不需這一步,除非如下兩種情況)
1、新搭建的 OS 環境,沒有安裝 ORACLE 軟件;
2、DB 軟件已經安裝好了,并且 DB 已經 duplicate 好了,但是需要再次克隆軟件,比如 DB 的數據文件目錄和軟件環境變量 DATA_TOP 不一樣,比如 duplicate 過程中發現目標數據庫的 /u02 目錄空間不夠,新增了一個目錄 /u03,但是目標數據庫的 DATA_TOP 還是 duplicate 之前的一個目錄 /u02, 此時 DB 的 pfile 要先備份一遍, 因為軟件克隆的過程中會生成新的 pfile 文件
1.
128.118 服務器建立 /db/DEV/db/tech_st、/db/DEV/apps、/db/DEV/inst 并分別授權為 oradev.dba、appldev.dba、appldev.dba
2.
21.16 對 ORACLE_HOME 打包
cd /db/prod/db/tech_st
tar -zcvf primy.tar.gz 11.2.0
并把該包拷貝到 128.118 的 /db/DEV/db/tech_st
3.
128.118 使用 oradev 登錄
cd /db/DEV/db/tech_st
tar -zxvf primy.tar.gz
cd /db/DEV/db/tech_st/11.2.0/appsutil/clone/bin
PERL5LIB=/u01/DEV/db/tech_st/11.2.0/perl/lib/5.10.0:/u01/DEV/db/tech_st/11.2.0/perl/lib/site_perl/5.10.0:/db/DEV/db/tech_st/11.2.0/appsutil/perl
PATH=/u01/DEV/db/tech_st/11.2.0/perl/bin:$PATH
–PERL5LIB,不是代表 linux5,所以遇到克隆的目標環境的 OS 版本為 linux6 時,不能設置為 PERL6LIB,如果 /u01/DEV/db/tech_st/11.2.0/perl/lib/5.10.0 目錄不存在,而只存在 /u01/DEV/db/tech_st/11.2.0/perl/lib/5.8.3,則先設置為 /u01/DEV/db/tech_st/11.2.0/perl/lib/5.10.0,沒有報錯不管,遇到報錯再設置為 /u01/DEV/db/tech_st/11.2.0/perl/lib/5.8.3
perl adcfgclone.pl dbTechStack(此過程會新建 pfile)
Enter the APPS password :
Target System Hostname (virtual or normal) [ebsdev] :
Target Instance is RAC (y/n) [n] :
Target System Database SID : DEV
Target System Base Directory : /u01/DEV
Target System utl_file_dir Directory List : /usr/tmp
Number of DATA_TOP s on the Target System [2] : 1
Target System DATA_TOP Directory 1 : /u01/DEV/db/apps_st/data
Target System RDBMS ORACLE_HOME Directory [/u01/DEV/db/db/tech_st/11.1.0] : /u01/DEV/db/tech_st/11.2.0
Do you want to preserve the Display [0.0] (y/n) : n
Target System Display [ebsdev:0.0] :
Do you want the the target system to have the same port values as the source system (y/n) [y] ? : n
Target System Port Pool [0-99] : 30
– 以上,如果數據文件存在兩個目錄,u01 和 u02,則
Number of DATA_TOP s on the Target System [2] : 2
Target System DATA_TOP Directory 2 : /u01/DEV/db/apps_st/data,/u02/DEV/db/apps_st/data
4.
再重新使用原來的數據庫 pfile 備份覆蓋新生成的數據庫 pfile
5.oradev 的~/.bash_profle 增加
. /u01/DEV/db/tech_st/11.2.0/DEV_ebsdev.env
二:數據庫 duplicate(查看克隆環境 DB 的補丁是否和正式環境 DB 的補丁一樣,不一樣,先打好補丁再進行克隆)(21.16 在 27 號重新生成了一個生命周期 5,25 號有個 0 級備份,28 號重新 1 級備份了)
1.
nohup rman target sys/XX@prod auxiliary sys/XX@8030_DEV_DUPlICATE cmdfile=duplica_8030_dev_from_backup.rman msglog=duplica_8030_dev_from_backup.log
duplicate 的內容如下(使用了生命周期 4)
run {
duplicate database PROD incarnation 4 to DEV
pfile=/ebsbak/rmanbackup/duplicate/initDEV.ora
db_file_name_convert=(/db/prod/db/apps_st/ , /u01/DEV/db/apps_st/)
LOGFILE
/u01/DEV/db/apps_st/data/log01.dbf size 1024M,
/u01/DEV/db/apps_st/data/log02.dbf size 1024M,
/u01/DEV/db/apps_st/data/log03.dbf size 1024M
NOFILENAMECHECK UNTIL TIME TO_DATE(2016-11-29 10:00:00 , YYYY-MM-DD hh34:mi:ss)
}
2. 重建 tempfile
alter tablespace temp1 drop tempfile /u01/DEV/db/apps_st/data/temp01.dbf
alter tablespace temp1 drop tempfile /u01/DEV/db/apps_st/data/temp03.dbf
alter tablespace temp1 add tempfile /u01/DEV/db/apps_st/data/temp01.dbf
alter database tempfile /u01/DEV/db/apps_st/data/temp01.dbf autoextend on next 64m maxsize 8g;
alter tablespace temp1 add tempfile /u01/DEV/db/apps_st/data/temp03.dbf
alter database tempfile /u01/DEV/db/apps_st/data/temp03.dbf autoextend on next 64m maxsize 8g;
alter tablespace temp1 drop tempfile /u01/DEV/db/apps_st/data/temp05.dbf
alter tablespace temp1 add tempfile /u01/DEV/db/apps_st/data/temp05.dbf
alter database tempfile /u01/DEV/db/apps_st/data/temp05.dbf autoextend on next 64m maxsize 8g;
alter tablespace temp2 drop tempfile /u01/DEV/db/apps_st/data/temp02.dbf
alter tablespace temp2 drop tempfile /u01/DEV/db/apps_st/data/temp04.dbf
alter tablespace temp2 add tempfile /u01/DEV/db/apps_st/data/temp02.dbf
alter database tempfile /u01/DEV/db/apps_st/data/temp02.dbf autoextend on next 64m maxsize 8g;
alter tablespace temp2 add tempfile /u01/DEV/db/apps_st/data/temp04.dbf
alter database tempfile /u01/DEV/db/apps_st/data/temp04.dbf autoextend on next 64m maxsize 8g;
alter tablespace temp2 drop tempfile /u01/DEV/db/apps_st/data/temp06.dbf
alter tablespace temp2 add tempfile /u01/DEV/db/apps_st/data/temp06.dbf
alter database tempfile /u01/DEV/db/apps_st/data/temp06.dbf autoextend on next 64m maxsize 8g;
3. 關閉歸檔
三:數據庫克隆配置(此過程會修改數據庫 pfile 文件,所以要用備份 pfile 覆蓋新生成的 pfile)
1.
cd $ORACLE_HOME/appsutil/install/DEV_ebsdev
sqlplus / as sysdba @adupdlib.sql so
2.
cd $ORACLE_HOME/appsutil/clone/bin
mv /u01/DEV/db/tech_st/11.2.0/bin/unzip /u01/DEV/db/tech_st/11.2.0/bin/unzip_6.00
scp orapft@192.168.3.1:/u03/PFT/db/tech_st/11.2.0/bin/unzip $ORACLE_HOME/bin/
which unzip 必須是來自 $ORACLE_HOME/bin/unzip
which perl 必須是來自 $ORACLE_HOME/perl/bin/perl
–Unzip 必須 5.52(or higher),但是不能高于 6.0
perl adcfgclone.pl dbconfig $ORACLE_HOME/appsutil/DEV_ebsdev.xml(此過程必須使用到 $ORACLE_HOME/bin/unzip, 不會使用 /usr/bin/unzip)
Enter the APPS password :
3. 重新使用原來的數據庫 pfile 備份覆蓋新生成的數據庫 pfile
四:應用克隆 (使用應用用戶 appldev)
1.
21.16 對應用目錄 /app/prod/apps、 /app/prod/inst 打包
cd /app/prod
tar -zcvf prod_erp_20161126.tar.gz apps inst
并把該包拷貝到 128.118 的 /u01/DEV
128.118 解壓應用包
cd /db/DEV
tar -zxvf prod_erp_20161126.tar.gz
2.(最后一步不用啟動應用)
cd /u01/DEV/apps/apps_st/comn/clone/bin
perl adcfgclone.pl appsTier(不需要使用自己的 /u01/NPS/apps/tech_st/10.1.3/perl/bin/perl,自己找到 /usr/bin/perl)
Enter the APPS password :
Target System Hostname (virtual or normal) [ebsdev] :
Target System Database SID : DEV
Target System Database Server Node [ebsdev] :
Target System Database Domain Name [huaqin.com] :
Target System Base Directory : /u01/DEV
Target System Tools ORACLE_HOME Directory [/u01/DEV/apps/tech_st/10.1.2] :
Target System Web ORACLE_HOME Directory [/u01/DEV/apps/tech_st/10.1.3] :
Target System APPL_TOP Directory [/u01/DEV/apps/apps_st/appl] :
Target System COMMON_TOP Directory [/u01/DEV/apps/apps_st/comn] :
Target System Instance Home Directory [/u01/DEV/inst] :
Target System Root Service [enabled] :
Target System Web Entry Point Services [enabled] :
Target System Web Application Services [enabled] :
Target System Batch Processing Services [enabled] :
Target System Other Services [disabled] :
Do you want to preserve the Display [proderp:0.0] (y/n) : n
Target System Display [ebsdev:0.0] :
Do you want the the target system to have the same port values as the source system (y/n) [y] ? : n
Target System Port Pool [0-99] : 30
Checking the port pool 30
done: Port Pool 30 is free
Report file located at /u01/DEV/inst/apps/DEV_ebsdev/admin/out/portpool.lst
Complete port information available at /u01/DEV/inst/apps/DEV_ebsdev/admin/out/portpool.lst
UTL_FILE_DIR on database tier consists of the following directories.
1. /usr/tmp
2. /u01/DEV/db/tech_st/11.2.0/appsutil/outbound/DEV_ebsdev
Choose a value which will be set as APPLPTMP value on the target node [1] : 1
…
Completed Apply…
Mon Feb 26 16:59:27 2018
Do you want to startup the Application Services for NAS? (y/n) [y] : n
Services not started
3.appldev 的~/.bash_profle 增加
. /u01/DEV/apps/apps_st/appl/APPSDEV_ebsdev.env
五:收尾工作 (應用沒有啟動的情況下)
1.
數據庫修改信息(修改 system 的密碼)
su – oradev
sqlplus / as sysdba
alter user system identified by kkk;
2.
應用修改信息
su – appldev
source ~/.bash_profile
vi $AF_JRE_TOP/lib/xdo.cfg 修改 path 路徑
vi $FORMS_WEB_CONFIG_FILE 增加 archive2=,/OA_JAVA/hand.jar.sig
3. 修改目標測試環境的所有 ERP 相關的數據庫用戶密碼為 yyy,包括 apps 用戶的密碼也從原來的 xxx 修改為 yyy
FNDCPASS apps/xxx 0 Y system/kkk SYSTEM APPLSYS yyy
FNDCPASS apps/yyy 0 Y system/kkk ALLORACLE yyy
4.
sqlplus apps/apps
update FND_FORM_FUNCTIONS_TL set user_function_name= 8030 ERP 測試 where function_id=20569;
commit;
UPDATE fnd_concurrent_requests SET phase_code = C , status_code = X WHERE phase_code = P
COMMIT;
5.
cd ~
sqlplus apps/apps
@cmclean.sql – 這個動作絕對不能在正式環境操作
6.
– 如果開啟了 asadmin 功能的話, 配置 asadmin 的密碼 xxx
vi $INST_TOP/ora/10.1.3/j2ee/oafm/config/system-jazn-data.xml 修改 ASADMIN 對應的 credentials 值為!XXX
7.
如果源端和目標端的 OS 版本不一樣的話,需要做如下兩句
After installation, users must update the stub libraries in the 10.1.2 and 10.1.3 Oracle Homes using the patch 12415211. In following the instructions below, please note that Opatch should not be used to install this patch.
Users must specifically copy the files in the patch to the specified directories as follows for the 10.1.2 Oracle Home:
$ cd 12.1_INSTALL_DIR /apps/tech_st/10.1.2/lib
$ cp -p -R stubs stubsORIG
$ cd stubs
$ cp /12415211/files/lib/stubs/libgcc_s-2.3.2-stub.so .
$ ln -s libgcc_s-2.3.2-stub.so libgcc_s.so.1
$ ln -s libgcc_s.so.1 libgcc_s.so
After this is done and sourcing the APPS.env file, users should relink all 10.1.2 executables by running the $ORACLE_HOME/appsutil/clone/adlnktools.sh script and ensuring that there are now no errors in the make log file output from the script.
The instructions for the 10.1.3 Oracle Home are:
$ cd 12.1_INSTALL_DIR /apps/tech_st/10.1.3/lib
$ cp -p -R stubs stubsORIG
$ cd stubs
$ cp /12415211/files/lib/stubs/libgcc_s-2.3.2-stub.so .
$ ln -s libgcc_s-2.3.2-stub.so libgcc_s.so.1
$ ln -s libgcc_s.so.1 libgcc_s.so
After this, users should relink sqlplus by running the /apps/tech_st/10.1.3/appsutil/clone/adlnkweboh.sh script and ensuring that there are now no errors in the make log file output from the script.
8. 啟動 ERP
su – appldev
cd $ADMIN_SCRIPTS_HOME
./adstrtal.sh apps/apps
9.
配置 ASADMIN 集成 SOA 網關的
find $APPL_TOP -name soagenerate.sh
/u01/DEV/apps/apps_st/appl/fnd/12.0.0/bin/soagenerate.sh
cd /u01/DEV/apps/apps_st/appl/fnd/12.0.0/bin
soagenerate.sh irepname=CUX_FND_MSG_CALL_CENTER_PKG
登錄 ERP 的 WEB 頁面,看上面第 6 步的配置是否正常
asadmin/XXX
集成 SOA 網關 - 集成信息庫 -CUX Developer-CUX Developer-CUX Developer-SOAP Web 服務 - 查看 WSDL- 點擊出現頁面就可以了
10.
進入窗口修改如下信息
ERP– 配置文件 – 系統 – 配置文件框中輸入 % 地點名 %– 點擊查找 – 把地點修改為 XX 測試環境(8030) 2016-11-18
ERP– 配置文件 – 系統 – 配置文件框中輸入 %Java 色彩設計 %– 點擊查找 – 把地點選擇為紫色
備注
如果是現有應用要改服務器名,改域名,改 db_name,改端口,執行步驟如下
1、數據庫軟件克隆
2、數據庫重建控制文件修改 db_name,把數據庫拉起來,增加 tempfile
3、數據庫克隆
4、應用克隆
如果是 duplicate 到目標服務器,目標服務器要改服務器名,改域名,改 db_name,改端口,執行步驟如下
1、duplicate 目標服務器后,再目前服務器拉起數據庫
2、數據庫軟件克隆
3、數據庫重建控制文件修改 db_name,把數據庫拉起來,增加 tempfile
4、數據庫克隆
5、應用克隆
關于 EBS 在線克隆 DB 和應用的實例分析就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。