Cloning Oracle EBS R12.2 using Rapid Clone

710 查看

克隆说明

参考文档

Cloning Oracle E-Business Suite Release 12.2 with Rapid Clone (文档 ID 1383621.1)
Oracle E-Business Suite Installation and Upgrade Notes Release 12 (12.2) for Linux x86-64 (文档 ID 1330701.1)

介绍

克隆是一个将现有的环境复制为另外的环境,作为测试等用途的一个过程。对于EBS来说,Oracle提供了Rapid Clone的工具来进行整个操作过程。

按照Oracle官方文档的建议,EBS的克隆只能是向相同或者更高版本的OS平台进行。例如,EBS的克隆可以从solaris 10平台向solaris 11平台进行,但是反过来的从solaris 11到solaris 10的克隆则不支持。

对EBS来说,通过rapid clone工具,可以实现下面目的:

  1. Standard cloning

  2. System scale-up

  3. System transformations

  4. Patching and upgrading

在EBS R12.2版本中,应用层拥有run fs和patch fs两个文件系统,以支持R12.2的hot patch特性(可以在应用层不停止的情况下apply patch,只有patch cycle最后一步切换文件系统时需要短暂的停机时间)。需要分别克隆run fs和patch fs是R12.2克隆相对于之前版本的EBS最大的不同之处。

准备工作

本文以在Oracle Linux 6.1 x86-64平台的克隆一套EBS R12.2的测试环境为例,说明系统克隆的操作过程。
本次操作使用的EBS版本为R12.2.3。

注意:开始进行克隆操作之前,确保source系统不处于patch cycle中。

克隆介质准备

开始克隆之前,需要先到source环境上得到克隆需要的介质。这部分操作在source环境上进行。

运行prelcone

preclone是EBS中提供的脚本,用来生成在目标环境进行克隆需要的中间文件。通常,进行系统克隆之前,都必须在source环境上执行prelcone操作,否则可能导致在target进行克隆时出现错误。

和12.2之前版本不同的是:在source环境上运行prelcone时,source环境的数据库和应用服务都需要处于运行状态,而在之前版本,运行prelcone时,数据库必须是运行状态,但是应用服务则可以是启动状态,也可以是关闭状态。
运行preclone时也要求应用层服务处于运行状态的原因是:在12.2版本中,中间件使用了Weblogic,而preclone clone操作会需要连接到Weblogic的domain中进行一些列操作。

数据库层preclone

此操作使用数据库层OS用户执行。

$ cd $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME
$ perl adpreclone.pl dbTier
Enter the APPS User Password:  <--按照提示输入数据库apps用户密码

应用层preclone

此操作使用应用层OS用户执行。

$ cd $ADMIN_SCRIPTS_HOME
$ perl adpreclone.pl appsTier
Enter the APPS User Password:  <-- 按照提示输入数据库apps用户密码
Enter the Weblogic AdminServer password :  <-- 按照提示输入weblogic admin用户密码

打包克隆需要的文件

打包应用层文件

应用层需要打包的文件为run fs下的EBSapps目录。
假设数据库安装的base目录为/u01/test/app,且当前的run fs是fs1,则需要打包的目录为:
run fs的路径可以通过查看$RUN_BASE的路径获取(echo $RUN_BASE)

/u01/test/app
├── EBSapps.env
├── fs1
│   ├── EBSapps     <-- 需要打包的目录
│   ├── FMW_Home
│   ├── inst
│   └── nohup.out
├── fs2
│   ├── EBSapps
│   ├── FMW_Home
│   └── inst
└── fs_ne
    ├── EBSapps
    └── inst

打包数据库层文件

数据库层需要打包的文件为整个数据库安装目录。
假设数据库安装目录为/u01/test/db,则需要打包的目录为:

/u01/test/db        <-- 需要打包的目录
├── 11.2.0
└── data

设置目标环境操作系统

如果克隆的target环境是新安装的OS,那么开始克隆之前,需要对克隆目标环境所在的OS进行一些设置。

安装OS RPM

安装RPMS from OS media

此部分安装可以从操作系统安装光盘中获取到的rpm包,配置使用yum工具进行安装。

MOUNT OS media ISO
mount -o loop /u01/media/OracleLinux-R6-U1-Server-x86_64-dvd.iso /media
创建install.repo

在 /etc/yum.repos.d/install.repo中添加如下内容:

