温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

EBS在线克隆DB和应用的实例分析

发布时间:2021-11-30 11:17:13 来源:亿速云 阅读:155 作者:柒染 栏目:关系型数据库

这篇文章将为大家详细讲解有关EBS在线克隆DB和应用的实例分析,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。

本次克隆学习到的有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和应用的实例分析就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI