一、升級路線
- 10.2.0.5,11.1.0.7,11.2.0.2以上版本可以直接升級到12c。
- 10.2.0.5以前的版本和11.2.0.1版需要先升級到中間版本,再升級到12c。
二、環(huán)境說明
- 操作系統(tǒng):Red Hat 8 Linux 64位
- 源數(shù)據(jù)庫版本:Oracle 11.2.0.3
- 目標數(shù)據(jù)庫版本:Oracle 12.1.0.2
三、升級步驟簡述
- 備份源數(shù)據(jù)庫(RMan)
- 執(zhí)行Pre-Upgrade Information Tool(preupgrd.sql)
- 準備新版本的Oracle Home
- 關閉數(shù)據(jù)庫實例
- 使用12c啟動數(shù)據(jù)庫,進入升級模式
- 執(zhí)行并行升級實用程序(catctl.pl)
- 執(zhí)行Post-Upgrade Status Tool(utlu121s.sql)
- 執(zhí)行附加腳本(catuppst.sql和utlrp.sql)
- 完成升級階段
四、升級步驟
4.1、備份數(shù)據(jù)庫
4.2、執(zhí)行Pre-Upgrade Information Tool
4.2.1、運行預升級工具腳本
使用目標版本數(shù)據(jù)庫(Oracle 12C)目錄/u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/下的preupgrd.sql腳本。在源數(shù)據(jù)庫的SQL*Plus內(nèi)執(zhí)行。
1 sqlplus /nolog 2 3 SQL*Plus: Release 11.2.0.3.0 Production on Thu Sep 14 15:43:31 2023 4 5 Copyright (c) 1982, 2011, Oracle. All rights reserved. 6 7 SQL> conn / as sysdba 8 Connected. 9 SQL> @/u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/preupgrd.sql
此工具是用來分析源數(shù)據(jù)庫存在的問題,并生成用來生成解決問題的腳本。
Loading Pre-Upgrade Package... *************************************************************************** Executing Pre-Upgrade Checks in RCAT... *************************************************************************** ************************************************************ ====>> ERRORS FOUND for RCAT <<==== The following are *** ERROR LEVEL CONDITIONS *** that must be addressed prior to attempting your upgrade. Failure to do so will result in a failed upgrade. 1) Check Tag: PURGE_RECYCLEBIN Check Summary: Check that recycle bin is empty prior to upgrade Fixup Summary: "The recycle bin will be purged." You MUST resolve the above error prior to upgrade ************************************************************ ************************************************************ ====>> PRE-UPGRADE RESULTS for RCAT <<==== ACTIONS REQUIRED: 1. Review results of the pre-upgrade checks: /u01/app/oracle/cfgtoollogs/rcat/preupgrade/preupgrade.log 2. Execute in the SOURCE environment BEFORE upgrade: /u01/app/oracle/cfgtoollogs/rcat/preupgrade/preupgrade_fixups.sql 3. Execute in the NEW environment AFTER upgrade: /u01/app/oracle/cfgtoollogs/rcat/preupgrade/postupgrade_fixups.sql ************************************************************ *************************************************************************** Pre-Upgrade Checks in RCAT Completed. *************************************************************************** *************************************************************************** ***************************************************************************
以上結果提示,必須先清空源數(shù)據(jù)的回收站。
建議關注預升級檢查記錄:/u01/app/oracle/cfgtoollogs/rcat/preupgrade/preupgrade.log。
4.2.2、升級前腳本
升級前在源環(huán)境運行升級前修復腳本:/u01/app/oracle/cfgtoollogs/rcat/preupgrade/preupgrade_fixups.sql,此腳本用來修復在源數(shù)據(jù)發(fā)現(xiàn)的問題。
1 SQL> @/u01/app/oracle/cfgtoollogs/rcat/preupgrade/preupgrade_fixups.sql
Pre-Upgrade Fixup Script Generated on 2023-09-14 15:51:38 Version: 12.1.0.2 Build: 006 Beginning Pre-Upgrade Fixups... Executing in container RCAT ********************************************************************** Check Tag: EM_PRESENT Check Summary: Check if Enterprise Manager is present Fix Summary: Execute emremove.sql prior to upgrade. ********************************************************************** Fixup Returned Information: WARNING: --> Enterprise Manager Database Control repository found in the database In Oracle Database 12c, Database Control is removed during the upgrade. To save time during the Upgrade, this action can be done prior to upgrading using the following steps after copying rdbms/admin/emremove.sql from the new Oracle home - Stop EM Database Control: $> emctl stop dbconsole - Connect to the Database using the SYS account AS SYSDBA: SET ECHO ON; SET SERVEROUTPUT ON; @emremove.sql Without the set echo and serveroutput commands you will not be able to follow the progress of the script. ********************************************************************** ********************************************************************** Check Tag: AMD_EXISTS Check Summary: Check to see if AMD is present in the database Fix Summary: Manually execute ORACLE_HOME/oraolap/admin/catnoamd.sql script to remove OLAP. ********************************************************************** Fixup Returned Information: INFORMATION: --> OLAP Catalog(AMD) exists in database Starting with Oracle Database 12c, OLAP Catalog component is desupported. If you are not using the OLAP Catalog component and want to remove it, then execute the ORACLE_HOME/olap/admin/catnoamd.sql script before or after the upgrade. ********************************************************************** ********************************************************************** Check Tag: PURGE_RECYCLEBIN Check Summary: Check that recycle bin is empty prior to upgrade Fix Summary: The recycle bin will be purged. ********************************************************************** Fixup Succeeded ********************************************************************** ********************************************************************** Check Tag: APEX_UPGRADE_MSG Check Summary: Check that APEX will need to be upgraded. Fix Summary: Oracle Application Express can be manually upgraded prior to database upgrade. ********************************************************************** Fixup Returned Information: INFORMATION: --> Oracle Application Express (APEX) can be manually upgraded prior to database upgrade APEX is currently at version 3.2.1.00.10 and will need to be upgraded to APEX version 4.2.5 in the new release. Note 1: To reduce database upgrade time, APEX can be manually upgraded outside of and prior to database upgrade. Note 2: See MOS Note 1088970.1 for information on APEX installation upgrades. ********************************************************************** ********************************************************************** [Pre-Upgrade Recommendations] ********************************************************************** ***************************************** ********* Dictionary Statistics ********* ***************************************** Please gather dictionary statistics 24 hours prior to upgrading the database. To gather dictionary statistics execute the following command while connected as SYSDBA: EXECUTE dbms_stats.gather_dictionary_stats; ^^^ MANUAL ACTION SUGGESTED ^^^ ************************************************** ************* Fixup Summary ************ 1 fixup routine was successful. 3 fixup routines returned INFORMATIONAL text that should be reviewed. **************** Pre-Upgrade Fixup Script Complete *********************
提出的建議如下:
- 發(fā)現(xiàn)了Enterprise Manager,在升級過程中會刪除EM庫,為了減少升級時間,可以先刪除。已自動處理。
-
發(fā)現(xiàn)了OLAP Catalog組件,在12C中不再支持OLAP Catalog組件,可以在升級前或升級后使用catnoamd.sql腳本刪除,這里就不刪除了,升級后再說。
- 回收站是空的,不需要處理。如果回收站不是空的,將自動清空回收站。
-
發(fā)現(xiàn)了APEX,APEX版本升級會占用比較多的時間,oracle建議可以手工升級,參考: 1088970.1,這里也不管了,一起升級。
- 建議在數(shù)據(jù)庫升級的24小時之前執(zhí)行EXECUTE dbms_stats.gather_dictionary_stats;,收集數(shù)據(jù)字典統(tǒng)計信息。
1 SQL> EXECUTE dbms_stats.gather_dictionary_stats;
?4.2.3、升級后腳本
升級后在新環(huán)境運行升級后修復腳本:/u01/app/oracle/cfgtoollogs/rcat/preupgrade/postupgrade_fixups.sql,此腳本用來修復數(shù)據(jù)庫升級后的問題。
4.3、準備12c Oracle Home
編輯/etc/oratab文件,將RCAT的環(huán)境變量指向Oracle 12C的Oracle Home。
1 [oracle@orasrv admin]$ vim /etc/oratab
rcat:/u01/app/oracle/product/12.1.0/dbhome_1:Y
4.4、關閉數(shù)據(jù)庫實例
1 SQL> shutdown immediate
4.5、使用12c啟動數(shù)據(jù)庫,進入升級模式
1 SQL*Plus: Release 12.1.0.2.0 Production on Thu Sep 14 16:36:59 2023 2 3 Copyright (c) 1982, 2014, Oracle. All rights reserved. 4 5 SQL> conn / as sysdba 6 Connected to an idle instance. 7 SQL> startup upgrade 8 ORA-01078: failure in processing system parameters 9 LRM-00109: could not open parameter file '/u01/app/oracle/product/12.1.0/dbhome_1/dbs/initrcat.ora'
以上提示說明需要參數(shù)文件initrcat.ora,我們將11g數(shù)據(jù)庫的參數(shù)文件復制到12c的相應目錄
1 [oracle@orasrv ~]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilercat.ora /u01/app/oracle/product/12.1.0/dbhome_1/dbs/
再次啟動
1 SQL> startup upgrade
4.6、執(zhí)行并行升級實用程序
1 SQL> @/u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/catupgrd.sql
DOC>###################################################################### DOC>###################################################################### DOC> NOTE DOC> DOC> The catupgrd.sql is being deprecated in the 12.1 release of the DOC> Oracle Database. Customers are encouraged to use catctl.pl as DOC> the replacement for catupgrd.sql when upgrading the database dictionary. DOC> DOC> cd $ORACLE_HOME/rdbms/admin DOC> $ORACLE_HOME/perl/bin/perl catctl.pl -n 4 catupgrd.sql DOC> DOC> Refer to the Oracle Database Upgrade Guide for more information. DOC> DOC> This database upgrade procedure must be called with the following DOC> argument when invoking from the SQL prompt: DOC> DOC> @catupgrd.sql PARALLEL=NO DOC> DOC>###################################################################### DOC>###################################################################### DOC># old 2: WHERE UPPER('&&1') = 'PARALLEL=NO' OR new 2: WHERE UPPER('') = 'PARALLEL=NO' OR old 3: UPPER('&&1') = 'PARALLEL=YES' new 3: UPPER('') = 'PARALLEL=YES' SELECT (to_number(count(*)))/(to_number(count(*))) FROM DUAL * ERROR at line 1: ORA-01476: divisor is equal to zero
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
在12c中,使用升級腳本catctl.pl代替了catupgrd.sql,升級腳本的執(zhí)行方式也發(fā)生了變化。根據(jù)以上提示可知,在Linux環(huán)境下需按以下方式執(zhí)行:?
[oracle@orasrv ~]$ cd $ORACLE_HOME/rdbms/admin [oracle@orasrv admin]$ $ORACLE_HOME/perl/bin/perl catctl.pl -n 2 catupgrd.sql
?-n后參數(shù)2代表并行度為2,可按CPU核數(shù)進行設置。接下來就進入到漫長的升級過程:?
Argument list for [catctl.pl] SQL Process Count n = 2 SQL PDB Process Count N = 0 Input Directory d = 0 Phase Logging Table t = 0 Log Dir l = 0 Script s = 0 Serial Run S = 0 Upgrade Mode active M = 0 Start Phase p = 0 End Phase P = 0 Log Id i = 0 Run in c = 0 Do not run in C = 0 Echo OFF e = 1 No Post Upgrade x = 0 Reverse Order r = 0 Open Mode Normal o = 0 Debug catcon.pm z = 0 Debug catctl.pl Z = 0 Display Phases y = 0 Child Process I = 0 catctl.pl version: 12.1.0.2.0 Oracle Base = /u01/app/oracle Analyzing file catupgrd.sql Log files in /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin catcon: ALL catcon-related output will be written to catupgrd_catcon_4741.lst catcon: See catupgrd*.log files for output generated by scripts catcon: See catupgrd_*.lst files for spool files, if any Number of Cpus = 2 SQL Process Count = 2 ------------------------------------------------------ Phases [0-73] Serial Phase #: 0 Files: 1 Time: 99s Serial Phase #: 1 Files: 5 Time: 23s Restart Phase #: 2 Files: 1 Time: 0s Parallel Phase #: 3 Files: 18 Time: 27s Restart Phase #: 4 Files: 1 Time: 0s Serial Phase #: 5 Files: 5 Time: 32s Serial Phase #: 6 Files: 1 Time: 26s Serial Phase #: 7 Files: 4 Time: 5s Restart Phase #: 8 Files: 1 Time: 0s Parallel Phase #: 9 Files: 62 Time: 63s Restart Phase #:10 Files: 1 Time: 0s Serial Phase #:11 Files: 1 Time: 43s Restart Phase #:12 Files: 1 Time: 0s Parallel Phase #:13 Files: 91 Time: 49s Restart Phase #:14 Files: 1 Time: 0s Parallel Phase #:15 Files: 111 Time: 64s Restart Phase #:16 Files: 1 Time: 0s Serial Phase #:17 Files: 3 Time: 40s Restart Phase #:18 Files: 1 Time: 0s Parallel Phase #:19 Files: 32 Time: 56s Restart Phase #:20 Files: 1 Time: 0s Serial Phase #:21 Files: 3 Time: 43s Restart Phase #:22 Files: 1 Time: 0s Parallel Phase #:23 Files: 23 Time: 105s Restart Phase #:24 Files: 1 Time: 0s Parallel Phase #:25 Files: 11 Time: 71s Restart Phase #:26 Files: 1 Time: 0s Serial Phase #:27 Files: 1 Time: 20s Restart Phase #:28 Files: 1 Time: 0s Serial Phase #:30 Files: 1 Time: 0s Serial Phase #:31 Files: 257 Time: 51s Serial Phase #:32 Files: 1 Time: 0s Restart Phase #:33 Files: 1 Time: 0s Serial Phase #:34 Files: 1 Time: 43s Restart Phase #:35 Files: 1 Time: 0s Restart Phase #:36 Files: 1 Time: 17s Serial Phase #:37 Files: 4 Time: 74s Restart Phase #:38 Files: 1 Time: 0s Parallel Phase #:39 Files: 13 Time: 55s Restart Phase #:40 Files: 1 Time: 0s Parallel Phase #:41 Files: 10 Time: 46s Restart Phase #:42 Files: 1 Time: 0s Serial Phase #:43 Files: 1 Time: 44s Restart Phase #:44 Files: 1 Time: 0s Serial Phase #:45 Files: 1 Time: 38s Serial Phase #:46 Files: 1 Time: 0s Restart Phase #:47 Files: 1 Time: 0s Serial Phase #:48 Files: 1 Time: 115s Restart Phase #:49 Files: 1 Time: 0s Serial Phase #:50 Files: 1 Time: 69s Restart Phase #:51 Files: 1 Time: 0s Serial Phase #:52 Files: 1 Time: 51s Restart Phase #:53 Files: 1 Time: 0s Serial Phase #:54 Files: 1 Time: 147s Restart Phase #:55 Files: 1 Time: 0s Serial Phase #:56 Files: 1 Time: 81s Restart Phase #:57 Files: 1 Time: 0s Serial Phase #:58 Files: 1 Time: 124s Restart Phase #:59 Files: 1 Time: 0s Serial Phase #:60 Files: 1 Time: 200s Restart Phase #:61 Files: 1 Time: 0s Serial Phase #:62 Files: 1 Time: 1016s Restart Phase #:63 Files: 1 Time: 0s Serial Phase #:64 Files: 1 Time: 32s Serial Phase #:65 Files: 1 Calling sqlpatch with LD_LIBRARY_PATH=/u01/app/oracle/product/12.1.0/dbhome_1/lib; export LD_LIBRARY_PATH;/u01/app/oracle/product/12.1.0/dbhome_1/perl/bin/perl -I /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin -I /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/../../sqlpatch /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/../../sqlpatch/sqlpatch.pl -verbose -upgrade_mode_only > catupgrd_datapatch_upgrade.log 2> catupgrd_datapatch_upgrade.err returned from sqlpatch Time: 75s Serial Phase #:66 Files: 1 Time: 36s Serial Phase #:68 Files: 1 Time: 0s Serial Phase #:69 Files: 1 Calling sqlpatch with LD_LIBRARY_PATH=/u01/app/oracle/product/12.1.0/dbhome_1/lib; export LD_LIBRARY_PATH;/u01/app/oracle/product/12.1.0/dbhome_1/perl/bin/perl -I /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin -I /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/../../sqlpatch /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/../../sqlpatch/sqlpatch.pl -verbose > catupgrd_datapatch_normal.log 2> catupgrd_datapatch_normal.err returned from sqlpatch Time: 259s Serial Phase #:70 Files: 1 Time: 149s Serial Phase #:71 Files: 1 Time: 0s Serial Phase #:72 Files: 1 Time: 0s Serial Phase #:73 Files: 1 Time: 90s Grand Total Time: 3586s LOG FILES: (catupgrd*.log) Upgrade Summary Report Located in: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/rcat/upgrade/upg_summary.log Grand Total Upgrade Time: [0d:0h:59m:46s]
升級完成后,數(shù)據(jù)庫實例自動關閉,需要重新啟動數(shù)據(jù)庫到open狀態(tài)
SQL> startup
繼續(xù)執(zhí)行4.2.3所述升級后修復腳本
1 SQL> @/u01/app/oracle/cfgtoollogs/rcat/preupgrade/postupgrade_fixups.sql?
Post Upgrade Fixup Script Generated on 2023-09-14 15:51:38 Version: 12.1.0.2 Build: 006 Beginning Post-Upgrade Fixups... ********************************************************************** Check Tag: OLD_TIME_ZONES_EXIST Check Summary: Check for use of older timezone data file Fix Summary: Update the timezone using the DBMS_DST package after upgrade is complete. ********************************************************************** Fixup Returned Information: INFORMATION: --> Older Timezone in use Database is using a time zone file older than version 18. After the upgrade, it is recommended that DBMS_DST package be used to upgrade the 12.1.0.2.0 database time zone version to the latest version which comes with the new release. Please refer to My Oracle Support note number 977512.1 for details. ********************************************************************** ********************************************************************** Check Tag: NOT_UPG_BY_STD_UPGRD Check Summary: Identify existing components that will NOT be upgraded Fix Summary: This fixup does not perform any action. ********************************************************************** Fixup Returned Information: This fixup does not perform any action. If you want to upgrade those other components, you must do so manually. ********************************************************************** ********************************************************************** [Post-Upgrade Recommendations] ********************************************************************** ***************************************** ******** Fixed Object Statistics ******** ***************************************** Please create stats on fixed objects two weeks after the upgrade using the command: EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS; ^^^ MANUAL ACTION SUGGESTED ^^^ ************************************************** ************* Fixup Summary ************ 2 fixup routines generated INFORMATIONAL messages that should be reviewed. *************** Post Upgrade Fixup Script Complete ******************** PL/SQL procedure successfully completed.
提出的建議如下:
- 使用舊的Timezone文件版本,數(shù)據(jù)庫升級完成后進行Timezone版本升級。
- 確認沒有升級的現(xiàn)有組件,忽略。
- 在數(shù)據(jù)庫升級后的兩周內(nèi)運行EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;收集對象的統(tǒng)計信息。
1 SQL> EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
4.7、執(zhí)行Post-Upgrade Status Tool
升級完成后可以執(zhí)行Post-Upgrade Status Tool($ORACLE_HOME/rdbms/admin/utlu121s.sql),查看升級的概況信息。
1 SQL> @?/rdbms/admin/utlu121s.sql
Oracle Database 12.1 Post-Upgrade Status Tool 09-15-2023 10:47:44 Component Current Version Elapsed Time Name Status Number HH:MM:SS Oracle Server UPGRADED 12.1.0.2.0 00:18:54 JServer JAVA Virtual Machine VALID 12.1.0.2.0 00:01:34 Oracle Workspace Manager VALID 12.1.0.2.0 00:00:52 OLAP Analytic Workspace VALID 12.1.0.2.0 00:00:30 OLAP Catalog OPTION OFF 11.2.0.3.0 00:00:00 Oracle OLAP API VALID 12.1.0.2.0 00:00:11 Oracle XDK VALID 12.1.0.2.0 00:00:48 Oracle Text VALID 12.1.0.2.0 00:00:54 Oracle XML Database VALID 12.1.0.2.0 00:01:12 Oracle Database Java Packages VALID 12.1.0.2.0 00:00:08 Oracle Multimedia VALID 12.1.0.2.0 00:01:45 Spatial UPGRADED 12.1.0.2.0 00:03:02 Oracle Application Express VALID 4.2.5.00.08 00:15:53 Final Actions 00:01:56 Post Upgrade 00:02:20
除了OLAP Catalog組件外,其它組件都升級到希望的版本。
因不再被12c支持,可以移除OLAP Catalog組件。
1 SQL> @?/olap/admin/catnoamd.sql
4.8、執(zhí)行附加腳本
執(zhí)行catuppst.sql腳本完成接下來的升級操作,它不要求數(shù)據(jù)庫處于升級模式。
1 SQL> @?/rdbms/admin/catuppst.sql
執(zhí)行utlrp.sql腳本重新編譯PL/SQL和Java代碼。
1 SQL> @?/rdbms/admin/utlrp.sql
等待執(zhí)行完成。
4.9、完成升級階段
4.9.1、檢查環(huán)境變量
- ORACLE_BASE
- ORACLE_HOME
- PATH,LD_LIBRARY_PATH and SHLIB_PATH
- 更新oratab文件
4.9.2、檢查初始化參數(shù)文件
確認初始化參數(shù)修改正確。
4.9.3、檢查口令文件
可以使用orapwd命令重建口令文件。
4.9.4、COMPATIBLE參數(shù)
COMPATIBLE參數(shù)控制數(shù)據(jù)庫兼容性級別,如果數(shù)據(jù)庫不會再降級到以前的版本,可以設置此參數(shù)。
1 SQL> alter system set compatible='12.1.0.2.0' scope=spfile;
重啟數(shù)據(jù)庫實例。
4.9.5、升級TIMEZONE文件版本
?查看數(shù)據(jù)庫當前timezone 版本:
1 SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
2 FROM DATABASE_PROPERTIES 3 WHERE PROPERTY_NAME LIKE 'DST_%' 4 ORDER BY PROPERTY_NAME; 5 PROPERTY_NAME VALUE 6 --------------------------- --------------------------- 7 DST_PRIMARY_TT_VERSION 11
8 DST_SECONDARY_TT_VERSION 0 9 DST_UPGRADE_STATE NONE
1 SQL> SELECT version FROM v$timezone_file; 2 3 VERSION 4 ---------- 5 11
注意:11.2.0.1.0的timezone最高支持到11,在12.1.0.2中最高支持到18。
準備升級timezone到18
1 SQL> set serveroutput on 2 SQL> exec DBMS_DST.BEGIN_PREPARE(18);
?查看升級準備信息
1 SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value 2 2 FROM DATABASE_PROPERTIES 3 3 WHERE PROPERTY_NAME LIKE 'DST_%' 4 4 ORDER BY PROPERTY_NAME; 5 6 PROPERTY_NAME VALUE 7 ----------------------------- -------------------------- 8 DST_PRIMARY_TT_VERSION 11 9 DST_SECONDARY_TT_VERSION 18 10 DST_UPGRADE_STATE PREPARE
準備升級工作
1 SQL> BEGIN 2 2 DBMS_DST.FIND_AFFECTED_TABLES 3 3 (affected_tables => 'sys.dst$affected_tables', 4 4 log_errors => TRUE, 5 5 log_errors_table => 'sys.dst$error_table'); 6 6 END; 7 7 / 8 9 PL/SQL procedure successfully completed. 10 11 SQL> TRUNCATE TABLE SYS.DST$TRIGGER_TABLE; 12 13 Table truncated. 14 15 SQL> TRUNCATE TABLE sys.dst$affected_tables; 16 17 Table truncated. 18 19 SQL> TRUNCATE TABLE sys.dst$error_table; 20 21 Table truncated.
結束升級準備
1 SQL> EXEC DBMS_DST.END_PREPARE; 2 3 PL/SQL procedure successfully completed.
升級過程
1 SQL> shutdown immediate; 2 Database closed. 3 Database dismounted. 4 ORACLE instance shut down. 5 6 SQL> startup upgrade; 7 ORACLE instance started. 8 9 Total System Global Area 1610612736 bytes 10 Fixed Size 2924928 bytes 11 Variable Size 671092352 bytes 12 Database Buffers 922746880 bytes 13 Redo Buffers 13848576 bytes 14 Database mounted. 15 Database opened. 16 17 SQL> set serveroutput on 18 SQL> purge dba_recyclebin; 19 20 DBA Recyclebin purged. 21 22 SQL> alter session set "_with_subquery"=materialize; 23 24 Session altered. 25 26 SQL> EXEC DBMS_DST.BEGIN_UPGRADE(18); 27 An upgrade window has been successfully started. 28 29 PL/SQL procedure successfully completed. 30 31 SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value 32 2 FROM DATABASE_PROPERTIES 33 3 WHERE PROPERTY_NAME LIKE 'DST_%' 34 4 ORDER BY PROPERTY_NAME; 35 36 PROPERTY_NAME VALUE 37 -------------------------------------- -------------------------------------- 38 DST_PRIMARY_TT_VERSION 18 39 DST_SECONDARY_TT_VERSION 11 40 DST_UPGRADE_STATE UPGRADE
1 SQL> shutdown immediate; 2 Database closed. 3 Database dismounted. 4 ORACLE instance shut down. 5 SQL> 6 SQL> startup 7 ORACLE instance started. 8 9 Total System Global Area 1610612736 bytes 10 Fixed Size 2924928 bytes 11 Variable Size 671092352 bytes 12 Database Buffers 922746880 bytes 13 Redo Buffers 13848576 bytes 14 Database mounted. 15 Database opened. 16 SQL> alter session set "_with_subquery"=materialize; 17 18 Session altered. 19 執(zhí)行timezone升級過程: 20 SQL> set serveroutput on 21 SQL> VAR numfail number 22 SQL> BEGIN 23 2 DBMS_DST.UPGRADE_DATABASE(:numfail, 24 3 parallel => TRUE, 25 4 log_errors => TRUE, 26 5 log_errors_table => 'SYS.DST$ERROR_TABLE', 27 6 log_triggers_table => 'SYS.DST$TRIGGER_TABLE', 28 7 error_on_overlap_time => FALSE, 29 8 error_on_nonexisting_time => FALSE); 30 9 DBMS_OUTPUT.PUT_LINE('Failures:'|| :numfail); 31 10 END; 32 11 / 33 Table list: "IX"."AQ$_STREAMS_QUEUE_TABLE_S" 34 Number of failures: 0 35 Table list: "IX"."AQ$_STREAMS_QUEUE_TABLE_L" 36 Number of failures: 0 37 Table list: "IX"."AQ$_ORDERS_QUEUETABLE_S" 38 Number of failures: 0 39 Table list: "IX"."AQ$_ORDERS_QUEUETABLE_L" 40 Number of failures: 0 41 Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_S" 42 Number of failures: 0 43 Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_L" 44 Number of failures: 0 45 Table list: "APEX_040200"."WWV_FLOW_WORKSHEET_NOTIFY" 46 Number of failures: 0 47 Table list: "APEX_040200"."WWV_FLOW_FEEDBACK_FOLLOWUP" 48 Number of failures: 0 49 Table list: "APEX_040200"."WWV_FLOW_FEEDBACK" 50 Number of failures: 0 51 Table list: "APEX_040200"."WWV_FLOW_DEBUG_MESSAGES2" 52 Number of failures: 0 53 Table list: "APEX_040200"."WWV_FLOW_DEBUG_MESSAGES" 54 Number of failures: 0 55 Failures:0 56 57 PL/SQL procedure successfully completed. 58 結束升級,校驗升級信息: 59 SQL> VAR fail number 60 SQL> BEGIN 61 2 DBMS_DST.END_UPGRADE(:fail); 62 3 DBMS_OUTPUT.PUT_LINE('Failures:'|| :fail); 63 4 END; 64 5 / 65 An upgrade window has been successfully ended. 66 Failures:0 67 68 PL/SQL procedure successfully completed.
確認升級成功
1 SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value 2 2 FROM DATABASE_PROPERTIES 3 3 WHERE PROPERTY_NAME LIKE 'DST_%' 4 4 ORDER BY PROPERTY_NAME; 5 6 PROPERTY_NAME VALUE 7 ------------------------- ---------------------------- 8 DST_PRIMARY_TT_VERSION 18 9 DST_SECONDARY_TT_VERSION 0 10 DST_UPGRADE_STATE NONE
1 SQL> SELECT * FROM v$timezone_file; 2 3 FILENAME VERSION CON_ID 4 -------------------- ---------- ---------- 5 timezlrg_18.dat 18 0
?4.9.6、升級RMAN Recovery Catalog
如果當前庫上有RMAN Catalog,可以使用UPGRADE CATALOG進行升級。
參考:https://docs.oracle.com/database/121/BRADV/rcmcatdb.htm#BRADV188
4.9.7、為Oracle XML DB配置FTP和HTTP端口以及HTTP身份驗證
Oracle Database 12c DBCA不為Oracle XML DB配置端口,因此您必須手動配置它們。您還應該為HTTP配置摘要身份驗證,以利用改進的安全功能。文章來源:http://www.zghlxwxcb.cn/news/detail-709784.html
4.9.8、啟用Database Vault
Register Database Vault by using the DVSYS.DBMS_MACADM.ENABLE_DV procedure.文章來源地址http://www.zghlxwxcb.cn/news/detail-709784.html
4.9.9、打開統(tǒng)一審計
4.9.10、重新注冊到云控制臺
到了這里,關于手工升級到Oracle 12C的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!