[install]
name=install
baseurl=file:///media
enabled=1
gpgcheck=0
安装 rpm包

使用root用户执行下面脚本:

yum install libXrender.i686 \
binutils.x86_64 \
compat-libstdc++-296.i686 \
compat-libstdc++-33.i686 \
gcc.x86_64 \
gcc-c++.x86_64 \
glibc.i686  \
glibc.x86_64 \
glibc-common.x86_64 \
glibc-devel.i686  \
glibc-devel.x86_64 \
libgcc.i686 \
libgcc.x86_64 \
libstdc++-devel.i686 \
libstdc++-devel.x86_64 \
libstdc++.i686 \
libstdc++.x86_64 \
libXi.i686 \
libXp.i686 \
libXp.x86_64 \
libaio.i686 \
libaio.x86_64 \
libgomp.x86_64 \
make.x86_64 \
gdbm.i686 \
gdbm.x86_64 \
redhat-lsb.x86_64 \
sysstat.x86_64 \
util-linux-ng.x86_64 \
compat-libcap1.x86_64 \
compat-libstdc++-33.x86_64 \
elfutils-libelf-devel.x86_64 \
libaio-devel.i686 \
libaio-devel.x86_64 \
unixODBC.i686 \
unixODBC-devel.i686 \
xorg-x11-utils.x86_64 \
ksh \
libICE.i686 \
libSM.i686 \
libXt.i686

安装RPMS from Oracle

除了操作系统中包含的RPM包之后,还需要安装2个Oracle提供的RPM包。
这2个RPM包可以从http://oss.oracle.com/project...下载

rpm -Uvh openmotif21-2.1.30-11.EL6.i386
rpm -Uvh xorg-x11-libs-compat-6.8.2-1.EL.33.0.1.i386

安装完成之后,还需要执行下面命令

ln -s /usr/X11R6/lib/libXtst.so.6.1 /usr/lib/libXtst.so.6
ls -l  /usr/lib/libXtst.so.6

设置OS参数

/etc/sysctl.conf

cat >> /etc/sysctl.conf <<EOF
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
EOF

/etc/security/limits.conf

cat >> /etc/security/limits.conf <<EOF
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
EOF

/etc/hosts

/etc/hosts文件需要按照下面格式进行设置:

192.168.100.134    r1223.home.net    r1223

创建用户和组

创建2个用户:oratest和appltest
其中,oratest是安装数据库的OS用户
appltest是安装应用的OS用户

/usr/sbin/groupadd dba
/usr/sbin/useradd -g dba oratest
/usr/sbin/useradd -g dba appltest

创建目标环境安装目录

目标环境安装目录为/u01/test

创建/etc/oraInst.loc

/etc/oraInst.loc包含指向oraInventory位置的参数。手动创建/etc/oraInst.loc文件,包含如下内容:

inventory_loc=/u01/test/oraInventory
inst_group=dba

创建完成/etc/oraInst.loc文件之后,手动创建oraInventory目录:

mkdir /u01/test/oraInventory
chmod 777 /u01/test/oraInventory

克隆步骤

说明

关于数据库克隆的说明

克隆目标环境的数据库安装在/u01/test/db目录下,克隆目标数据库使用SID为TEST,使用的端口池为0(即数据库端口使用1521)。

EBS中端口池的概念为:每个端口池对应数据库和应用的一组端口。比如当端口池选择为0时,数据库监听端口为1521,应用的访问端口为8000。如果端口池增加1,数据库和应用的端口也相应的增加。

关于应用克隆的说明

克隆目标环境的应用安装在/u01/test/app目录下。在EBS R12.2中,应用层包含fs1和fs2双文件系统。克隆时,先使用tar包中的文件克隆出run fs,再从克隆好的run fs中克隆出patch fs。run fs使用和数据库相同的端口池1,patch fs使用端口池2。

过程如下面截图所示:

本次克隆中,文件系统的对应关系为:

fs1 -> run fs
fs2 -> patch fs

数据库克隆

解压数据库层tar包

解压从源环境拷贝过来的数据库层tar包,解压到/u01/test目录中,解压之后的目录结果如下所示:

/u01/test/db
├── 11.2.0
└── data

运行克隆脚本

数据库的克隆使用oratest用户操作,执行下面操作:

