Oracle12c遷移-某風險報告類系統升級暨遷移至12c-3

xfhuangfu發表於2020-02-23

本文我們介紹一下升級暨遷移的其他技術

rman升級的主要步驟

1、在源庫11.2,檢查獲取統計物件的併發收集設定

SQL> select dbms_stats.get_prefs('CONCURRENT') from dual;


DBMS_STATS.GET_PREFS('CONCURRENT')

--------------------------------------------------------------------------------

FALSE

SQL> 

如果併發收集設定部'FALSE',進行如下設定

begin

dbms_stats.set_global_prefs('CONCURRENT','FALSE');

end;

/

2、在源庫執行dbupgdiag.sql收集診斷資訊

cp dbupgdiag.sql $ORACLE_HOME/rdbms/admin

$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production 

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

SQL> @?/rdbms/admin/dbupgdiag.sql

Enter value for 1: /tmp

SQL> @?/rdbms/admin/preupgrd.sql

Results of the checks are located at:

 /u01/app/oracle/cfgtoollogs/CDBXF/preupgrade/preupgrade.log

Pre-Upgrade Fixup Script (run in source database environment):

 /u01/app/oracle/cfgtoollogs/CDBXF/preupgrade/preupgrade_fixups.sql


Post-Upgrade Fixup Script (run shortly after upgrade):

 /u01/app/oracle/cfgtoollogs/CDBXF/preupgrade/postupgrade_fixups.sql

3、在源庫11g執行rman備份,這裡我們採用壓縮備份方式

bakcup_cdbxf.sh

############################################################################

rman target / log=/rmanbak/cdbxf/ cdbxf11gbak_20190629.log <<EOF

run {

ALLOCATE CHANNEL ch01 TYPE disk;

ALLOCATE CHANNEL ch02 TYPE disk;

ALLOCATE CHANNEL ch03 TYPE disk;

ALLOCATE CHANNEL ch04 TYPE disk;

backup as compressed backupset database format '/rmanbak/ cdbxf/db_xf11g_full_%U' plus archivelog format '/rmanbak/cdbxf/db_xf11g_arch_%U';

backup current controlfile format '/rmanbak/cdbxf/db_xf_ctl_%U';

RELEASE CHANNEL ch01;

RELEASE CHANNEL ch02;

RELEASE CHANNEL ch03;

RELEASE CHANNEL ch04;

}

EOF

############################################################################

4、將備份集傳輸到目標伺服器上

由於我們採用異機升級方式所以需要將11g的rman備份集拷貝到12c的伺服器上

$ scp db_xf11g_* oracle@ip:/rmanbak/cdbxf

The authenticity of host '' can't be established.

。。。。

Are you sure you want to continue connecting (yes/no)? yes

。。。。

5、在12c資料庫上建立密碼檔案

$ORACLE_HOME/bin/orapwd file=orapwCDBXFpassword=oracle

6、準備12c的引數檔案

db_name=CDBXF12

*.compatible='12.1.0.0.0'

*.db_block_size=16384

*.db_file_name_convert='+data/cdbrxf','+data/cdbxf12'

*.log_file_name_convert='+data/cdbxf','+data/cdbxf12'

control_files='+data/cdbxf12/control01.ctl'

7、將輔助例項啟動到nomount狀態

$ echo $ORACLE_SID

CDBXF12

$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on

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

Connected to an idle instance.

SYS@ CDBXF >startup nomount pfile='initCDBRXFora';

ORACLE instance started.

SYS@ CDBXF>

8、 在rman下連線到AUXLIARY

$ export ORACLE_SID=CDBRXF

$ rman auxiliary /

Recovery Manager: Release 

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

connected to auxiliary database: 12CXF (not mounted)

RMAN>

9、使用12c rman執行duplicate

RMAN> connect auxiliary /

contents of Memory Script:

{

   sql clone "create spfile from memory";

}

executing Memory Script


sql statement: create spfile from memory


contents of Memory Script:

{

   shutdown clone immediate;

   startup clone nomount;

}

executing Memory Script

。。。。

executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME

10、進行升級

SYS@ CDBXF >alter database open resetlogs upgrade;


$ cd $ORACLE_HOME/rdbms/admin

$ pwd

/u01/12.1.0.1/oracle/product/db_1/rdbms/admin

$ORACLE_HOME/perl/bin/perl catctl.pl -n 4 -l $ORACLE_HOME/diagnostics catupgrd.sql

$ORACLE_HOME/perl/bin/perl catctl.pl -n 4 -l $ORACLE_HOME/diagnostics catupgrd.sql

$ORACLE_HOME/perl/bin/perl catctl.pl -n 4 -l $ORACLE_HOME/diagnostics catupgrd.sql

Analyzing file catupgrd.sql

Log files in /u01/12.1.0.1/oracle/product/db_1/diagnostics

14 scripts found in file catupgrd.sql

Next path: catalog.sql

