EBS克隆

第一种rapid clone,停应用和数据库克隆

1.停应用

2.停数据库

3,预克隆

       3.1 perl adpreclone.pl dbTier

       3.2 perl adpreclone.pl appsTier

4,tar应用文件夹和数据库文件夹

5,把应用和数据库的tar包传输到目标服务器

6.克隆

       6.1perl adcfgclone.pl dbTier

       6.2perl adcfgclone.pl dbTier

7.更新标题

    sysadmin登陆-system administrator->profile->system->Site Name

8.更新打印机配置

9.更新工作流的配置信息

   

Table NameColumn NameColumn Value Details
WF_NOTIFICATION_ATTRIBUTESTEXT_VALUEValue starts with http://[old web host]: Update to new web host.
WF_ITEM_ATTRIBUTE_VALUESTEXT_VALUEValue starts with "http://[old web host]: Update to new web host.
WF_SYSTEMSGUIDUsing the Workflow Administrator Web Applications responsibility, create a new system defined as the new global database name.
WF_SYSTEMSNAMEReplace value with the database global name.
WF_AGENTSADDRESSUpdate database link with the new database global name.
FND_FORM_FUNCTIONSWEB_HOST_NAMEUpdate with the new web host name.
FND_FORM_FUNCTIONSWEB_AGENT_NAMEUpdate to point at the new PL/SQL listener name.
FND_CONCURRENT_REQUESTSLOGFILE_NAMEUpdate with the correct path to the logfile directory.
FND_CONCURRENT_REQUESTSOUTFILE_NAME

Update with the new directory path on the target system.

 

 

10.修改APPS和SYSADMIN密码

11.更新ICX_PARAMETERS表的SESSION_COOKIE_DOMAIN

      如果源环境和目标环境的domain不一样,这一步一定要做,不然打开登陆页面会显示白页.

12.启动应用

 

第二种rapid clone,RAC克隆到单实例

1.检查源数据库的归档模式和状态

SQL>archive log list

RMAN>crosscheck archivelog all;

RMAN>delete expired archivelog all;

2.执行DB的预克隆

$ cd $ORACLE_HOME/appsutil/scripts/[context_name]
$ perl adpreclone.pl dbTier

3.创建备份的镜像

perl adclone.pl java=/u01/test/db/tech_st/11.2.0/appsutil/clone/jre
mode=stage stage=/backup component=database method=RMAN
dbctx=/u01/test/db/tech_st/11.2.0/appsutil/TEST_t1erptest.xml
showProgress

(这一步主要收集克隆需要的信息,并生成RMAN备份)

4.打包RAC数据库软件目录

   $ cd $ORACLE_HOME/..
  $ tar -cvzf rac_db_oh.tgz 11.2.0

5.在目标服务器上解压数据库软件目录

   $ tar -xvzf rac_db_oh.tgz

6.创建pairsfile.txt文件

  s_undo_tablespace=UNDO1(源服务器RAC的一个实例的回退表空间的名称)

  s_dbClusterInst=2(RAC节点个数)

  s_db_oh=/u01/test/db/11.2.0(目标数据库的主目录)

7.根据源RAC的context_file创建新的context_file

perl adclonectx.pl contextfile=/u01/test/db/tech_st/11.2.0/appsutil/PROD2_p1ebsdb02.xml template=/u01/test/db/tech_st/11.2.0/appsutil/template/adxdbctx.tmp pairsfile=/u01/test/db/tech_st/11.2.0/appsutil/clone/pairsfile.txt initialnode

8.在目标服务器上恢复数据库文件

  perl adclone.pl java=/u01/test/db/tech_st/11.2.0/appsutil/clone/jre component=dbTier mode=apply stage=/u01/test/db/tech_st/11.2.0/appsutil/clone method=CUSTOM dbctxtg=/u01/test/db/tech_st/11.2.0/appsutil/TEST_t1erptest.xml rmanstage=/backup/clone/backup/data/stage rmantgtloc=/u01/test/db/apps_st/data srcdbname=PROD pwd=****** showProgressode

(注意:如果数据库的版本是11g,一定要注意apps的密码大小写,因为11g大小写敏感,受参数SEC_CASE_SENSITIVE_LOGON控制.)

根据日志查看进度,有没有什么错误

根据日志分析这个过程:

根据新生成的context_file创建实例,并启动到nomount状态

Restoring RAC database in "Scale Down" mode via RMAN with the command below:
sh -c ". /u01/test/db/tech_st/11.2.0/TEST_t1erptest.env; /u01/test/db/tech_st/11
.2.0/bin/rman target / nocatalog @/u01/test/db/tech_st/11.2.0/appsutil/out/TEST_
t1erptest/restore-rac1.rman > /u01/test/db/tech_st/11.2.0/appsutil/out/TEST_t1er
ptest/restore-rac1.log"