[oratest@r1223 ~]$ cd /u01/test/db/11.2.0/appsutil/clone/bin
[oratest@r1223 bin]$ perl adcfgclone.pl dbTier

                     Copyright (c) 2011 Oracle Corporation
                        Redwood Shores, California, USA

                        Oracle E-Business Suite Rapid Clone

                                 Version 12.2

                      adcfgclone Version 121.63.12020000.7.1202010.2

Enter the APPS password : <-- 输入数据库apps密码

Running:
/u01/test/db/11.2.0/appsutil/clone/bin/../jre/bin/java -Xmx600M -cp /u01/test/db/11.2.0/appsutil/clone/jlib/java:/u01/test/db/11.2.0/appsutil/clone/jlib/xmlparserv2.jar:/u01/test/db/11.2.0/appsutil/clone/jlib/ojdbc5.jar oracle.apps.ad.context.CloneContext -e /u01/test/db/11.2.0/appsutil/clone/bin/../context/db/CTXORIG.xml -validate -pairsfile /tmp/adpairsfile_29447.lst -stage /u01/test/db/11.2.0/appsutil/clone  2> /tmp/adcfgclone_29447.err; echo $? > /tmp/adcfgclone_29447.res

Log file located at /u01/test/db/11.2.0/appsutil/clone/bin/CloneContext_0106093406.log

Provide the values required for creation of the new Database Context file.

Target System Hostname (virtual or normal) [r1223] :  <-- 目标服务器机器名,通常默认即可

Target Instance is RAC (y/n) [n] : <-- 目标数据库是否为RAC数据库,此处为单实例数据库,选n

Target System Database SID : TEST <-- 此处设置目标数据库的SID,设置为TEST

Target System Base Directory : /u01/test/db <-- 此处设置目标环境base目录的位置,此处为/u01/test/db 

Target System utl_file_dir Directory List : /u01/test/db/temp <-- 此处设置数据库utl_file_dir参数指定的位置,此处设置为/u01/test/db/temp

Number of DATA_TOP's on the Target System [1] :  <-- DATA_TOP含义为存放数据文件的目录,我们的数据文件都存放在一个目录中,所以此处设置为1

Target System DATA_TOP Directory 1 [/u01/test/db/data] : /u01/test/db/data <-- 此处设置数据文件保存路径 

Target System RDBMS ORACLE_HOME Directory [/u01/test/db/11.2.0] : <-- 此处设置ORACLE_HOME的路径

Do you want to preserve the Display [r1223:0.0] (y/n)  : n <-- 设置DISPLAY是否沿用源环境,此处单独设置选择为n

Target System Display [r1223:0.0] : <-- 设置DISPLAY变量值,对于数据库层,选用默认值即可。

Target System Port Pool [0-99] : 0 <-- 设置系统选用的端口池,此处选择为0。端口池0对应的数据库端口为1521

上面的设置完成之后,系统开始运行克隆过程。

Checking the port pool 0
done: Port Pool 0 is free
Report file located at /u01/test/db/11.2.0/appsutil/temp/portpool.lst
Complete port information available at /u01/test/db/11.2.0/appsutil/temp/portpool.lst

Backing up /u01/test/db/11.2.0/appsutil/TEST_r1223.xml to /u01/test/db/11.2.0/appsutil/TEST_r1223.xml.bak

Creating the new Database Context file from :
  /u01/test/db/11.2.0/appsutil/template/adxdbctx.tmp

The new database context file has been created :
  /u01/test/db/11.2.0/appsutil/TEST_r1223.xml

Log file located at /u01/test/db/11.2.0/appsutil/clone/bin/CloneContext_0106093406.log
Check Clone Context logfile /u01/test/db/11.2.0/appsutil/clone/bin/CloneContext_0106093406.log for details.

Running Rapid Clone with command:
Running:
perl /u01/test/db/11.2.0/appsutil/clone/bin/adclone.pl java=/u01/test/db/11.2.0/appsutil/clone/bin/../jre mode=apply stage=/u01/test/db/11.2.0/appsutil/clone component=dbTier method=CUSTOM dbctxtg=/u01/test/db/11.2.0/appsutil/TEST_r1223.xml showProgress contextValidated=true


Beginning database tier Apply - Tue Jan  6 09:34:39 2015

