前言:
Autoupgrade是Oracle 推出的自动升级工具,通过该工具可以将数据库升级为Oracle12.2之后的版本,工具支持升级前的检查、升级问题修复、一键式自动升级以及升级后的问题修复,极大的简化数据库的升级步骤。
支持的目标升级版本:
-
Oracle Database 21c (21.3 and newer)
-
Oracle Database 19c (19.3 and newer)
-
Oracle Database 18c (18.5 and newer)
-
Oracle Database 12c Release 2 (12.2 + DBJAN2019RU and newer
支持的源端升级版本:
只要源端版本可以直接升级到支持的目标版本,都可以使用该工具进行
具体可以参考Oracle mos: Database Server Upgrade/Downgrade Compatibility Matrix (Doc ID 551141.1)
Autoupgrade步骤:
SETUP: AutoUpgrade程序作业管理器创建的初始阶段,每个启动作业的准备工作。
PREUPGRADE: AutoUpgrade根据当前系统配置对系统进行检查的阶段,以确定它是否准备好进行升级,例如检查是否有足够的可用磁盘空间。
PRECHECKS:AutoUpgrade分析源Oracle主数据库以确定数据库是否满足升级要求的阶段。
PREFIXUPS:在开始升级之前,修复更新前检查发现的问题。例如,对源端收集字典统计信息。
guaranteed restore point (GRP):AutoUpgrade在开始升级过程之前创建恢复点,在失败时候进行回滚。此选项仅适用于Oracle数据库企业版版本,在Oracle数据库标准版中不可用。即使创建了闪回点,但Oracle强烈建议在开始升级之前执行全数据量备份。
DRAIN: 关闭数据库阶段,例如:RAC数据库会关闭集群参数,启动单节点迁移模式
DBUPGRADE: 在此阶段执行升级,并编译升级完成后发现的任何无效对象。
POSTCHECKS:在升级后修复之前,在目标Oracle主数据库(升级后的Oracle数据库)上执行更新后检查的阶段。
POSTFIXUPS: 修复更新后检查发现的问题,例如升级时区。
POSTUPGRADE: 复制或者合并源端的配置文件(tnsnames.ora, sqlnet.ora, and other files) 到目标端的ORACLE_HOME
Autoupgrade模式:
analyze模式:
检查当前数据库是否具备升级条件,当前模式只会读取数据库的信息,不会对数据库有任何的操作,不影响应用,包括setup+prechecks
fixups模式:
会执行跟analyze一样的检查升级条件,并修复不满足的升级条件,会对数据库进行操作,包括setup+prechecks+prefixups
deploy模式
对数据库进行更新操作,包含创建检查点,更新前的检查,修复更新前的检查问题,关闭数据库,对数据库进行更新,更新后的检查,修复更新后的检查问题,复制或者合并源文件到目标端
upgrade模式
对数据库进行更新操作,包括对数据库进行更新,更新后的检查,修复更新后的检查问题,相比与deploy模式,upgrade适合升级源端与目标端软件在不同服务器上的数据库,需要将更新前检查,修复与正式更新分开执行的升级,deloy模式不适合这种升级
Autoupgrade配置准备:
-
创建用户配置文件
-
源Oracle数据库已经启动并在原始的ORACLE_HOME目录中运行。在AutoUpgrade在进行upgrade时,会将数据库重新启动在要更新的ORACLE_HOME下面。
-
运行数据库的服务器的主机名要配置在hosts文件或DNS,如果登录到目标数据库所在的服务器上,并且数据库在localhost上运行或者在AutoUpgrade运行的地方运行,那么从AutoUpgrade配置文件中删除hostname参数。
-
在容器数据库(cdb)上,如果只升级某一个pdb,则要open进行升级的pdb,并在配置文件中配置pdbs参数。如果没有指定pdb列表,则自动升级CDB上的所有pdb。
-
下载最新的AutoUpgrade jar文件(AutoUpgrade .jar),并且使用Java 8环境进行运行。
-
如果想在批处理或脚本中运行AutoUpgrade,则使用非控制台参数noconsole参数调用。
-
在Oracle19c(19.3)以后的版本Oracle home中,autoupgrade.jar文件默认存在。但是,在使用AutoUpgrade之前,Oracle建议下载最新版本,从mos文档2485457.1中下载获得。
Autoupgrade升级案例
案例描述:
本案例是将一套12.2.0.1的RAC集群升级到19.16.0.0的RAC集群,采用的升级方式是先通过Dataguard+failover方式将数据库实时复制到异机的新环境RAC集群(软件配置19.16gi+19.16rdbms+12.2 rdbms),并在异机的新环境上通过Autoupgrade的方式将数据库升级为19.16.0.0
环境信息:
源端 | 目标端 | |
操作系统 | redhat6.8 | redhat7.5 |
hostname | hostold | hostnew |
GI版本 | 12.2.0.1.180417 | 19.16.0.0 |
RDBMS版本 | 12.2.0.1.180417 | 12.2.0.1.220118 19.16.0.0 |
db_unique_name | dbold | dbnew |
迁移前准备:
1 部署新环境以及配置ADG进行数据同步(部署步骤这里不进行展开)
2 jdk版本不满足8以上,需要安装jdk8环境
--检查java版本
[oracle@hostold1 bin]$ java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (rhel-2.5.5.4.el6-x86_64 u79-b14)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
--安装jdk8环境
cd /tmp
tar xvf jdk-8u311-linux-x64.tar.gz
[root@hostold1 tmp]# /tmp/jdk1.8.0_311/bin/java -version
java version "1.8.0_311"
Java(TM) SE Runtime Environment (build 1.8.0_311-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.311-b11, mixed mode)
3 下载上传最新的autoupgrade.jar,从mos文档2485457.1中下载获得
4 创建Autoupgrade参数文件
#参数文件主要有两种变量global与local,global是全局变量,会作用于全部的数据库(global.parameter),
#local是局部变量会作用与指定数据库(db_unique_name.parameter)
vi /tmp/config.txt
#日志路径
global.autoupg_log_dir=/tmp/autoupgrade_log
#升级完成之后收集数据字典统计信息
global.dictionary_stats_after=yes
#升级之前收集数据字典统计信息
global.dictionary_stats_before=yes
#升级之前收集固定表统计信息
global.fixed_stats_before=yes
#创建闪回点
global.restoration=yes
#升级完成之后不删除闪回点,人工确认
global.drop_grp_after_upgrade=no
#源端DB ORACLE_HOME
dbold.source_home=/oracle/app/oracle/product/12.0.0/dbhome_1
#目标端DB ORACLE_HOME
dbold.target_home=/oracle/app/oracle/product/19.0.0/dbhome_1
#升级数据库的ORACLE_SID
dbold.sid=dbold1
#升级的开始时间
dbold.start_time=now
#日志目录
dbold.log_dir=/tmp/autoupgrade_log/dbold
#升级节点的hostname
dbold.upgrade_node=hostold1
#升级之后执行对象编译
dbold.run_utlrp=yes
#升级之后,升级时区
dbold.timezone_upg=yes
#升级的目标版本19c
dbold.target_version=19
5 在源端环境执行analyze,分析不满足升级的条件
--会进入控制台界面
[oracle@hostold1 tmp]$ java -jar /tmp/autoupgrade.jar -config /tmp/dboldconfig.txt -mode analyze
AutoUpgrade 22.5.221011 launched with default internal options
Processing config file ...
+--------------------------------+
| Starting AutoUpgrade execution |
+--------------------------------+
1 Non-CDB(s) will be analyzed
Type 'help' to list console commands
upg>
--通过lsj可以查看job状态
upg> lsj
+----+-------+---------+---------+-------+----------+-------+----------------------------+
|Job#|DB_NAME| STAGE|OPERATION| STATUS|START_TIME|UPDATED| MESSAGE|
+----+-------+---------+---------+-------+----------+-------+----------------------------+
| 100| dbold1|PRECHECKS|EXECUTING|RUNNING| 17:46:24|12s ago|Loading database information|
+----+-------+---------+---------+-------+----------+-------+----------------------------+
Total jobs 1
--执行完成只会,会自动退出控制台,并输出html或者txt log格式报告
upg> cJob 100 completed
------------------- Final Summary --------------------
Number of databases [ 1 ]
Jobs finished [1]
Jobs failed [0]
Please check the summary report at:
/tmp/autoupgrade_log/cfgtoollogs/upgrade/auto/status/status.html
/tmp/autoupgrade_log/cfgtoollogs/upgrade/auto/status/status.log
6 修复那些需要人为介入的不满足升级条件
注:检查项目信息可以参考Database Preupgrade tool (via autoupgrade.jar) check list (Doc ID 2380601.1)
或者通过命令确认java -jar /tmp/autoupgrade.jar -config /tmp/dboldconfig.txt -listchecks xxx
--查看检查的报告,检查FLASH_RECOVERY_AREA_SETUP, MIN_ARCHIVE_DEST_SIZE, ISRAC_SWITCHEDON_TARGETHOME需要人为介入修改
[oracle@hostold1 prechecks]$ more /tmp/autoupgrade_log/cfgtoollogs/upgrade/auto/status/status.log
==========================================
Autoupgrade Summary Report
==========================================
[Date] Sun Nov 27 17:47:05 CST 2022
[Number of Jobs] 1
==========================================
[Job ID] 100
==========================================
[DB Name] dbold
[Version Before Upgrade] 12.2.0.1.0
[Version After Upgrade] 19
------------------------------------------
[Stage Name] PRECHECKS
[Status] FAILURE
[Start Time] 2022-11-27 17:46:24
[Duration]
[Log Directory] /tmp/autoupgrade_log/dbold/dbold1/100/prechecks
[Detail] /tmp/autoupgrade_log/dbold/dbold1/100/prechecks/dbold_preupgrade.log
Check failed for dbold1, manual intervention needed for the below checks
[FLASH_RECOVERY_AREA_SETUP, MIN_ARCHIVE_DEST_SIZE, ISRAC_SWITCHEDON_TARGETHOME]
Cause:
Reason:Database Checks has Failed details in /tmp/autoupgrade_log/dbold/dbold1/100/prechecks
Action:[MANUAL]
Info:Return status is ERROR
ExecutionError:No
Error Message:None
--FLASH_RECOVERY_AREA_SETUP,需要设置闪回区的大小,闪回点使用
alter system set db_recovery_file_dest_size=500G;
alter system set db_recovery_file_dest='+recoc1';
--MIN_ARCHIVE_DEST_SIZE日志归档空间不够,需要清理
--ISRAC_SWITCHEDON_TARGETHOME,忽略不处理,因为目标升级ORACLE_HOME不在同一套服务器上,所以会检查保持目标ORACLE_HOME异常
正式迁移:
将目标备库failover为主库,然后在目标库服务器进行升级,而源库则作为回退的环境
--将目标库failover为主库
select database_role,inst_id,open_Mode from gv$database;
DATABASE_ROLE INST_ID OPEN_MODE
---------------- ---------- --------------------
PHYSICAL STANDBY 1 READ ONLY WITH APPLY
PHYSICAL STANDBY 2 READ ONLY WITH APPLY
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
--重启dbnew
srvctl stop database -d dbnew
srvctl start database -d dbnew
--切换为主库
SQL> select database_role,inst_id,open_Mode from gv$database;
DATABASE_ROLE INST_ID OPEN_MODE
---------------- ---------- --------------------
PRIMARY 1 READ WRITE
PRIMARY 2 READ WRITE
源端清空目标端投递链路
--备份主库的pfile文件
create pfile='/tmp/initdbold20221128.ora' from spfile;
--主库清空链路二
alter system set log_archive_dest_2='';
目标库dbnew 设置闪回区,为创建闪回点做准备
alter system set db_recovery_file_dest_size=500G;
alter system set db_recovery_file_dest='+recoc1';
数据补丁字典更新
--为了避免潜在的bug,新环境目标库dbnew安装了最新补丁为12.2.0.1.220118,由于数据字典还是旧的12.2.0.1.220118,所以需要进行补丁数据字典更新
cd $ORACLE_HOME/OPatch
./datapatch -verbose
--确认更新完成
select patch_id,STATUS,action,action_time,description
from dba_registry_sqlpatch
PATCH_ID STATUS ACTION ACTION_TIME DESCRIPTION
---------- ------------------------- --------------- --------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
27475613 SUCCESS APPLY 04-AUG-20 11.20.36.981367 PM OJVM RELEASE UPDATE: 12.2.0.1.180417 (27475613)
27674384 SUCCESS APPLY 04-AUG-20 11.20.38.112001 PM DATABASE APR 2018 RELEASE UPDATE 12.2.0.1.180417
27475613 SUCCESS ROLLBACK 28-NOV-22 04.12.10.158536 PM OJVM RELEASE UPDATE: 12.2.0.1.180417 (27475613)
33561275 SUCCESS APPLY 28-NOV-22 04.12.10.168726 PM OJVM RELEASE UPDATE 12.2.0.1.220118
33587128 SUCCESS APPLY 28-NOV-22 04.12.12.905965 PM DATABASE JAN 2022 RELEASE UPDATE 12.2.0.1.220118
SQL>
配置autoupgrade的参数文件
--创建日志目录
mkdir -p /tmp/dbnew_autoupgrade_log/dbnew
--参数文件
vi /tmp/dbnewconfig.txt
global.autoupg_log_dir=/tmp/dbnew_autoupgrade_log
global.dictionary_stats_after=yes
global.dictionary_stats_before=yes
global.fixed_stats_before=yes
global.restoration=yes
global.drop_grp_after_upgrade=no
dbnew.source_home=/oracle/app/oracle/product/12.0.0/dbhome_1
dbnew.target_home=/oracle/app/oracle/product/19.0.0/dbhome_1
dbnew.sid=dbnew1
dbnew.start_time=now
dbnew.log_dir=/tmp/dbnew_autoupgrade_log/dbnew
dbnew.upgrade_node=hostnew01
dbnew.run_utlrp=yes
dbnew.timezone_upg=yes
dbnew.target_version=19
进行升级前的analyze
/oracle/app/oracle/product/12.0.0/dbhome_1/jdk/bin/java -jar /oracle/soft/autoupgrade.jar -config /tmp/dbnewconfig.txt -mode analyze
###############analyze检查通过,没有需要进行人为干预的选项
[oracle@hostnew01 ~ ]$ more /tmp/dbnew_autoupgrade_log/cfgtoollogs/upgrade/auto/status/status.log
==========================================
Autoupgrade Summary Report
==========================================
[Date] Mon Nov 28 16:15:05 CST 2022
[Number of Jobs] 1
==========================================
[Job ID] 101
==========================================
[DB Name] dbnew
[Version Before Upgrade] 12.2.0.1.0
[Version After Upgrade] 19.16.0.0.0
------------------------------------------
[Stage Name] PRECHECKS
[Status] SUCCESS
[Start Time] 2022-11-28 16:14:41
[Duration]
[Log Directory] /tmp/dbnew_autoupgrade_log/dbnew/dbnew1/101/prechecks
[Detail] /tmp/dbnew_autoupgrade_log/dbnew/dbnew1/101/prechecks/dbnew_preupgrade.log
Check passed and no manual intervention needed
进行升级前的fixups
/oracle/app/oracle/product/12.0.0/dbhome_1/jdk/bin/java -jar /oracle/soft/autoupgrade.jar -config /tmp/dbnewconfig.txt -mode fixups
[oracle@hostnew01 ~ ]$ more /tmp/dbnew_autoupgrade_log/cfgtoollogs/upgrade/auto/status/status.log
###############fixup完成
==========================================
Autoupgrade Summary Report
==========================================
[Date] Mon Nov 28 16:42:06 CST 2022
[Number of Jobs] 1
==========================================
[Job ID] 102
==========================================
[DB Name] dbnew
[Version Before Upgrade] 12.2.0.1.0
[Version After Upgrade] 19.16.0.0.0
------------------------------------------
[Stage Name] PRECHECKS
[Status] SUCCESS
[Start Time] 2022-11-28 16:16:13
[Duration] 0:00:19
[Log Directory] /tmp/dbnew_autoupgrade_log/dbnew/dbnew1/102/prechecks
[Detail] /tmp/dbnew_autoupgrade_log/dbnew/dbnew1/102/prechecks/dbnew_preupgrade.log
Check passed and no manual intervention needed
------------------------------------------
[Stage Name] PREFIXUPS
[Status] SUCCESS
[Start Time] 2022-11-28 16:16:33
[Duration]
[Log Directory] /tmp/dbnew_autoupgrade_log/dbnew/dbnew1/102/prefixups
[Detail] /tmp/dbnew_autoupgrade_log/dbnew/dbnew1/102/prefixups/prefixups.xml
------------------------------------------
--主要的耗时是prefixups,检查前项目的修复
tail -100f /tmp/yjzx_autoupgrade_log/dbnew/dbnew1/102/autoupgrade_20221128.log
2022-11-28 16:42:07.107 INFO ----------------------Stages Summary------------------------ - DispatcherOSHelper.writeStageSummary
2022-11-28 16:42:07.107 INFO SETUP <1 min - DispatcherOSHelper.writeStageSummary
2022-11-28 16:42:07.107 INFO DISPATCH <1 min - DispatcherOSHelper.writeStageSummary
2022-11-28 16:42:07.107 INFO PRECHECKS <1 min - DispatcherOSHelper.writeStageSummary
2022-11-28 16:42:07.107 INFO PREFIXUPS 25 min - DispatcherOSHelper.writeStageSummary
2022-11-28 16:42:07.107 INFO DISPATCH <1 min - DispatcherOSHelper.writeStageSummary
2022-11-28 16:42:07.107 INFO COMPLETED <1 min - DispatcherOSHelper.writeStageSummary
--主要是统计信息收集,回收站清空
[oracle@hostnew01 /tmp/dbnew_autoupgrade_log/dbnew/dbnew1/102/prefixups ]$ cat prefixups.xml |grep -i name
<Container name="dbnew1">
<Name>UNIAUD_RECORDS_IN_FILE</Name>
<Name>DICTIONARY_STATS</Name>
<Name>EXISTENCE_OF_DATAPUMP_AQ_TABLES</Name>
<Name>MANDATORY_UPGRADE_CHANGES</Name>
<Name>INVALID_OBJECTS_EXIST</Name>
<Name>PURGE_RECYCLEBIN</Name>
进行正式升级
/oracle/app/oracle/product/12.0.0/dbhome_1/jdk/bin/java -jar /oracle/soft/autoupgrade.jar -config /tmp/dbnewconfig.txt -mode deploy
###############升级完成
upg> Job 103 completed
------------------- Final Summary --------------------
Number of databases [ 1 ]
Jobs finished [1]
Jobs failed [0]
Jobs restored [0]
Jobs pending [0]
---- Drop GRP at your convenience once you consider it is no longer needed ----
Drop GRP from dbnew1: drop restore point AUTOUPGRADE_9212_dbnew122010
Please check the summary report at:
/tmp/dbnew_autoupgrade_log/cfgtoollogs/upgrade/auto/status/status.html
/tmp/dbnew_autoupgrade_log/cfgtoollogs/upgrade/auto/status/status.log
###############升级完成,查看分析报告
[oracle@hostnew01 ~ ]$ more /tmp/autoupgrade_log/cfgtoollogs/upgrade/auto/status/status.log
==========================================
Autoupgrade Summary Report
==========================================
[Date] Mon Nov 28 17:44:07 CST 2022
[Number of Jobs] 1
==========================================
[Job ID] 103
==========================================
[DB Name] dbnew
[Version Before Upgrade] 12.2.0.1.0
[Version After Upgrade] 19.16.0.0.0
------------------------------------------
[Stage Name] GRP
[Status] SUCCESS
[Start Time] 2022-11-28 16:47:07
[Duration] 0:00:12
[Detail] Please drop the following GRPs after Autoupgrade completes:
AUTOUPGRADE_9212_dbnew122010
------------------------------------------
[Stage Name] PREUPGRADE
[Status] SUCCESS
[Start Time] 2022-11-28 16:47:20
[Duration] 0:00:00
[Log Directory] /tmp/autoupgrade_log/dbnew/dbnew1/103/preupgrade
------------------------------------------
[Stage Name] PRECHECKS
[Status] SUCCESS
[Start Time] 2022-11-28 16:47:20
[Duration] 0:00:28
[Log Directory] /tmp/autoupgrade_log/dbnew/dbnew1/103/prechecks
[Detail] /tmp/autoupgrade_log/dbnew/dbnew1/103/prechecks/dbnew_preupgrade.log
Check passed and no manual intervention needed
------------------------------------------
[Stage Name] PREFIXUPS
[Status] SUCCESS
[Start Time] 2022-11-28 16:47:49
[Duration] 0:00:17
[Log Directory] /tmp/autoupgrade_log/dbnew/dbnew1/103/prefixups
[Detail] /tmp/autoupgrade_log/dbnew/dbnew1/103/prefixups/prefixups.xml
------------------------------------------
[Stage Name] DRAIN
[Status] SUCCESS
[Start Time] 2022-11-28 16:48:06
[Duration] 0:03:23
[Log Directory] /tmp/autoupgrade_log/dbnew/dbnew1/103/drain
------------------------------------------
[Stage Name] DBUPGRADE
[Status] SUCCESS
[Start Time] 2022-11-28 16:51:30
[Duration] 0:35:38
[Log Directory] /tmp/autoupgrade_log/dbnew/dbnew1/103/dbupgrade
------------------------------------------
[Stage Name] POSTCHECKS
[Status] SUCCESS
[Start Time] 2022-11-28 17:27:41
[Duration] 0:00:02
[Log Directory] /tmp/autoupgrade_log/dbnew/dbnew1/103/postchecks
[Detail] /tmp/autoupgrade_log/dbnew/dbnew1/103/postchecks/dbnew_postupgrade.log
Check passed and no manual intervention needed
------------------------------------------
[Stage Name] POSTFIXUPS
[Status] SUCCESS
[Start Time] 2022-11-28 17:27:43
[Duration] 0:12:02
[Log Directory] /tmp/autoupgrade_log/dbnew/dbnew1/103/postfixups
[Detail] /tmp/autoupgrade_log/dbnew/dbnew1/103/postfixups/postfixups.xml
------------------------------------------
[Stage Name] POSTUPGRADE
[Status] SUCCESS
[Start Time] 2022-11-28 17:39:46
[Duration] 0:00:55
[Log Directory] /tmp/autoupgrade_log/dbnew/dbnew1/103/postupgrade
------------------------------------------
[Stage Name] SYSUPDATES
[Status] SUCCESS
[Start Time] 2022-11-28 17:40:41
[Duration]
[Log Directory] /tmp/autoupgrade_log/dbnew/dbnew1/103/sysupdates
------------------------------------------
Summary: /tmp/autoupgrade_log/dbnew/dbnew1/103/dbupgrade/upg_summary.log
2022-11-28 17:44:07.284 INFO ----------------------Stages Summary------------------------ - DispatcherOSHelper.writeStageSummary
2022-11-28 17:44:07.285 INFO SETUP <1 min - DispatcherOSHelper.writeStageSummary
2022-11-28 17:44:07.285 INFO GRP <1 min - DispatcherOSHelper.writeStageSummary
2022-11-28 17:44:07.285 INFO PREUPGRADE <1 min - DispatcherOSHelper.writeStageSummary
2022-11-28 17:44:07.285 INFO PRECHECKS <1 min - DispatcherOSHelper.writeStageSummary
2022-11-28 17:44:07.285 INFO PREFIXUPS <1 min - DispatcherOSHelper.writeStageSummary
2022-11-28 17:44:07.285 INFO DRAIN 3 min - DispatcherOSHelper.writeStageSummary
2022-11-28 17:44:07.285 INFO DBUPGRADE 35 min - DispatcherOSHelper.writeStageSummary
2022-11-28 17:44:07.285 INFO DISPATCH <1 min - DispatcherOSHelper.writeStageSummary
2022-11-28 17:44:07.285 INFO POSTCHECKS <1 min - DispatcherOSHelper.writeStageSummary
2022-11-28 17:44:07.286 INFO POSTFIXUPS 12 min - DispatcherOSHelper.writeStageSummary
2022-11-28 17:44:07.286 INFO POSTUPGRADE <1 min - DispatcherOSHelper.writeStageSummary
2022-11-28 17:44:07.286 INFO SYSUPDATES 3 min - DispatcherOSHelper.writeStageSummary
2022-11-28 17:44:07.286 INFO COMPLETED <1 min - DispatcherOSHelper.writeStageSummary
2022-11-28 17:44:07.289 INFO End of dispatcher instance for dbnew - AutoUpgDispatcher.run
--升级的信息
[oracle@hostnew01 ~ ]$ more /tmp/autoupgrade_log/dbnew/dbnew1/103/dbupgrade/upg_summary.log
Oracle Database Release 19 Post-Upgrade Status Tool 11-28-2022 17:24:4
Database Name: dbnewPRO
Component Current Full Elapsed Time
Name Status Version HH:MM:SS
Oracle Server UPGRADED 19.16.0.0.0 00:14:45
JServer JAVA Virtual Machine UPGRADED 19.16.0.0.0 00:02:24
Oracle XDK UPGRADED 19.16.0.0.0 00:01:14
Oracle Database Java Packages UPGRADED 19.16.0.0.0 00:00:13
OLAP Analytic Workspace UPGRADED 19.16.0.0.0 00:00:19
Oracle Label Security UPGRADED 19.16.0.0.0 00:00:10
Oracle Database Vault UPGRADED 19.16.0.0.0 00:00:24
Oracle Text UPGRADED 19.16.0.0.0 00:01:18
Oracle Workspace Manager UPGRADED 19.16.0.0.0 00:00:46
Oracle Real Application Clusters UPGRADED 19.16.0.0.0 00:00:00
Oracle XML Database UPGRADED 19.16.0.0.0 00:01:33
Oracle Multimedia UPGRADED 19.16.0.0.0 00:00:45
Spatial UPGRADED 19.16.0.0.0 00:04:29
Oracle OLAP API UPGRADED 19.16.0.0.0 00:00:19
Datapatch 00:01:26
Final Actions 00:01:30
Post Upgrade 00:00:03
Total Upgrade Time: 00:30:30
Database time zone version is 26. It is older than current release time
zone version 32. Time zone upgrade is needed using the DBMS_DST package.
Grand Total Upgrade Time: [0d:0h:35m:38s]
[oracle@hostnew01 ~ ]$
确认升级的组件以及时区
--使用Oracle19c的环境变量
source /home/oracle/.oracle19c.env
--确认组件升级完成
set linesize 400
set pagesize 400
Col Comp_name Format a60
Col Status Format a12
Select Comp_name, status, Version
From Dba_Registry
Order by Comp_name;
COMP_NAME STATUS VERSION
------------------------------------------------------------ ------------ ------------------------------
JServer JAVA Virtual Machine VALID 19.0.0.0.0
OLAP Analytic Workspace VALID 19.0.0.0.0
Oracle Database Catalog Views VALID 19.0.0.0.0
Oracle Database Java Packages VALID 19.0.0.0.0
Oracle Database Packages and Types VALID 19.0.0.0.0
Oracle Database Vault VALID 19.0.0.0.0
Oracle Label Security VALID 19.0.0.0.0
Oracle Multimedia VALID 19.0.0.0.0
Oracle OLAP API VALID 19.0.0.0.0
Oracle Real Application Clusters VALID 19.0.0.0.0
Oracle Text VALID 19.0.0.0.0
Oracle Workspace Manager VALID 19.0.0.0.0
Oracle XDK VALID 19.0.0.0.0
Oracle XML Database VALID 19.0.0.0.0
Spatial VALID 19.0.0.0.0
---确认时区升级完成
SQL> select version from v$timezone_file;
VERSION
----------
32
删除闪回点
--确认升级完成之后,删除闪回点,如果不删除无法调整COMPATIBLE参数
drop restore point AUTOUPGRADE_9212_dbnew122010;
修改COMPATIBLE为19.0.0
注:可以通过autoupgrade设置参数global.raise_compatible=yes,在升级完成之后,自动调整参数为19.0.0,但前提是需要先删除闪回点
这里没有设置,是为了人工进一步确认升级完成之后,再调整COMPATIBLE参数,因为参数一旦调整,就无法进行降级
--设置COMPATIBLE为19.0.0
ALTER SYSTEM SET COMPATIBLE = '19.0.0' SCOPE=SPFILE;
--重启生效
srvctl stop database -d dbnew
srvctl start database -d dbnew
总结:
整个升级的过程比较于之前dbua或者catupgrd.sql方式升级,步骤大大简化,减少人为操作的时间以及错误,在多实例的升级场景中,优势将会更加的明显。