调用脚本/u01/test/db/tech_st/11.2.0/appsutil/out/TEST_
t1erptest/restore-rac1.rman恢复控制文件

 

The RMAN restore will take some time, please be patient...


.end std out.

.end err out.


Completed first phase of RMAN restore!


The following output is the contents of restore-rac2.rman


SQL*Plus: Release 11.2.0.3.0 Production on Wed Oct 16 14:12:39 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected.
catalog start with '/backup/clone/backup/data/stage' NOPROMPT;
RUN {
set newname for datafile 1 to NEW;
set newname for datafile 2 to NEW;
set newname for datafile 3 to NEW;
set newname for datafile 4 to NEW;
set newname for datafile 5 to NEW;
set newname for datafile 6 to NEW;
set newname for datafile 7 to NEW;
set newname for datafile 8 to NEW;
set newname for datafile 9 to NEW;
set newname for datafile 10 to NEW;
set newname for datafile 11 to NEW;
set newname for datafile 12 to NEW;
set newname for datafile 13 to NEW;
set newname for datafile 14 to NEW;
set newname for datafile 15 to NEW;
set newname for datafile 16 to NEW;
set newname for datafile 17 to NEW;
set newname for datafile 18 to NEW;
set newname for datafile 19 to NEW;
set newname for datafile 20 to NEW;
set newname for datafile 21 to NEW;
set newname for datafile 288 to NEW;
set newname for datafile 295 to NEW;
set newname for datafile 314 to NEW;
set newname for datafile 351 to NEW;
set newname for datafile 352 to NEW;
set newname for datafile 353 to NEW;
set newname for datafile 354 to NEW;
set newname for datafile 379 to NEW;
set newname for datafile 392 to NEW;
set newname for datafile 393 to NEW;
set newname for datafile 394 to NEW;
set newname for datafile 395 to NEW;
set newname for datafile 396 to NEW;
set newname for datafile 397 to NEW;
set newname for datafile 398 to NEW;
set newname for datafile 399 to NEW;
set newname for datafile 400 to NEW;
set newname for datafile 401 to NEW;
set newname for datafile 402 to NEW;
set newname for datafile 403 to NEW;
set newname for datafile 404 to NEW;
set newname for datafile 405 to NEW;
set newname for datafile 406 to NEW;
set newname for datafile 407 to NEW;
set newname for tempfile 1 to NEW;
set newname for tempfile 2 to NEW;
restore database;
switch datafile all;
switch tempfile all;
recover database;
}
exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64
bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

.end std out.

.end err out.


Completed sql generation of restore-rac2-rman


Now executing second RMAN script. with the command below:
sh -c ". /u01/test/db/tech_st/11.2.0/TEST_t1erptest.env; /u01/test/db/tech_st/11
.2.0/bin/rman target / nocatalog @/u01/test/db/tech_st/11.2.0/appsutil/out/TESTt1erptest/restore-rac2.rman > /u01/test/db/tech_st/11.2.0/appsutil/out/TEST_t1er
ptest/restore-rac2.log"

还原并恢复数据文件和日志文件

这个时间一般最长。

This portion of the RMAN restore takes can take quite a long time...

Attempting to move clone specific files to temporary directory..
Src location: /backup/clone/backup/data/stage
Target location: /u01/test/db/tech_st/11.2.0/appsutil/temp/stage
Moving files:
adcrdb.zip
addbhomsrc.xml
addbhomtgt.xml
Attempting to move clone specific files to temporary directory..
Src location: /u01/test/db/tech_st/11.2.0/appsutil/temp/stage
Target location: /backup/clone/backup/data/stage
Moving files:
adcrdb.zip
addbhomsrc.xml
addbhomtgt.xml

.end std out.

.end err out.


Completed second phase of RMAN restore, one more phase left

The following output is the contents of contents of restore-rac-logfile.sql


SQL*Plus: Release 11.2.0.3.0 Production on Wed Oct 16 14:25:50 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected.
connect /as sysdba
alter database rename file '+PRODDATA/prod/onlinelog/group_1.265.817688643' to '
/u01/test/db/apps_st/data/TEST/datafile/group_1.265.817688643';
alter database rename file '+PRODDATA/prod/onlinelog/group_2.266.817688649' to '
/u01/test/db/apps_st/data/TEST/datafile/group_2.266.817688649';
alter database rename file '+PRODDATA/prod/onlinelog/group_3.267.817688651' to '
/u01/test/db/apps_st/data/TEST/datafile/group_3.267.817688651';
alter database rename file '+PRODDATA/prod/onlinelog/group_4.268.817688653' to '
/u01/test/db/apps_st/data/TEST/datafile/group_4.268.817688653';
alter database rename file '+PRODDATA/prod/onlinelog/group_5.261.817688659' to '
/u01/test/db/apps_st/data/TEST/datafile/group_5.261.817688659';
alter database rename file '+PRODDATA/prod/onlinelog/group_6.262.817688661' to '
/u01/test/db/apps_st/data/TEST/datafile/group_6.262.817688661';
alter database rename file '+PRODDATA/prod/onlinelog/group_7.263.817688663' to '
/u01/test/db/apps_st/data/TEST/datafile/group_7.263.817688663';
alter database rename file '+PRODDATA/prod/onlinelog/group_8.264.817688665' to '
/u01/test/db/apps_st/data/TEST/datafile/group_8.264.817688665';
exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64
bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