/u01/test/db/11.2.0/appsutil/clone/bin/../jre/bin/java -Xmx600M -DCONTEXT_VALIDATED=true  -Doracle.installer.oui_loc=/u01/test/db/11.2.0/oui -classpath /u01/test/db/11.2.0/appsutil/clone/jlib/xmlparserv2.jar:/u01/test/db/11.2.0/appsutil/clone/jlib/ojdbc6.jar:/u01/test/db/11.2.0/appsutil/clone/jlib/java:/u01/test/db/11.2.0/appsutil/clone/jlib/oui/OraInstaller.jar:/u01/test/db/11.2.0/appsutil/clone/jlib/oui/ewt3.jar:/u01/test/db/11.2.0/appsutil/clone/jlib/oui/share.jar:/u01/test/db/11.2.0/appsutil/clone/jlib/oui/srvm.jar:/u01/test/db/11.2.0/appsutil/clone/jlib/ojmisc.jar   oracle.apps.ad.clone.ApplyDBTier -e /u01/test/db/11.2.0/appsutil/TEST_r1223.xml -stage /u01/test/db/11.2.0/appsutil/clone   -showProgress
APPS Password : Log file located at /u01/test/db/11.2.0/appsutil/log/TEST_r1223/ApplyDBTier_01060934.log
  /      0% completed       

克隆运行完成之后,会自动将数据库的服务(包括oracle service和listener)启动。如下所示:

Completed Apply...
Tue Jan  6 09:41:30 2015

Starting database listener for TEST:
Running:
/u01/test/db/11.2.0/appsutil/scripts/TEST_r1223/addlnctl.sh start TEST
Logfile: /u01/test/db/11.2.0/appsutil/log/TEST_r1223/addlnctl.txt

You are running addlnctl.sh version 120.4


Starting listener process TEST ...


Listener TEST has already been started.


addlnctl.sh: exiting with status 0

addlnctl.sh: check the logfile /u01/test/db/11.2.0/appsutil/log/TEST_r1223/addlnctl.txt for more information ...  

设置oratest用户的.bash_profile

数据库克隆完成之后,会在ORACLE_HOME中生成一个.env文件中记录关于此ORACLE_HOME的一些环境变量,只需要在oratest用户的.bash_profile文件中引用此env文件,即可加载到所需要的环境变量。

针对此次克隆,在oratest用户的.bash_profile中添加如下内容:

. /u01/test/db/11.2.0/TEST_r1223.env

创建数据库起停脚本

对于EBS的数据库来说,可以直接使用oracle提供的脚本进行数据库的启停。
可以创建如下的启停脚本

startdb.sh:

/u01/test/db/11.2.0/appsutil/scripts/TEST_r1223/addbctl.sh start
/u01/test/db/11.2.0/appsutil/scripts/TEST_r1223/addlnctl.sh start TEST

stopdb.sh:

/u01/test/db/11.2.0/appsutil/scripts/TEST_r1223/addbctl.sh stop immediate
/u01/test/db/11.2.0/appsutil/scripts/TEST_r1223/addlnctl.sh stop TEST

克隆应用run fs

数据库克隆完成之后,即可开始克隆应用。首先需要克隆出run fs:fs1。

解压应用层tar包

解压从源环境拷贝过来的应用层tar包,解压到/u01/test/app/fs1目录中,解压之后的目录结果如下所示:

/u01/test/app/fs1
└── EBSapps

运行克隆脚本

应用克隆使用appltest用户进行操作:

[appltest@r1223 bin]$ cd /u01/test/app/fs1/EBSapps/comn/clone/bin
[appltest@r1223 bin]$ perl adcfgclone.pl appsTier

                     Copyright (c) 2011 Oracle Corporation
                        Redwood Shores, California, USA

                        Oracle E-Business Suite Rapid Clone

                                 Version 12.2

                      adcfgclone Version 120.63.12020000.26

Enter the APPS password : 
Running:
/u01/test/app/fs1/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -classpath /u01/test/app/fs1/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/java:/u01/test/app/fs1/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.clone.util.OPWrapper -encryptpwd /u01/test/app/fs1/EBSapps/comn/clone/bin/../FMW/tempinfoApps.txt

Enter the Weblogic AdminServer password : 
Running:
/u01/test/app/fs1/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -classpath /u01/test/app/fs1/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/java:/u01/test/app/fs1/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.clone.util.OPWrapper /u01/test/app/fs1/EBSapps/comn/clone/bin/../FMW/tempinfo.txt
Running:
/u01/test/app/fs1/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -classpath /u01/test/app/fs1/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/java:/u01/test/app/fs1/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.clone.util.OPWrapper /u01/test/app/fs1/EBSapps/comn/clone/bin/../FMW/EBSDataSource


