DB preclon 操作(源10.181)
su - [安装DB系统时使用的账户]
环境变量的位置是/u01/TST/db/tech_st/11.1.0,执行方法 .
TST_dev.env
cd /u01/PROD/db/tech_st/11.1.0/appsutil/scripts/PROD_db
perl adpreclone.pl dbTier 【执行预克隆】
lsnrctl stop PROD 【关闭监听】
sqlplus / as sysdba 【关闭数据库】
SQL> shutdown immediate;
SQL> exit
复制文件
cd /u01/PROD
scp -r db root@192.168.10.56:/u01/TST
【需要先在10.56下先建好/u01/TST目录】复制数据库
cd /u02/PROD
scp -r apps_st root@192.168.10.56:/u01/TST 复制数据文件。
sqlplus / as sysdba
SQL> startup
SQL> exit
lsnrctl start PROD
启动数据库
DB clon 操作(目标10.56)
su - oratst
cd /u01/
mkdir 【新实例名,如TST】
cd /TST/
mv apps_st/ db
cd /TST/db/tech_st/11.1.0/appsutil/clone/bin
perl adcfgclone.pl dbTier
相关信息如下:
Copyright (c) 2002 Oracle Corporation
Redwood
Shores, California, USA
Oracle
Applications Rapid Clone
Version 12.0.0
adcfgclone Version
120.31.12010000.8
Enter the APPS password :
Running:
/u01/TST/db/tech_st/11.1.0/appsutil/clone/bin/../jre/bin/java
-Xmx600M -cp
/u01/TST/db/tech_st/11.1.0/appsutil/clone/jlib/java:/u01/TST/db/tech_st/11.1.0/appsutil/clone/jlib/xmlparserv2.jar:/u01/TST/db/tech_st/11.1.0/appsutil/clone/jlib/ojdbc5.jar
oracle.apps.ad.context.CloneContext -e
/u01/TST/db/tech_st//../context/db/CTXORIG.xml -validate -pairsfile
/tmp/adpairsfile_22817.lst -stage
/u01/TST/db/tech_st/11.1.0/appsutil/clone 2>
/tmp/adcfgclone_22817.err; echo $? >
/tmp/adcfgclone_22817.res
Log file located at
/u01/TST/db/tech_st/11.1.0/appsutil/clone/bin/CloneContext_0131153230.log
Provide the values required for creation of the new Database
Context file.
Target System Hostname (virtual or normal) [dev]
:
Target Instance is RAC (y/n) [n] :
【是否使用RAC,因为是克隆到测试系统,此处选择No】
Target System Database SID : TST
Target System Base Directory : /u01/TST
Target System utl_file_dir Directory List : /usr/tmp
Number of DATA_TOP's on the Target System [1]
:
Target System DATA_TOP Directory 1 [/u02/PROD/db/apps_st/data]
: /u01/TST/db/apps_st/data
Target System RDBMS ORACLE_HOME Directory
[/u01/TST/db/tech_st/11.1.0] :
Do you want to preserve the Display [db:0.0] (y/n)
: n
Target System Display [dev: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] : 15
Checking the port pool 15
done: Port Pool 15 is free
Report file located at
/u01/TST/db/tech_st/11.1.0/appsutil/temp/portpool.lst
Complete port information available at
/u01/TST/db/tech_st/11.1.0/appsutil/temp/portpool.lst
Creating the new Database Context file from :
/u01/TST/db/tech_st/11.1.0/appsutil/template/adxdbctx.tmp
The new database context file has been created :
/u01/TST/db/tech_st/11.1.0/appsutil/TST_dev.xml
Log file located at
/u01/TST/db/tech_st/11.1.0/appsutil/clone/bin/CloneContext_0131153230.log
Check Clone Context logfile
/u01/TST/db/tech_st/11.1.0/appsutil/clone/bin/CloneContext_0131153230.log
for details.
Running Rapid Clone with command:
perl /u01/TST/db/tech_st/11.1.0/appsutil/clone/bin/adclone.pl
java=/u01/TST/db/tech_st/11.1.0/appsutil/clone/bin/../jre
mode=apply stage=/u01/TST/db/tech_st/11.1.0/appsutil/clone
component=dbTier method=CUSTOM
dbctxtg=/u01/TST/db/tech_st/11.1.0/appsutil/TST_dev.xml
showProgress contextValidated=true
Running:
perl /u01/TST/db/tech_st/11.1.0/appsutil/clone/bin/adclone.pl
java=/u01/TST/db/tech_st/11.1.0/appsutil/clone/bin/../jre
mode=apply stage=/u01/TST/db/tech_st/11.1.0/appsutil/clone
component=dbTier method=CUSTOM
dbctxtg=/u01/TST/db/tech_st/11.1.0/appsutil/TST_dev.xml
showProgress contextValidated=true
APPS Password :
Beginning database tier Apply - Thu Jan 31 15:44:50 2013
/u01/TST/db/tech_st/11.1.0/appsutil/clone/bin/../jre/bin/java
-Xmx600M -DCONTEXT_VALIDATED=true
-Doracle.installer.oui_loc=/u01/TST/db/tech_st/11.1.0/oui
-classpath
/u01/TST/db/tech_st/11.1.0/appsutil/clone/jlib/xmlparserv2.jar:/u01/TST/db/tech_st/11.1.0/appsutil/clone/jlib/ojdbc6.jar:/u01/TST/db/tech_st/11.1.0/appsutil/clone/jlib/java:/u01/TST/db/tech_st/11.1.0/appsutil/clone/jlib/oui/OraInstaller.jar:/u01/TST/db/tech_st/11.1.0/appsutil/clone/jlib/oui/ewt3.jar:/u01/TST/db/tech_st/11.1.0/appsutil/clone/jlib/oui/share.jar:/u01/TST/db/tech_st/11.1.0/appsutil/clone/jlib/oui/srvm.jar:/u01/TST/db/tech_st/11.1.0/appsutil/clone/jlib/ojmisc.jar
oracle.apps.ad.clone.ApplyDBTier -e
/u01/TST/db/tech_st/11.1.0/appsutil/TST_dev.xml -stage
/u01/TST/db/tech_st/11.1.0/appsutil/clone -showProgress
APPS Password : Log file located at
/u01/TST/db/tech_st/11.1.0/appsutil/log/TST_dev/ApplyDBTier_01311544.log
\ 15%
completed
Completed Apply...
Thu Jan 31 15:58:15 2013
Starting database listener for TST:
Running:
/u01/TST/db/tech_st/11.1.0/appsutil/scripts/TST_dev/addlnctl.sh
start TST
Logfile:
/u01/TST/db/tech_st/11.1.0/appsutil/log/TST_dev/addlnctl.txt
You are running addlnctl.sh version 120.1.12010000.4
Starting listener process TST ...
Listener TST has already been started.
addlnctl.sh: exiting with status 0
addlnctl.sh: check the logfile
/u01/TST/db/tech_st/11.1.0/appsutil/log/TST_dev/addlnctl.txt for
more information ...
[oratst@dev bin]$ ps -ef|grep oratst 【检查启动情况】
root 22733 19450
0 15:29 pts/4 00:00:00 su - oratst
oratst 22734 22733 0
15:29 pts/4 00:00:00
-bash
root 23194 23169
0 15:36 pts/5 00:00:00 su - oratst
oratst 23195 23194 0
15:36 pts/5 00:00:00
-bash
oratst 28353 1 0 15:52 ? 00:00:00
/u01/TST/db/tech_st/11.1.0/bin/tnslsnr TST -inherit
oratst 29279 1 0 15:56 ? 00:00:00
ora_pmon_TST
oratst 29283 1 0 15:56 ? 00:00:00
ora_vktm_TST
oratst 29289 1 0 15:56 ? 00:00:00
ora_diag_TST
oratst 29291 1 0 15:56 ? 00:00:00
ora_dbrm_TST
oratst 29293 1 0 15:56 ? 00:00:00
ora_psp0_TST
oratst 29295 1 0 15:56 ? 00:00:00
ora_dia0_TST
oratst 29298 1 0 15:56 ? 00:00:00
ora_mman_TST
oratst 29300 1 0 15:56 ? 00:00:00
ora_dbw0_TST
oratst 29302 1 0 15:56 ? 00:00:00
ora_lgwr_TST
oratst 29304 1 0 15:56 ? 00:00:00
ora_ckpt_TST
oratst 29306 1 0 15:56 ? 00:00:00
ora_smon_TST
oratst 29308 1 0 15:56 ? 00:00:00
ora_reco_TST
oratst 29310 1 0 15:56 ? 00:00:01
ora_mmon_TST
oratst 29312 1 0 15:56 ? 00:00:00
ora_mmnl_TST
oratst 29338 1 0 15:57 ? 00:00:00
ora_fbda_TST
oratst 29342 1 0 15:57 ? 00:00:00
ora_qmnc_TST
oratst 29367 1 0 15:57 ? 00:00:00
ora_cjq0_TST
oratst 29391 1 0 15:57 ? 00:00:00
ora_q000_TST
oratst 29393 1 0 15:57 ? 00:00:00
ora_q001_TST
oratst 29395 1 0 15:57 ? 00:00:00
ora_q002_TST
oratst 30275 22734 0
16:00 pts/4 00:00:00 ps
-ef
oratst 30276 22734 0
16:00 pts/4 00:00:00 grep
oratst
完成克隆后的数据库管理员帐号环境变量在/u01/TST/db/tech_st/11.1.0下,文件名为TST_dev.env
注:如果没有修改过,系统安装完毕后apps帐号的密码默认也是apps。
停止邮件外发服务:
sqlplus / as sysdba
declare
v_job_id number := -1;
begin
--查到要终止的job号
select job into v_job_id
from dba_jobs where what =
'CUX_RCV_DAILY_STAT_PKG.rcv_daily_stat_mail;';
dbms_output.put_line('job_id =
'||v_job_id);--输出job号
dbms_job.remove(v_job_id); --执行终止
commit;
dbms_output.put_line('end '); --输出
end;
/
注意,必须先执行预克隆操作后才能关闭数据库,必须在监听和数据库关闭后才能开始正式克隆(其实就是copy一份)。