千家信息网

Oracle12c迁移-某风险报告类系统升级暨迁移至12c-3

发表于:2025-01-20 作者:千家信息网编辑
千家信息网最后更新 2025年01月20日,本文我们介绍一下升级暨迁移的其他技术rman升级的主要步骤1、在源库11.2,检查获取统计对象的并发收集设置SQL> select dbms_stats.get_prefs('CONCURRENT')
千家信息网最后更新 2025年01月20日Oracle12c迁移-某风险报告类系统升级暨迁移至12c-3

本文我们介绍一下升级暨迁移的其他技术

rman升级的主要步骤

1、在源库11.2,检查获取统计对象的并发收集设置

SQL> select dbms_stats.get_prefs('CONCURRENT') from dual;DBMS_STATS.GET_PREFS('CONCURRENT')--------------------------------------------------------------------------------FALSESQL>

如果并发收集设置部'FALSE',进行如下设置

begindbms_stats.set_global_prefs('CONCURRENT','FALSE');end;/

2、在源库执行dbupgdiag.sql收集诊断信息

cp dbupgdiag.sql $ORACLE_HOME/rdbms/admin

$ sqlplus / as sysdbaSQL*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 ProductionWith the Partitioning, Automatic Storage Management, OLAP, Data Miningand Real Application Testing optionsSQL> @?/rdbms/admin/dbupgdiag.sqlEnter value for 1: /tmpSQL> @?/rdbms/admin/preupgrd.sqlResults of the checks are located at: /u01/app/oracle/cfgtoollogs/CDBXF/preupgrade/preupgrade.logPre-Upgrade Fixup Script (run in source database environment): /u01/app/oracle/cfgtoollogs/CDBXF/preupgrade/preupgrade_fixups.sqlPost-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 <

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

4、将备份集传输到目标服务器上

由于我们采用异机升级方式所以需要将11g的rman备份集拷贝到12c的服务器上

$ scp db_xf11g_* oracle@ip:/rmanbak/cdbxfThe 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 sysdbaSQL*Plus: Release 12.1.0.1.0 Production onCopyright (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 Scriptsql statement: create spfile from memorycontents of Memory Script:{   shutdown clone immediate;   startup clone nomount;}executing Memory Script。。。。executing command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting 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.sqlAnalyzing file catupgrd.sqlLog files in /u01/12.1.0.1/oracle/product/db_1/diagnostics14 scripts found in file catupgrd.sqlNext path: catalog.sql32 scripts found in file catalog.sqlNext path: catproc.sql37 scripts found in file catproc.sqlNext path: catptabs.sql61 scripts found in file catptabs.sqlNext path: catpdbms.sql205 scripts found in file catpdbms.sqlNext path: catpdeps.sql77 scripts found in file catpdeps.sqlNext path: catpprvt.sql260 scripts found in file catpprvt.sqlNext path: catpexec.sql26 scripts found in file catpexec.sqlNext path: cmpupgrd.sql16 scripts found in file cmpupgrd.sql[Phase 0] type is 1 with 1 Filescatupstr.sql     [Phase 1] type is 1 with 3 Filescdstrt.sql       cdfixed.sql      cdcore.sql       [Phase 2] type is 1 with 1 Filesora_restart.sql  [Phase 3] type is 2 with 18 Filescdplsql.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 Filesora_restart.sql  type is 2 with 122 Filesprvtbpui.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 Filesora_load_with_comp.sql [Phase 35] type is 1 with 1 Filesora_restart.sql  [Phase 36] type is 1 with 4 Filescatmetinsert.sql catpcnfg.sql     utluppkg.sql     catdph.sql

-end-

0