Do you want to add a node (yes/no) [no] : 


Running:
/u01/test/app/fs1/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -cp /u01/test/app/fs1/EBSapps/comn/clone/jlib/java:/u01/test/app/fs1/EBSapps/comn/clone/jlib/xmlparserv2.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/ojdbc5.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/java:/u01/test/app/fs1/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.context.CloneContext -e /u01/test/app/fs1/EBSapps/comn/clone/bin/../context/apps/CTXORIG.xml -validate -pairsfile /tmp/adpairsfile_2467.lst -stage /u01/test/app/fs1/EBSapps/comn/clone  2> /tmp/adcfgclone_2467.err; echo $? > /tmp/adcfgclone_2467.res

Log file located at /u01/test/app/fs1/EBSapps/comn/clone/bin/CloneContext_0106101014.log

Target System File Edition type [run] : 

Provide the values required for creation of the new APPL_TOP Context file.

Target System Hostname (virtual or normal) [r1223] : 

Target System Database SID : TEST

Target System Database Server Node [r1223] : 

Target System Database Domain Name [home.net] : 

Target System Base Directory : /u01/test/app

Target System Base Directory set to /u01/test/app

Target System Current File System Base set to /u01/test/app/fs1

Target System Other File System Base set to /u01/test/app/fs2

Target System Fusion Middleware Home set to /u01/test/app/fs1/FMW_Home

Target System Web Oracle Home set to /u01/test/app/fs1/FMW_Home/webtier

Target System Appl TOP set to /u01/test/app/fs1/EBSapps/appl

Target System COMMON TOP set to /u01/test/app/fs1/EBSapps/comn

Target System Instance Home Directory [/u01/test/app] : 

Target System Instance Top set to /u01/test/app/fs1/inst/apps/TEST_r1223

Do you want to preserve the Display [r1223:1.0] (y/n)  : n

Target System Display [r1223:0.0] : r1223:1.0

Target System Root Service [enabled] : 

Target System Web Administration [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] : 

Target System Port Pool [0-99] : 0

Checking the port pool 0
done: Port Pool 0 is free
Report file located at /u01/test/app/fs1/inst/apps/TEST_r1223/admin/out/portpool.lst
Complete port information available at /u01/test/app/fs1/inst/apps/TEST_r1223/admin/out/portpool.lst

UTL_FILE_DIR on database tier consists of the following directories.

1. /usr/tmp
2. /u01/test/db/temp
3. /u01/test/db/11.2.0/appsutil/outbound/TEST_r1223
4. /usr/tmp
Choose a value which will be set as APPLPTMP value on the target node [1] : 2

Creating the new APPL_TOP Context file from :
  /u01/test/app/fs1/EBSapps/comn/clone/context/apps/adxmlctx.tmp

The new APPL_TOP context file has been created :
  /u01/test/app/fs1/inst/apps/TEST_r1223/appl/admin/TEST_r1223.xml

Log file located at /u01/test/app/fs1/EBSapps/comn/clone/bin/CloneContext_0106101014.log
Check Clone Context logfile /u01/test/app/fs1/EBSapps/comn/clone/bin/CloneContext_0106101014.log for details.

Running Rapid Clone with command:
Running:
perl /u01/test/app/fs1/EBSapps/comn/clone/bin/adclone.pl java=/u01/test/app/fs1/EBSapps/comn/clone/bin/../jre mode=apply stage=/u01/test/app/fs1/EBSapps/comn/clone component=appsTier method=CUSTOM appctxtg=/u01/test/app/fs1/inst/apps/TEST_r1223/appl/admin/TEST_r1223.xml showProgress contextValidated=true



FMW Pre-requisite check log file location : /u01/test/app/fs1/EBSapps/comn/clone/FMW/logs/prereqcheck.log

Running: /u01/test/app/fs1/EBSapps/comn/clone/FMW/t2pjdk/bin/java -classpath /u01/test/app/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/engine.jar:/u01/test/app/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraPrereq.jar:/u01/test/app/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraPrereqChecks.jar:/u01/test/app/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraInstaller.jar:/u01/test/app/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraInstallerNet.jar:/u01/test/app/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/srvm.jar:/u01/test/app/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl.jar:/u01/test/app/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl2.jar:/u01/test/app/fs1/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl-log4j.jar:/u01/test/app/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/xmlparserv2.jar:/u01/test/app/fs1/EBSapps/comn/clone/prereq/webtier/oui/jlib/share.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/java oracle.apps.ad.clone.util.FMWOracleHomePreReqCheck -prereqCheckFMW -e /u01/test/app/fs1/inst/apps/TEST_r1223/appl/admin/TEST_r1223.xml -stage /u01/test/app/fs1/EBSapps/comn/clone -log /u01/test/app/fs1/EBSapps/comn/clone/FMW/logs/prereqcheck.log

