########## Start DB and stop app ##############
1. Stop App Tier
[applcrp@testone scripts]$ cd /u01/inst/apps/crp12bak_testone/admin/scripts
[applcrp@testone scripts]$ sh adstpall.sh apps/apps
2. Start DB Tier
[root@testone u01]# ps -ef | grep ora_
oracrp 13983 1 0 09:07 ? 00:00:00 ora_w000_crp12bak
root 14017 4005 0 09:15 pts/1 00:00:00 grep ora_
oracrp 18327 1 0 Apr15 ? 00:00:00 ora_pmon_crp12bak
oracrp 18329 1 0 Apr15 ? 00:00:00 ora_vktm_crp12bak
oracrp 18335 1 0 Apr15 ? 00:00:00 ora_diag_crp12bak
oracrp 18337 1 0 Apr15 ? 00:00:00 ora_dbrm_crp12bak
oracrp 18339 1 0 Apr15 ? 00:00:00 ora_psp0_crp12bak
oracrp 18341 1 0 Apr15 ? 00:00:20 ora_dia0_crp12bak
########## Prepare source system #############
2. Prepare the Source System
Prepare Database
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 ( $ORACLE_HOME ) 目录。
在终端执行如下命令:
切换到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
解压缩:
unzip -o appsutil.zip
Prepare Application
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)##以后不做这一步了,太浪费时间了(30分钟)
[2.Maintain Applications Files menu] → [4.Maintain snapshot information] → [2.Update current view snapshot] → [ 1.Update Complete APPL_TOP]
3)关闭维护模式
4)退出adadmin。
3. Preclone processing
Adpreclone实行
停止app层
切换到app用户[oracrp12@dlhs1201 crp12_dlhs1201]$ su - appcrp12
切换到相应目录: cd /d01/oracle/PROD/inst/apps/PROD_ebs12/admin/scripts
执行停止app层命令: ./adstpall.sh apps/apps
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
[oracrp@testone crp12bak_testone]$ echo $ORACLE_SID
crp12bak
切换到相应目录: cd /d01/oracle/PROD/db/tech_st/10.2.0/appsutil/scripts/PROD_ebs12
执行停止服务: ./addbctl.sh stop immediate
停止listener:
./addlnctl.sh stop PROD
4. 修改主机名,重启服务器
[root@ebs11i ~]# vim /etc/hosts
[root@ebs11i ~]# vim /etc/sysconfig/network
[root@ebs11i ~]# init 6
4.1 给/tmp目录权限:
[root@ebsdalian ~]# chmod -R 777 /tmp
5. Configure the System
###### Configuration DB Tier ######
1. [root@testone u01]# su - oracrp
2. [oracrp@testone /]$ cd /u01/db/tech_st/11.1.0/appsutil/clone/bin/
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
####### Configuration 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
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 ##########
#### 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