.end std out.

.end err out.

Completed sql generation of restore-rac-logfile.sql

The following output comes from logfiles being renamed


SQL*Plus: Release 11.2.0.3.0 Production on Wed Oct 16 14:25:51 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected.

Database altered.


Database altered.


Database altered.


Database altered.


Database altered.


Database altered.


Database altered.


Database altered.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64
bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

.end std out.

.end err out.


Now executing third phase of RMAN script. with the command below
sh -c ". /u01/test/db/tech_st/11.2.0/TEST_t1erptest.env; /u01/test/db/tech_st/11
.2.0/bin/rman target / nocatalog @/u01/test/db/tech_st/11.2.0/appsutil/out/TEST_
t1erptest/restore-rac3.rman > /u01/test/db/tech_st/11.2.0/appsutil/out/TEST_t1er
ptest/restore-rac3.log"

修改DBID和DB_NAME并以resetlogs的方式打开数据库

.end std out.

.end err out.


Finished primary RAC database node restore & recovery, now changing the DBID and
 DBNAME via DBNEWID utility.


Changing DBID and DBNAME...


.end std out.

DBNEWID: Release 11.2.0.3.0 - Production on Wed Oct 16 14:27:27 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


NID-00106: LOGIN to target database failed with Oracle error:
ORA-01017: invalid username/password; logon denied

 

Change of database name failed during validation - database is intact.
DBNEWID - Completed with validation errors.


.end err out.

Not able to rename DB via DBNEWID...exiting now!

这块遇到了之前提到的问题,源数据的apps密码是大写的,我写了小写,所以在修改DBID和DB_NAME的时候报ORA-01017: invalid username/password; logon denied的错误。有心重新执行一次,重新恢复数据库文件又要花很多时间,决定手工执行下面的操作来完成克隆。

数据库启动到mount状态,然后执行nid

>nid target=apps/****** dbname=TEST

SQL>create spfile from pfile;

SQL>shutdown immediate;

SQL>startup
cd <RDBMS ORACLE_HOME>/appsutil/clone/bin  
perl adcfgclone.pl dbTechStack  
cd <RDBMS ORACLE_HOME>/appsutil/install/<CONTEXT NAME> 

sqlplus "/ as sysdba" @adupdlib.sql <libext>
where <libext> is "sl" for HP-UX, "so" for any other UNIX platform
and not required for Windows.

cd <RDBMS ORACLE_HOME>/appsutil/clone/bin  
perl adcfgclone.pl dbconfig <target context file>

9.在目标数据库执行autoconfig

  cd /u01/test/db/tech_st/11.2.0/appsutil/scripts/TEST_t1erptest

adautoconfig.sh

在这块又遇到一个问题,在autoconfig的时候报错了

Executing txkcreateACL.sql ...


SQL*Plus: Release 11.2.0.3.0 Production on Wed Oct 16 20:48:59 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected.
  FROM DBA_NETWORK_ACLS
       *
ERROR at line 17:
ORA-06550: line 17, column 8:
PL/SQL: ORA-04045: errors during recompilation/revalidation of
SYS.DBA_NETWORK_ACLS
ORA-00600: internal error code, arguments: [qmxqtmChkXQAtomMapSQL:2], [], [],
[], [], [], [], [], [], [], [], []
ORA-06550: line 16, column 3:
PL/SQL: SQL Statement ignored

后来发现是创建了一个只读的用户

并在XDB的对象上创建了同义词

删除同义词之后执行utlrp.sql编译无效对象,没有效果

卸载了XDB并重新安装,问题解决

重建过程请参考

Master Note for Oracle XML Database (XDB) Install / Deinstall (Doc ID 1292089.1)

Selecting from SYS.RESOURCE_VIEW Fails with ORA-01422 and selecting from SYS.DBA_NETWORK_ACLS Fails with ORA-600 [qmxqtmChkXQAtomMapSQL:2] (Doc ID 1574173.1)

XDB Deinstallation script. catnoqm.sql leads to Invalid SYS Objects (Doc ID 1269470.1)

10.恢复APPS目录

11.执行克隆

   perl adcfgclone appsTier

12.更新标题

    sysadmin登陆-system administrator->profile->system->Site Name

13.更新打印机配置

14.更新工作流的配置信息

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值