Beginning application tier Apply - Tue Jan  6 10:10:56 2015

/u01/test/app/fs1/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -DCONTEXT_VALIDATED=true -Doracle.installer.oui_loc=/oui -classpath /u01/test/app/fs1/EBSapps/comn/clone/jlib/xmlparserv2.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/ojdbc6.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/java:/u01/test/app/fs1/EBSapps/comn/clone/jlib/oui/OraInstaller.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/oui/ewt3.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/oui/share.jar:/u01/test/app/fs1/FMW_Home/webtier/../Oracle_EBS-app1/oui/jlib/srvm.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/test/app/fs1/FMW_Home/wlserver_10.3/server/lib/weblogic.jar:/u01/test/app/fs1/EBSapps/comn/clone/jlib/obfuscatepassword.jar  oracle.apps.ad.clone.ApplyAppsTier -e /u01/test/app/fs1/inst/apps/TEST_r1223/appl/admin/TEST_r1223.xml -stage /u01/test/app/fs1/EBSapps/comn/clone    -showProgress -nopromptmsg 
Log file located at /u01/test/app/fs1/inst/apps/TEST_r1223/admin/log/clone/ApplyAppsTier_01061010.log

克隆运行完成之后,会出现下面提问是否要启动应用的提示:

  /    100% completed       

Completed Apply...
Tue Jan  6 10:35:08 2015


 Executing command: /u01/test/app/fs1/EBSapps/10.1.2/bin/sqlplus @/u01/test/app/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/truncate_ad_nodes_config_status.sql


Do you want to startup the Application Services for TEST? (y/n) [n] :

我们选择先不启动应用服务。
接下来进行patch fs: fs2的克隆

克隆应用patch fs

拷贝文件到patch fs:fs2

克隆patch fs之前,需要先将run fs(fs1)中的EBSapps目录拷贝到patch fs(fs2)中。拷贝时注意使用cp -Rp 命令以保持目录中的符号链接。
拷贝完成之后的目录结构如下所示:

/u01/test/app
├── EBSapps.env
├── fs1
│   ├── EBSapps
│   ├── FMW_Home
│   ├── inst
│   └── nohup.out
├── fs2
│   └── EBSapps <- 从fs1中拷贝过来的目录
└── fs_ne
    ├── EBSapps
    └── inst

运行克隆脚本

patch fs的克隆使用applprod用户来操作:

[appltest@r1223 bin]$ cd /u01/test/app/fs2/EBSapps/comn/clone/bin
[appltest@r1223 bin]$ perl adcfgclone.pl appsTier

                     Copyright (c) 2011 Oracle Corporation
                        Redwood Shores, California, USA

                        Oracle E-Business Suite Rapid Clone

                                 Version 12.2

                      adcfgclone Version 120.63.12020000.26

Enter the APPS password :  <-- 此处填写数据库apps用户的密码
Running:
/u01/test/app/fs2/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -classpath /u01/test/app/fs2/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/java:/u01/test/app/fs2/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.clone.util.OPWrapper -encryptpwd /u01/test/app/fs2/EBSapps/comn/clone/bin/../FMW/tempinfoApps.txt

Enter the Weblogic AdminServer password : <-- 此处填写Weblogic admin server的密码
Running:
/u01/test/app/fs2/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -classpath /u01/test/app/fs2/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/java:/u01/test/app/fs2/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.clone.util.OPWrapper /u01/test/app/fs2/EBSapps/comn/clone/bin/../FMW/tempinfo.txt
Running:
/u01/test/app/fs2/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -classpath /u01/test/app/fs2/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/java:/u01/test/app/fs2/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.clone.util.OPWrapper /u01/test/app/fs2/EBSapps/comn/clone/bin/../FMW/EBSDataSource


Do you want to add a node (yes/no) [no] : <-- 选择我们当前进行的是否是增加节点操作,我们是单节点环境的克隆,这里选no