32 scripts found in file catalog.sql

Next path: catproc.sql

37 scripts found in file catproc.sql

Next path: catptabs.sql

61 scripts found in file catptabs.sql

Next path: catpdbms.sql

205 scripts found in file catpdbms.sql

Next path: catpdeps.sql

77 scripts found in file catpdeps.sql

Next path: catpprvt.sql

260 scripts found in file catpprvt.sql

Next path: catpexec.sql

26 scripts found in file catpexec.sql

Next path: cmpupgrd.sql

16 scripts found in file cmpupgrd.sql


[Phase 0] type is 1 with 1 Files

catupstr.sql     


[Phase 1] type is 1 with 3 Files

cdstrt.sql       cdfixed.sql      cdcore.sql       


[Phase 2] type is 1 with 1 Files

ora_restart.sql  


[Phase 3] type is 2 with 18 Files

cdplsql.sql      cdsqlddl.sql     cdmanage.sql     cdtxnspc.sql 

cdenv.sql        cdrac.sql        cdsec.sql        cdobj.sql 

cdjava.sql       cdpart.sql       cdrep.sql        cdaw.sql 

cdsummgt.sql     cdtools.sql      cdexttab.sql     cddm.sql 

catldr.sql       cdclst.sql       


[Phase 4] type is 1 with 1 Files

ora_restart.sql  

type is 2 with 122 Files

prvtbpui.plb     prvtdput.plb     prvtmeta.plb     prvtmeti.plb 

prvtmetu.plb     prvtmetb.plb     prvtmetd.plb     prvtmet2.plb 

prvtdp.plb       prvtbpc.plb      prvtbpci.plb     prvtbpw.plb 

prvtbpm.plb      prvtbpfi.plb     prvtbpf.plb      prvtbpp.plb 

prvtbpd.plb      prvtbpdi.plb     prvtbpv.plb      prvtbpvi.plb 

prvtdpcr.plb     prvtplts.plb     prvtpitr.plb     prvtreie.plb 

prvtrwee.plb     prvtidxu.plb     prvtrcmp.plb     prvtchnf.plb 

prvtedu.plb      prvtlsby.plb     prvtlsib.plb     prvtlssb.plb 

prvtsmv.plb      prvtsma.plb      prvtbxfr.plb     prvtbord.plb 

prvtjdbb.plb     prvtslrt.plb     prvtslxp.plb     prvtatsk.plb 

prvtmntr.plb     prvtsmgu.plb     prvtdadv.plb     prvtadv.plb 

prvtawr.plb      prvtawrs.plb     prvtawri.plb     prvtash.plb 

prvtawrv.plb     prvtsqlf.plb     prvtsqli.plb     prvtsqlt.plb 

prvtautorepi.plb prvtautorep.plb  prvtfus.plb      prvtmp.plb 

prvthdm.plb      prvtaddm.plb     prvtrtaddm.plb   prvt_awr_data_cp.plb 

prvtcpaddm.plb   prvtuadv.plb     prvtsqlu.plb     prvtspai.plb 

prvtspa.plb      prvtratmask.plb  prvtspmi.plb     prvtspm.plb 

prvtsmbi.plb     prvtsmb.plb      prvtfus.plb      catfusrg.sql 

prvtwrk.plb      prvtsmaa.plb     prvtxpln.plb     prvtstat.plb 

prvtstai.plb     prvtsqld.plb     prvtspcu.plb     prvtodm.plb 

prvtkcl.plb      prvtdst.plb      prvtcmpr.plb     prvtilm.plb 

prvtpexei.plb    prvtpexe.plb     prvtcapi.plb     prvtfuse.plb 

prvtfspi.plb     prvtpspi.plb     prvtdnfs.plb     prvtfs.plb 

prvtadri.plb     prvtadr.plb      prvtadra.plb     prvtadmi.plb 

prvtutils.plb    prvtxsrs.plb     prvtsc.plb       prvtacl.plb 

prvtds.plb       prvtns.plb       prvtdiag.plb     prvtkzrxu.plb 

prvtnacl.plb     prvtredacta.plb  prvtpdb.plb      prvttlog.plb 

prvtsqll.plb     prvtappcont.plb  prvtspd.plb      prvtspdi.plb 

prvtpprof.plb    prvtsqlm.plb     prvtpart.plb     prvtrupg.plb 

prvtrupgis.plb   prvtrupgib.plb   prvtpstdy.plb    prvttsdp.plb 

prvtqopi.plb     prvtlog.plb      


[Phase 34] type is 1 with 1 Files

ora_load_with_comp.sql 


[Phase 35] type is 1 with 1 Files

ora_restart.sql  


[Phase 36] type is 1 with 4 Files

catmetinsert.sql catpcnfg.sql     utluppkg.sql     catdph.sql 



-end-

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28373936/viewspace-2676880/,如需轉載,請註明出處,否則將追究法律責任。

相關文章