R12克隆详细步骤
Total: 16 hours(10M bankwidth)
################### Clone and backup ####################
###### 前期准备 #############
过程需要80分钟
1。 APP 层autoconfig
切换到app用户: [appcrp12@dlhs1201 scripts]$ su - appcrp12
cd /d01/oracle/crp12/inst/apps/crp12_dlhs1201/admin/scripts
[appcrp12@dlhs1201 scripts]$ sh adautocfg.sh
2
。对appsutil
进行同步化
[appcrp12@dlhs1201 scripts]$ perl /d01/oracle/crp12/apps/apps_st/appl/ad/12.0.0/bin/admkappsutil.pl
以上命令会在/d01/oracle/crp12/inst/apps/crp12_ebs12/admin/out生成一个appsutil.zip文件。把这个文件复制到/d01/oracle/PROD/apps/tech_st/10.1.2目录。
在终端执行如下命令:
切换到app用户: [appcrp12@dlhs1201 scripts]$ su - appcrp12
###原文章说要加在环境变量:. /d01/oracle/PROD/db/tech_st/10.2.0/PROD_ebs12.env ( I don't think so )
切换到目标目录: [oracrp12@dlhs1201 ~]$ cd /d01/oracle/crp12/apps/tech_st/10.1.2/
复制文件:
cp -rap /d01/oracle/crp12/inst/apps/crp12_dlhs1201/admin/out/appsutil.zip /d01/oracle/crp12/apps/tech_st/10.1.2/
切换目录:
[appcrp12@dlhs1201 scripts]$ cd /d01/oracle/crp12/apps/tech_st/10.1.2/
备份目录:
[appcrp12@dlhs1201 10.1.2]$ cp -rap appsutil appsutil.bak
[applcrp@ebs36 10.1.2]$ rm -rf appsutil
解压缩:
unzip -o appsutil.zip
3。 数据库层autoconfig
切换到DB用户:
[appcrp12@dlhs1201 10.1.2]$ su - oracrp12
切换目录:
[oracrp12@dlhs1201 ~]$ cd /d01/oracle/crp12/db/tech_st/11.1.0/appsutil/scripts/crp12_dlhs1201/
执行autoconfig
[oracrp12@dlhs1201 crp12_dlhs1201]$ sh adautocfg.sh
4。 维护快照:
切换到app用户:
[oracrp12@dlhs1201 crp12_dlhs1201]$ su - appcrp12
启动adadmin工具
[appcrp12@dlhs1201 ~]$ adadmin
2)按照如下顺序进行快照(Snapshop)##以后不做这一步了,太浪费时间了(60分钟)
[2.Maintain Applications Files menu] → [4.Maintain snapshot information] → [2.Update current view snapshot] → [ 1.Update Complete APPL_TOP]
4)退出adadmin。
#######克隆文件复制 ########
About 3 hours
Adpreclone实行
DB层adpreclone:
切换到DB用户:[appcrp12@dlhs1201 10.1.2]$ su - oracrp12
切换到相应目录:
cd /d01/oracle/PROD/db/tech_st/10.2.0/appsutil/scripts/PROD_ebs12
执行预克隆:
perl adpreclone.pl dbTier
App层adpreclone:
切换到app用户: [oracrp12@dlhs1201 crp12_dlhs1201]$ su - appcrp12
切换到相应目录:
cd /d01/oracle/PROD/inst/apps/PROD_ebs12/admin/scripts
执行预克隆:
perl adpreclone.pl appsTier
停止app层
切换到app用户[oracrp12@dlhs1201 crp12_dlhs1201]$ su - appcrp12
切换到相应目录: cd /d01/oracle/PROD/inst/apps/PROD_ebs12/admin/scripts
执行停止app层命令:
./adstpall.sh apps/apps
停止db层
切换到DB层用户: [appcrp12@dlhs1201 10.1.2]$ su - oracrp12
切换到相应目录:
cd /d01/oracle/PROD/db/tech_st/10.2.0/appsutil/scripts/PROD_ebs12
执行停止服务: ./addbctl.sh stop immediate
停止listener:
./addlnctl.sh stop PROD
注意: 一定要保证DB和APP层的服务是正常关闭的,并且反复检查进程是否都结束了在执行下一步。
复制文件即可:
( Don't replicate inst directory, Because It can be automatical generate )
su - root
cp –RH /d01/oracle/PROD/db/* /db的目标文件夹
cp –RH /d01/oracle/PROD/apps/* /apps的目标文件夹
OR Using below command is ok.
[root@dlhs1201 u01]# tar zcvf /nfs/R12bak1/backup2/db.tgz ./db/
[root@dlhs1201 u01]# tar zcvf /nfs/R12bak1/backup2/apps.tgz ./apps/
inst文件夹不需要复制,利用以上两个文件夹可以,通过恢复操作可以生成inst文件夹。
###### Clone file transfer ########
About 4 hours
################### Recover clone #####################
###### Prepare for recover ##########
About 3 hours
1. [root@testone u01]# mkdir /u01
2. tar zxvf apps.tgz -C /u01/
3. tar zxvf db.tgz -C /u01/
4. [root@testone u01]# chown -R oracrp.dba db
5. [root@testone u01]# chown -R applcrp.dba apps/
6. [root@testone u01]# chmod -R 775 /u01/
###### Recover processing #########
About 3 hours
0. chmod -R 777 /tmp/
1. [root@testone u01]# su - oracrp
2. [oracrp@testone /]$ cd /u01/db/tech_st/11.1.0/appsutil/clone/bin/
#### DB Tier ######
3. [oracrp@testone bin]$ perl adcfgclone.pl dbTier
Provide the values required for creation of the new Database Context file.
Target System Hostname (virtual or normal) [testone] :
Target Instance is RAC (y/n) [n] :
Target System Database SID : crp12bak
Target System Base Directory : /u01
Target System utl_file_dir Directory List : /usr/tmp/crp12bak
Number of DATA_TOP's on the Target System [1] :
Target System DATA_TOP Directory 1 [/d01/oracle/crp12/db/apps_st/data] : /u01/db/apps_st/data
Do you want to preserve the Display [null] (y/n) ? :
Target System Display [testone: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] : 4
###### App Tier ######
1. [oracrp@testone bin]$ su - applcrp
2. [applcrp@testone ~]$ cd /u01/apps/apps_st/comn/clone/bin/
3. [applcrp@testone bin]$ perl adcfgclone.pl appsTier
注释:所涉及到的参数包括端口号,都必须和DB层的一样即可,参考DB层来操作。
Enter the APPS password :
Target System Hostname (virtual or normal) [testone] :
Target System Database SID : crp12bak
Target System Database Server Node [testone] :
Target System Base Directory : /u01
Target System Tools ORACLE_HOME Directory [/u01/apps/tech_st/10.1.2] :
Target System Web ORACLE_HOME Directory [/u01/apps/tech_st/10.1.3] :
Target System APPL_TOP Directory [/u01/apps/apps_st/appl] :
Target System COMMON_TOP Directory [/u01/apps/apps_st/comn] :
Target System Instance Home Directory [/u01/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 [dlhs1201:0.0] (y/n) ? : y
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] : 4
Choose a value which will be set as APPLPTMP value on the target node [1] : 3
######### Restart new EBS instance ##########
#### user environment variable file #######
[root@dlhs1201 appcrp02]# vim /home/
appcrp02/.bash_profile
. /u01/apps/apps_st/appl/APPSebsr12_dlhs1201.env
Save and quit
[root@dlhs1201 appcrp02]# vim /home/
oracrp02/.bash_profile
. /u01/db/tech_st/11.1.0/ebsr12_dlhs1201.env
Save and quit
#### Start and Stop script #######
### DB Tier ###
[appcrp02@dlhs1201 ~]$ cat
startappTier.sh
#!/bin/bash
source /home/appcrp02/.bash_profile
$INST_TOP/admin/scripts/adstrtal.sh apps/apps
echo "Wait 120S, It will start successful"
[appcrp02@dlhs1201 ~]$ cat
stopappTier.sh
#!/bin/bash
source /home/appcrp02/.bash_profile
date=`date +%Y%m%d%H%M`
firsttime=1
lasttime=40
$INST_TOP/admin/scripts/adstpall.sh apps/apps
sleep 300s
aaa=12
while [ "$aaa" -ge 2 ]
do
echo "It's running, for a moment."
aaa=`ps -ef | grep FND* | wc -l | awk '{print $1}'`
sleep 60s
if [ $firsttime -lt $lasttime ];then
echo "Wait ten second, It's stopping"
else
break;
fi
let "firsttime++"
done
#Kill process of unfinished
echo "Wait for a moment, It's running kill script"
ps -ef | grep FND* | awk '{print $2}'>/home/appcrp02/FNDpid.txt
for FNDpid in `cat /home/appcrp02/FNDpid.txt`;
do
kill -9 "$FNDpid"
done
echo "It's stopping successful"
sleep 20s
rm -rf /home/appcrp02/FNDpid.txt
echo -e "Yeah \nIt's ok"
### DB Tier ###
[oracrp02@dlhs1201 ~]$ cat
startDBTier.sh
#!/bin/bash
$ORACLE_HOME/appsutil/scripts/ebsr12_ebs36/addlnctl.sh start ebsr12
$ORACLE_HOME/appsutil/scripts/ebsr12_ebs36/addbctl.sh start ebsr12
[oracrp02@dlhs1201 ~]$ cat
stopDBTier.sh
#!/bin/bash
$ORACLE_HOME/appsutil/scripts/ebsr12_ebs36/addbctl.sh stop immediate ebsr12
PSline=12
while [ "$PSline" -ge 2 ]
do
echo "It's running, for a moment."
PSline=`ps -ef | grep ora_ | wc -l | awk '{print $1}'`
sleep 5s
done
$ORACLE_HOME/appsutil/scripts/ebsr12_ebs36/addlnctl.sh stop ebsr12
echo -e "Yeah \nIt's ok"
#### Stop EBS service ####
0. [root@testone u01]# chmod -R 775 /u01/
1. [root@testone 10.1.2]# cd /u01/apps/apps_st/appl/
2. [root@testone appl]# source /home/applcrp/.bash_profile
3. [root@testone crp12bak_testone]# cd /u01/inst/apps/crp12bak_testone/admin/scripts/
4. [root@testone scripts]# sh adstpall.sh apps/apps
5. [oracrp@testone bin]$ su - oracrp
6. [oracrp@testone 11.1.0]$ cd /u01/db/tech_st/11.1.0
7. [oracrp@testone 11.1.0]$ vim /home/oracrp/.bash_profile
. /u01/db/tech_st/11.1.0/crp12bak_testone.env
save and quit
8. [oracrp@testone 11.1.0]$ source /home/oracrp/.bash_profile
9. [oracrp@testone 11.1.0]$ cd /u01/db/tech_st/11.1.0/appsutil/scripts/crp12bak_testone/
10. [oracrp@testone crp12bak_testone]$ sh addlnctl.sh stop crp12bak
11. [oracrp@testone crp12bak_testone]$ sh addlnctl.sh status crp12bak
12. [oracrp@testone crp12bak_testone]$ set ORACLE_SID=crp12bak
13. [oracrp@testone crp12bak_testone]$ echo $ORACLE_SID
14. [oracrp@testone crp12bak_testone]$ sh addbctl.sh stop immediate
#### Start EBS service ####
15. [oracrp@testone crp12bak_testone]$ sh addlnctl.sh start crp12bak
16. [oracrp@testone crp12bak_testone]$ sh addlnctl.sh status crp12bak
17. [oracrp@testone crp12bak_testone]$ sh addbctl.sh start
18. [oracrp@testone crp12bak_testone]$ su - applcrp
19. cd $INST_TOP/admin/scripts/
20. [applcrp@testone scripts]$ sh adstrtal.sh apps/apps
21.