Running:
/u01/test/app/fs2/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -cp /u01/test/app/fs2/EBSapps/comn/clone/jlib/java:/u01/test/app/fs2/EBSapps/comn/clone/jlib/xmlparserv2.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/ojdbc5.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/obfuscatepassword.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/java:/u01/test/app/fs2/EBSapps/comn/clone/jlib/emCfg.jar oracle.apps.ad.context.CloneContext -e /u01/test/app/fs2/EBSapps/comn/clone/bin/../context/apps/CTXORIG.xml -validate -pairsfile /tmp/adpairsfile_1672.lst -stage /u01/test/app/fs2/EBSapps/comn/clone  2> /tmp/adcfgclone_1672.err; echo $? > /tmp/adcfgclone_1672.res

Log file located at /u01/test/app/fs2/EBSapps/comn/clone/bin/CloneContext_0106143016.log

Target System File Edition type [run] : patch <-- 询问我们克隆的是run fs还是patch fs,这里填写patch

Enter the full path of Run File System Context file : /u01/test/app/fs1/inst/apps/TEST_r1223/appl/admin/TEST_r1223.xml <-- 这里需要填写run fs中context file的路基in个

Provide the values required for creation of the new APPL_TOP Context file.

Target System Fusion Middleware Home set to /u01/test/app/fs2/FMW_Home

Target System Web Oracle Home set to /u01/test/app/fs2/FMW_Home/webtier

Target System Appl TOP set to /u01/test/app/fs2/EBSapps/appl

Target System COMMON TOP set to /u01/test/app/fs2/EBSapps/comn

Target System Instance Top set to /u01/test/app/fs2/inst/apps/TEST_r1223

Target System Port Pool [0-99] : 1 <-- 为patch fs选择端口池。patch fs使用的端口池需要和run fs不同,刚才的run fs选择的是0,所以这里选择1.

Checking the port pool 1
done: Port Pool 1 is free
Report file located at /u01/test/app/fs2/inst/apps/TEST_r1223/admin/out/portpool.lst
Complete port information available at /u01/test/app/fs2/inst/apps/TEST_r1223/admin/out/portpool.lst

UTL_FILE_DIR on database tier consists of the following directories.

1. /usr/tmp
2. /u01/test/db/temp
3. /u01/test/db/11.2.0/appsutil/outbound/TEST_r1223
4. /usr/tmp

Choose a value which will be set as APPLPTMP value on the target node [1] : 2 <-- 选择utl_file_dir的路径,这里选择2.

上面的设置完成之后,开始自动运行克隆的过程。

Creating the new APPL_TOP Context file from :
  /u01/test/app/fs2/EBSapps/comn/clone/context/apps/adxmlctx.tmp

The new APPL_TOP context file has been created :
  /u01/test/app/fs2/inst/apps/TEST_r1223/appl/admin/TEST_r1223.xml

Log file located at /u01/test/app/fs2/EBSapps/comn/clone/bin/CloneContext_0106143016.log
Check Clone Context logfile /u01/test/app/fs2/EBSapps/comn/clone/bin/CloneContext_0106143016.log for details.

Running Rapid Clone with command:
Running:
perl /u01/test/app/fs2/EBSapps/comn/clone/bin/adclone.pl java=/u01/test/app/fs2/EBSapps/comn/clone/bin/../jre mode=apply stage=/u01/test/app/fs2/EBSapps/comn/clone component=appsTier method=CUSTOM appctxtg=/u01/test/app/fs2/inst/apps/TEST_r1223/appl/admin/TEST_r1223.xml showProgress contextValidated=true



FMW Pre-requisite check log file location : /u01/test/app/fs2/EBSapps/comn/clone/FMW/logs/prereqcheck.log

Running: /u01/test/app/fs2/EBSapps/comn/clone/FMW/t2pjdk/bin/java -classpath /u01/test/app/fs2/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/engine.jar:/u01/test/app/fs2/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraPrereq.jar:/u01/test/app/fs2/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraPrereqChecks.jar:/u01/test/app/fs2/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraInstaller.jar:/u01/test/app/fs2/EBSapps/comn/clone/prereq/webtier/oui/jlib/OraInstallerNet.jar:/u01/test/app/fs2/EBSapps/comn/clone/prereq/webtier/oui/jlib/srvm.jar:/u01/test/app/fs2/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl.jar:/u01/test/app/fs2/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl2.jar:/u01/test/app/fs2/EBSapps/comn/clone/prereq/webtier/Scripts/ext/jlib/ojdl-log4j.jar:/u01/test/app/fs2/EBSapps/comn/clone/prereq/webtier/oui/jlib/xmlparserv2.jar:/u01/test/app/fs2/EBSapps/comn/clone/prereq/webtier/oui/jlib/share.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/java oracle.apps.ad.clone.util.FMWOracleHomePreReqCheck -prereqCheckFMW -e /u01/test/app/fs2/inst/apps/TEST_r1223/appl/admin/TEST_r1223.xml -stage /u01/test/app/fs2/EBSapps/comn/clone -log /u01/test/app/fs2/EBSapps/comn/clone/FMW/logs/prereqcheck.log

Beginning application tier Apply - Tue Jan  6 14:31:09 2015

/u01/test/app/fs2/EBSapps/comn/clone/bin/../jre/bin/java -Xmx600M -DCONTEXT_VALIDATED=true -Doracle.installer.oui_loc=/oui -classpath /u01/test/app/fs2/EBSapps/comn/clone/jlib/xmlparserv2.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/ojdbc6.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/java:/u01/test/app/fs2/EBSapps/comn/clone/jlib/oui/OraInstaller.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/oui/ewt3.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/oui/share.jar:/u01/test/app/fs2/FMW_Home/webtier/../Oracle_EBS-app1/oui/jlib/srvm.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/ojmisc.jar:/u01/test/app/fs2/FMW_Home/wlserver_10.3/server/lib/weblogic.jar:/u01/test/app/fs2/EBSapps/comn/clone/jlib/obfuscatepassword.jar  oracle.apps.ad.clone.ApplyAppsTier -e /u01/test/app/fs2/inst/apps/TEST_r1223/appl/admin/TEST_r1223.xml -stage /u01/test/app/fs2/EBSapps/comn/clone    -showProgress -nopromptmsg 
Log file located at /u01/test/app/fs2/inst/apps/TEST_r1223/admin/log/clone/ApplyAppsTier_01061431.log
  /      0% completed       

自动配置完成之后会显示:

  /    100% completed       

Completed Apply...
Tue Jan  6 14:52:05 2015

Looking for incomplete CLONE record in ad_adop_session_patches table

The CLONE record status is no rows selected

Updating incomplete CLONE record to COMPLETED

设置应用层的.bash_profile

由于EBS R12.2有run fs和patch fs两个文件系统,这2个文件系统使用不同的环境变量设置,针对这种情况,Oracle也提供了一个EBSapps.env的脚本,方便用户将环境变量设置在2个文件系统之间进行切换。这个文件在app文件系统的base目录下面,如下:

/u01/test/app
├── EBSapps.env <-- 就是这个文件
├── fs1
├── fs2
└── fs_ne

可以在这个文件后面加上run或patch作为参数,会自动设置run fs和patch fs的环境变量。具体用法如下所示:

[appltest@r1223 app]$ . EBSapps.env run  <-- 加载run fs的环境变量

  E-Business Suite Environment Information
  ----------------------------------------
  RUN File System : /u01/test/app/fs1/EBSapps/appl
  PATCH File System : /u01/test/app/fs2/EBSapps/appl
  Non-Editioned File System : /u01/test/app/fs_ne
  DB Host: r1223.home.net  Service/SID: TEST

  Sourcing the RUN File System ...

[appltest@r1223 app]$ . EBSapps.env patch  <--加载patch fs的环境变量

  E-Business Suite Environment Information
  ----------------------------------------
  RUN File System : /u01/test/app/fs1/EBSapps/appl
  PATCH File System : /u01/test/app/fs2/EBSapps/appl
  Non-Editioned File System : /u01/test/app/fs_ne
  DB Host: r1223.home.net  Service/SID: TEST

  Sourcing the PATCH File System ...

所以在.bash_profile中添加下面内容,就可以实现登录时自动加载环境变量的效果

. /u01/test/app/EBSapps.env run

创建应用起停脚本的

startapp.sh

. /home/appltest/.bash_profile
cd $ADMIN_SCRIPTS_HOME
./adstrtal.sh apps/apps <<EOF
welcome1
EOF

stop.sh

. /home/appltest/.bash_profile
cd $ADMIN_SCRIPTS_HOME
./adstpall.sh apps/apps <<EOF
welcome1
EOF