Oracle数据库一键升级工具AutoUpgrade介绍(Doc ID 2485457.1、1577660.1)
Tags: AutoUpgradeOracle升级工具
自动升级工具AutoUpgrade
替代了之前的手工升级或DBCU需要做的很多额外的操作。
随着2019年1月发布的RU (Release Updates),针对12.2和18c (18.5)作为升级目标的AutoUpgrade Tool在Support网站提供,从19c (19.3)开始,该工具也随着数据库软件一并发布(保存在$ORACLE_HOME/rdbms/admin目录下)。这个AutoUpgrade Utility是基于Java8的JARfile(autoupgrad.jar),是一个轻量级的命令行工具,可以协助我们实现升级数据库自动化。
通过AutoUpgrade Tool可以同时升级一个或多个数据库,AutoUpgrade会自动运行升级前的预检查任务,在需要的地方执行自动修复(能修复99%的潜在问题),接着执行升级数据库,最后完成升级后的后续动作(比如编译失效对象,调整时区、更新密码文件、spfile以及/etc/oratab等)。整个过程我们无需干预,只需要一个命令和一个配置文件,AutoUpgrade显著减少了与数据库升级相关的手工工作,使数据库升级过程更简单,从而大大降低风险。
截止到2019-12月,AutoUpgrade Tool的最新上传版本是Autoupgrade 19.7.2 build version 20191125。
对于12.2和18c (18.5) 作为升级目标的环境,需要通过2485457.1 – AutoUpgradeTool下载工具并保存到$ORACLE_HOME/rdbms/admin目录下,因为从 19.3开始,该工具才随数据库一并提供。虽然说19.3开始,该工具随数据库一并提供,但Oracle专家建议您到Support网站下载最新的版本并替换$ORACLE_HOME/rdbms/admin的发行版本。
AutoUpgrade工作流程
比如java -jar $OH19/rdbms/admin/autoupgrade.jar -config config.txt -mode deploy这个命令,该命令会读取配置文件coonfig.txt,启动一个升级job,然后由该job负责完成升级阶段的所有工作。如果升级过程中出现特殊问题,解决该问题后,可以从失败的地方继续执行。
AutoUpgrade工作内容
Autoupgrade的四种模式。我们常用的是analyze和deploy
每个阶段执行的内容:
Analyze Mode: Setup, Prechecks.
Fixups Mode: Setup, Prechecks, and Prefixups.
Deploy Mode: Setup, Preupgrade, Prechecks, guaranteed restore point (GRP), Prefixups, Drain, DB (database) Upgrade, Postchecks, and Postupgrade. You can run your own scripts before the upgrade (Preupgrade stage) or after the upgrade (Postupgrade stage), or both before and after the upgrade.
Upgrade Mode: Setup, DB (database) Upgrade, Postchecks, and Postfixups.
升级RAC数据库
在升级数据库时,尤其是RAC数据库,建议通过DBUA或者autoupgrade工具来升级,因为这两个工具会处理几乎所有与升级数据库相关的工作。Autoupgrade工具是一个完美的升级工具。可参考AutoUpgrade Tool (Doc ID 2485457.1)。升级前建议下载最新的autoupgrade工具,并使用最新的版本。因为会解决一些潜在的问题。比如下面这两个问题
如果使用的是2019年7月以后的版本,则无需修改数据库参数cluster_database=false
如果使用的是2019年10月以后的版本,则无需修改配置文件参数timezone_upg=no
如果有多个实例在运行,数据库对自动关闭其他实例,保留一个节点
如果是CDB容器数据库,PDB是什么状态也无所谓,autoupgrade会自动处理
RAC数据库环境信息
本次升级是从Oracle 12.1.0.2 RAC升级到Oracle 19.3 RAC,其中12.1数据库包含了两个pluggable database(PPDB01,PPDB02)。整个过程很简单,对DBA来说,真的是太棒了。因为GI的版本自身是19.4,所以在本次实验中不涉及GI的升级。升级GI更简单,安装GI,然后运行rootupgrade.sh脚本,详情可参考下面的链接,将GI从11204升级到12102 (http://www.ohsdba.cn/index.php?m=Article&a=show&id=195)。点击此处下载升级通过Autoupgrade升级RAC的文档
Autoupgrade非常完美
通过日志我们可以看出,autoupgrade真的是太贴心了,做了很多东西。
创建spfile
更新/etc/oratab
复制tnsnames.ora,listener.ora,sqlnet.ora到新ORACLE HOME
执行srvctl upgrade database
健康检查
Reference
AutoUpgrade Tool (Doc ID 2485457.1)
https://mikedietrichde.com/2019/09/05/the-september-2019-autoupgrade-and-the-autoupgrade-video/
https://mikedietrichde.com/2019/06/28/config-file-for-autoupgrade-19c-advanced-options/
https://mikedietrichde.com/2019/07/19/autoupgrade-and-data-guard-rac-restart-and-non-cdb-to-pdb/
AutoUpgrade Tool (Doc ID 2485457.1)
APPLIES TO:
Oracle Database - Standard Edition - Version 12.2.0.1 and later
Oracle Database - Enterprise Edition - Version 12.2.0.1 and later
Information in this document applies to any platform.
MAIN CONTENT
Description
Oracle Database AutoUpgrade allows DBAs to upgrade one or many databases without human intervention, all with one command and a single configuration file.
Benefits
AutoUpgrade enables customers to upgrade one or many Oracle databases at the command-line with a single command and a single configuration file. AutoUpgrade will run the preupgrade tasks, perform automated fixups where needed, execute the database upgrade, and finish by taking care of post-upgrade tasks. It includes automatic retry and fallback, the possibility to schedule upgrades for future points in time, and the ability to set, change or remove initialization parameters as desired. It saves time and money by upgrading hundreds of databases with one command and replacing bespoke high maintenance upgrade solutions.
Download
The most recent version of AutoUpgrade can be downloaded via this link: version 20211115.
Target Versions Supported
AutoUpgrade Tool can be used on upgrading to below Oracle Database releases:
- 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)
For supported source Oracle Databases releases to be upgraded to above target releases, refer to Database Server Upgrade/Downgrade Compatibility Matrix (Doc ID 551141.1)
Installation
As of the January 2019 Release Updates (DBJAN2019RU) and beyond, AutoUpgrade Support is available for Oracle Database 12c Release 2 (12.2) and Oracle Database 18c (18.5) target homes. For both Oracle Database 12c Release 2 (12.2) and Oracle Database 18c (18.5) target homes, you must download the AutoUpgrade Tool and place it under $ORACLE_HOME/rdbms/admin.
In Oracle Database 19c (19.3) and later target Oracle homes, the autoupgrade.jar file exists by default. However, before you use AutoUpgrade, Oracle recommends that you download the latest version and replace the one already existing under $ORACLE_HOME/rdbms/admin.
AutoUpgrade documentation
Refer to Oracle Upgrade Guide for complete documentation about how to use AutoUpgrade tool.
Known limitations
- Database restoration option is not available on an Oracle Database Standard Edition.
AutoUpgrade 21c Release: New Features/Enhancements
- Non-CDB to PDB Upgrades
- AutoUpgrade can upgrade and convert a non-CDB to a PDB in a new CDB in a single operation, or upgrade and then convert a Non-CDB database to a PDB in a pre-existing CDB
- Support for RAC and SI databases
- Unplug-plug upgrade
- AutoUpgrade can perform an unplug of a pluggable database (PDB) from an earlier release source container database (CDB), plug it into a later release target CDB, and then complete all the steps required to upgrade the PDB to the target CDB release
- Supports RAC upgrades (Only for Linux or Unix-based systems)
- Configuration of the RAC management system in the source and target home is automated
- Supports native file systems, ASM and ACFS
- Oracle Restart
- Pluggable databases are supported in a RAC environment
- Ability to pass catctl_options (via config file)
- This enables the DBA to control the level of parallelism for a specific upgrade.
- Restore capability
- AutoUpgrade restore job option allows the DBA to restore database back to source home if upgrade failed or succeeded
- Clear the recovery for a specific job by adding clear_recovery_data on the command line and use jobs parameter to specific exactly which jobs recovery data must be cleared.
- Upgrades on Data Guard environments
- AutoUpgrade can detect Oracle Data Guard configurations, and defer shipping logs to standby databases configured for the primary database. It will also detect and defer shipping logs to standby database if the deployment is configured manually. Upon a successfully upgrade of the primary database, upgrades to the standby database must be performed and monitored by the DBA.
- AutoUpgrade performance improvements
- utlrp compilations moved out of upgrade into a post fixup
- Improved resume operations: AutoUpgrade keeps track and skips over PDBs databases that have been upgraded successfully
- Replay support was added for upgrades 21 or higher
- AutoUpgrade supports upgrade on CDBs with proxy pdbs
- AutoUpgrade supports upgrade on CDB’s with application containers
- Added additional JSON status information
- Integrated classic pre-upgrade functionality
- The -preupgrade clause of AutoUpgrade replaces the functions previously performed by the manual Pre-Upgrade Information Tool (preupgrade.jar) in previous releases The -mode clause takes one of three values:
- analyze: Check your system for readiness to upgrade
- fixups: Perform fixups as needed on your source Oracle Database release in preparation for upgrade
- postfixups: Perform fixups on your target Oracle Database release after upgrade is completed.
- Reports are identical to what the preupgrade.jar originally produced.
- Starting Oracle Release 21c, Enterprise Manager, DBUA and ORAchk use AutoUpgrade to perform database upgrade readiness.
- Starting Oracle Release 21c, FPP performs database upgrades using AutoUpgrade
- Enhanced management of databases using Transparent Data Encryption (TDE)
REFERENCES
NOTE:551141.1 - Database Server Upgrade/Downgrade Compatibility Matrix
AutoUpgrade 19.10.0 build version 20201023
(2.24 MB)
AutoUpgrade 21.1.3 build version 20210421
(2.84 MB)
AutoUpgrade 21.2 build version 20210721
(2.85 MB)
Autoupgrade 21.3 build version 20211115
(2.86 MB)
Changelog
(41.51 KB)
数据库 升级/降级 兼容性矩阵 (Doc ID 1577660.1)
适用于:
Oracle Database - Enterprise Edition - 版本 9.2.0.1 和更高版本
Oracle Database Cloud Schema Service - 版本 N/A 和更高版本
Oracle Database Exadata Cloud Machine - 版本 N/A 和更高版本
Oracle Database Exadata Express Cloud Service - 版本 N/A 和更高版本
Oracle Cloud Infrastructure - Database Service - 版本 N/A 和更高版本
本文档所含信息适用于所有平台
用途
这篇文档总结了Oracle数据库升级和降级的兼容性矩阵。
适用范围
信息适用于Oracle Database Server 9.2.0 及更高版本,为DBA以及负责数据库升级和降级的相关人员提供帮助。
详细信息
升级
升级到19c的升级兼容性矩阵
能够直接升级到Oracle Database 19c的数据库最小版本
源库 | 目标库 |
---|---|
18 (所有版本) | 19c |
12.2.0.1 | 19c |
12.1.0.2 | 19c |
11.2.0.4 | 19c |
1 2 | 其他未在上面提到的数据库发布/版本不支持直接升级到19c。 所以首先升级到中间Oracle数据库版本,然后可以直接升级到19c。 |
升级到18c的升级兼容性矩阵
1 | 注意:对于 Exadata 18.1 数据库已经发布了, 对于 On-Premise 数据库 18.3 发布了。 |
能够直接升级到Oracle Database 18.1的数据库最小版本
源库 | 目标库 |
---|---|
12.2.0.1 | 18c |
12.1.0.1 / 12.1.0.2 | 18c |
11.2.0.3 / 11.2.0.4 | 18c |
1 2 | 如果不是上述提到的数据库版本,直接升级到18c是不support的。 因此,首先升级到Oracle数据库的中间版本,然后可以将其直接升级到18c版本。 |
升级到12.2.x的升级兼容性矩阵
能够直接升级到Oracle 12c Release 2的数据库最小版本
源库 | 目标库 |
---|---|
11.2.0.3 / 11.2.0.4 | 12.2.x |
12.1.0.1 / 12.1.0.2 | 12.2.x |
以下的数据库版本需要间接升级
源库 | 升级路径 | 目标库 |
---|---|---|
11.2.0.2 | --> 11.2.0.4/12.1.0.2 --> | 12.2.x |
11.2.0.1 | --> 11.2.0.4 --> | 12.2.x |
11.1.0.7 | --> 11.2.0.4/12.1.0.2 --> | 12.2.x |
11.1.0.6 | --> 11.2.0.4 --> | 12.2.x |
10.2.0.5 | --> 11.2.0.4/12.1.0.2 --> | 12.2.x |
10.2.0.2 /10.2.0.3/10.2.0.4 | --> 11.2.0.4 --> | 12.2.x |
10.2.0.1 | --> 10.2.0.5 --> 11.2.0.4/12.1.0.2 --> | 12.2.x |
10.1.0.5 | --> 11.2.0.4 --> | 12.2.x |
10.1.0.4(或更低版本) | --> 10.2.0.5 --> 11.2.0.4/12.1.0.2 --> | 12.2.x |
9.2.0.8 | --> 11.2.0.4 --> | 12.2.x |
9.2.0.7(或更低版本) | --> 9.2.0.8 --> 11.2.0.4 --> | 12.2.x |
升级到12.1.x的升级兼容性矩阵
能够直接升级到Oracle 12c Release 1的数据库最小版本
源数据库 | 目标数据库 |
---|---|
10.2.0.5 | 12.1.x |
11.1.0.7 | 12.1.x |
11.2.0.2 (或更高版本) | 12.1.x |
以下的数据库版本需要间接升级。
源数据库 | 升级路径 | 目标数据库 |
---|---|---|
11.2.0.1 | => 11.2.0.2 或更高版本 => | 12.1.x |
11.1.0.6 | => 11.1.0.7 or 11.2.0.2 或更高版本 => | 12.1.x |
10.2.0.4 (或更低版本) | => 10.2.0.5 或之后的直接升级版本 => | 12.1.x |
10.1.0.5 (或更低版本) | => 10.2.0.5 或之后的直接升级版本 => | 12.1.x |
9.2.0.8 (或更低版本) | => 9.2.0.8 --> 11.2.0.2 或更高版本 => | 12.1.x |
升级到11.2.x的升级兼容性矩阵
能够直接升级到Oracle 11g Release 2的数据库最小版本
源数据库 | 目标数据库 |
---|---|
9.2.0.8 (或更高版本) | 11.2.x |
10.1.0.5 (或更高版本) | 11.2.x |
10.2.0.2 (或更高版本) | 11.2.x |
11.1.0.6 (或更高版本) | 11.2.x |
以下的数据库版本需要间接升级。
源数据库 | 升级路径 | 目标数据库 |
---|---|---|
7.3.3 (或更低版本) | => 7.3.4.0 => 9.2.0.8 => | 11.2.x |
8.0.5 (或更低版本) | => 8.0.6.x => 9.2.0.8 => | 11.2.x |
8.1.7 (或更低版本) | => 8.1.7.4 => 10.2.0.4 => | 11.2.x |
9.0.1.3 (或更低版本) | => 9.0.1.4 => 10.2.0.4 => | 11.2.x |
9.2.0.7 (或更低版本) | => 9.2.0.8 => | 11.2.x |
更多信息,请参阅以下链接:
http://docs.oracle.com/cd/E11882_01/server.112/e23633/preup.htm#UPGRD12358
(以上链接会定向到Oracle Technology Network,需要OTN的用户名和密码进行访问)
升级到11.1.x的升级兼容性矩阵
能够直接升级到Oracle 11g Release 1的数据库最小版本
源数据库 | 目标数据库 |
---|---|
9.2.0.4 (或更高版本) | 11.1.x |
10.1.0.2 (或更高版本) | 11.1.x |
10.2.0.1 (或更高版本) | 11.1.x |
以下版本的数据库需要间接升级。
源数据库 | 升级路径 | 目标数据库 |
---|---|---|
7.3.3 (或更低版本) | => 7.3.4.0 => 9.2.0.8 => | 11.1.x |
8.0.5 (或更低版本) | => 8.0.6.x => 9.2.0.8 => | 11.1.x |
8.1.7 (或更低版本) | => 8.1.7.4 => 9.2.0.8 => | 11.1.x |
9.0.1.3 (或更低版本) | => 9.0.1.4 => 9.2.0.8 => | 11.1.x |
9.2.0.3 (或更低版本 | => 9.2.0.4.0 => | 11.1.x |
更多信息,请参阅以下链接:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/preup.htm#CEGEIBHC
(以上链接会定向到Oracle Technology Network,需要OTN的用户名和密码进行访问)
升级到10.2.x的升级兼容性矩阵
能够直接升级到10.2.x的数据库最小版本
源数据库 | 目标数据库 |
---|---|
8.1.7.4 (或更高版本) | 10.2.x |
9.0.1.4 (或更高版本) | 10.2.x |
9.2.0.4 (或更高版本) | 10.2.x |
10.1.0.2 (或更高版本) | 10.2.x |
以下版本的数据库需要间接升级。
源数据库 | 升级路径 | 目标数据库 |
---|---|---|
7.3.3 (或更低版本) | => 7.3.4 => 8.1.7 =>8.1.7.4 => | 10.2.x |
7.3.4 (或更低版本) | =>8.1.7 => 8.1.7.4 => | 10.2.x |
8.0.n (或更低版本) | =>8.1.7 => 8.1.7.4 => | 10.2.x |
8.1.n (或更低版本) | =>8.1.7 => 8.1.7.4 => | 10.2.x |
更多信息,请参阅以下链接:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14238/preup.htm#CEGEIBHC
升级到10.1.x的升级兼容性矩阵
能够直接升级到10.1.x的数据库最小版本
源数据库 | 目标数据库 |
---|---|
8.0.6 (或更高版本) | 10.1.x |
8.1.7 (或更高版本) | 10.1.x |
9.0.1 (或更高版本) | 10.1.x |
9.2.0 (或更高版本) | 10.1.x |
以下版本的数据库需要间接升级。
源数据库 | 升级路径 | 目标数据库 |
---|---|---|
7.3.4 (或更低版本) | => 8.0.6 => | 10.1.x |
8.0.5 (或更低版本) | => 8.0.6 => | 10.1.x |
8.1.6 (或更低版本) | => 8.1.7 => | 10.1.x |
更多信息,请参阅以下链接:
http://download.oracle.com/docs/cd/B14117_01/server.101/b10763/preup.htm#CEGEIBHC
升级到9.2.x的升级兼容性矩阵
能够直接升级到9.2.x的数据库最小版本
源数据库 | 目标数据库 |
---|---|
7.3.4 (或更高版本) | 9.2.x |
8.0.6 (或更高版本) | 9.2.x |
8.1.7 (或更高版本) | 9.2.x |
9.0.1 (或更高版本) | 9.2.x |
以下版本的数据库需要间接升级。
源数据库 | 升级路径 | 目标数据库 |
---|---|---|
7.3.3 (或更低版本) | => 7.3.4 => | 9.2.x |
8.0.5 (或更低版本) | => 8.0.6 => | 9.2.x |
8.1.6 (或更低版本) | => 8.1.7 => | 9.2.x |
更多信息,请参阅以下链接:
http://download.oracle.com/docs/cd/B10501_01/server.920/a96530/migprep.htm#1006863
降级
从19c降级的降级兼容性矩阵
源数据库 | 可能降级到 |
---|---|
Non-CDB 19c | 18c,12.2.0.1,12.1.0.2,12.1.0.1,11.2.0.4 |
PDB/CDB 19c | 18c,12.2.0.1,12.1.0.2 |
更多的信息,请参考 19c Downgrade link.
从18c降级的降级兼容性矩阵
源数据库 | 可能降级到 |
---|---|
Non-CDB 18c | 12.2.0.1,12.1.0.2,12.1.0.1,11.2.0.4 |
PDB/CDB 18c | 12.2.0.1,12.1.0.2 |
更多的信息,请参考 18c Downgrade link.
从12.2降级的降级兼容性矩阵
源数据库 | 可能降级到 |
---|---|
Non-CDB 12.2 | 12.1.0.2,12.1.0.1,11.2.0.4,11.2.0.3 |
PDB/CDB 12.2 | 12.1.0.2 |
更多的信息,请参考 12.2 Downgrade link.
从12.1.x降级的降级兼容性矩阵
源数据库 | 可能降级到 |
---|---|
12.1.x | 11.1.0.7 |
12.1.x | 11.2.0.2.0 (或更高版本) |
更多信息,请参阅以下链接:
http://docs.oracle.com/cd/E16655_01/server.121/e17642/downgrade.htm#i1010267
注意:
你不能降级到10.2.0.5因为Oracle Database 12c的最小兼容版本是11.0。
你不能降级一个从Oracle Database Express Edition升级上来的数据库。
从11.2.x降级的降级兼容性矩阵
源数据库 | 可能降级到 |
---|---|
11.2.x | 10.1.0.5.0 (或更高版本) |
11.2.x | 10.2.0.2.0 (或更高版本) |
11.2.x | 11.1.0.6.0 (或更高版本) |
更多信息,请参阅以下链接:
http://docs.oracle.com/cd/E11882_01/server.112/e23633/downgrade.htm#UPGRD00710
从11.1.x降级的降级兼容性矩阵
源数据库 | 可能降级到 |
---|---|
11.1.x | 10.1.0.5.0 (或更高版本) |
11.1.x | 10.2.0.3.0 (或更高版本) |
更多信息,请参阅以下链接:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/downgrade.htm#i1010243
从10.2.x降级的降级兼容性矩阵
源数据库 | 可能降级到 |
---|---|
10.2.x | 9.2.0.6.0 (或更高版本) |
10.2.x | 10.1.0.4.0 (或更高版本) |
更多信息,请参阅以下链接:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14238/downgrade.htm#i1010243
从10.1.x降级的降级兼容性矩阵
源数据库 | 可能降级到 |
---|---|
10.1.x | 9.2.0.4.0 (或更高版本) |
更多信息,请参阅以下链接:
http://download.oracle.com/docs/cd/B14117_01/server.101/b10763/downgrade.htm#i1010243
从9.2.x降级的降级兼容性矩阵
源数据库 | 可能降级到 |
---|---|
9.2.x | 9.0.1.3.0 (或更高版本) |
9.2.x | 8.1.7.3.0 (或更高版本) |
更多信息,请参阅以下链接:
http://download.oracle.com/docs/cd/B10501_01/server.920/a96530/downgrad.htm#1008177
注意
1 : 如果您在升级后打了某个补丁集,那么将不能降级。
例如:如果您从9.2.0.6 升级到 10.2.0.1,然后打上了10.2.0.3的补丁集,那么您将不能从10.2.0.3 降级到 9.2.0.6. (只有当您直接升级9.2.0.6 到 10.2.0.3,您才能从10.2.0.3 降级到 9.2.0.6)
2 : 您只能降级到和您数据库升级前一样的版本。
例如:只有您的数据库是从10.2.0.3升级到11.1.0.6的话,才能从11.1.0.6降级到10.2.0.3。如果您创建了新的11.1.0.6数据库,那么您不能将数据库降级到10.2.0.3。而且,如果您直接升级9.2.0.8 到 11.1.0.6,那么您也不能降级到10.2.0.3,因为您的数据库不是从10.2.0.3升级的。
3 : 如果数据库参数COMPATIBLE设置为比您升级前数据库版本更高的版本,您将不能做降级。
例如:如果您从10.2.0.3 升级到 11.1.0.6,之后设置COMPATIBLE 为 11.1.0.6,您不能做降级。而且,如果您从9.2.0.8 直接升级到 11.1.0.6之后设置COMPATIBLE 为10.2.0.1,您也不能做降级。
4 : 您不能升级一个发行版的数据库二进制文件到另一个发行版
例如:您不能升级10.1.0.2.0的二级制文件 到 10.2.0.1.0。发行版必须在一个单独的oracle home下安装。您不能将10.2.0.x安装在任何其他发行版的oracle home下来完成升级。
Database Server Upgrade/Downgrade Compatibility Matrix (Doc ID 551141.1)
APPLIES TO:
Oracle Database Cloud Service - Version N/A and later
Oracle Database - Enterprise Edition - Version 9.2.0.1 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.
PURPOSE
This note gives a summary of the compatibility matrix for Oracle Database Server upgrade and downgrade.
SCOPE
This information applies to Oracle Database Server 9.2.0 and higher, and is intended for DBAs and anyone responsible for database upgrades and downgrades.
DETAILS
UPGRADE
Upgrade Compatibility Matrix for Upgrading to 19c
Minimum Version of the database that can be directly upgraded to Oracle Database 19c
Source Database | Destination Database |
---|---|
18 (all releases) | 19c |
12.2.0.1 | 19c |
12.1.0.2 | 19c |
11.2.0.4 | 19c |
1 2 | Direct upgrade to 19c is not supported to rest of the database releases/versions which are not mentioned above. So first Upgrade to an intermediate Oracle Database release which can be then directly be upgraded to 19c. |
Upgrade Compatibility Matrix for Upgrading to 18c
1 | Note: For Exadata 18.1 database was released and For On-Premise database 18.3 released. |
Minimum Version of the database that can be directly upgraded to Oracle Database 18c
Source Database | Destination Database |
---|---|
12.2.0.1 | 18c |
12.1.0.1 / 12.1.0.2 | 18c |
11.2.0.3 / 11.2.0.4 | 18c |
1 2 | Direct upgrade to 18c is not supported to rest of the database releases/versions which are not mentioned above. So first Upgrade to an intermediate Oracle Database release which can be then directly be upgraded to 18c |
Upgrade Compatibility Matrix for Upgrading to 12.2.x
Minimum Version of the database that can be directly upgraded to Oracle Database 12c Release 2
Source Database | Destination Database |
---|---|
11.2.0.3 / 11.2.0.4 | 12.2.x |
12.1.0.1 / 12.1.0.2 | 12.2.x |
The following database version will require an indirect upgrade path.
Source Database | Upgrade Path | Destination Database |
---|---|---|
11.2.0.2 | --> 11.2.0.4/12.1.0.2 --> | 12.2.x |
11.2.0.1 | --> 11.2.0.4 --> | 12.2.x |
11.1.0.7 | --> 11.2.0.4/12.1.0.2 --> | 12.2.x |
11.1.0.6 | --> 11.2.0.4 --> | 12.2.x |
10.2.0.5 | --> 11.2.0.4/12.1.0.2 --> | 12.2.x |
10.2.0.2 /10.2.0.3/10.2.0.4 | --> 11.2.0.4 --> | 12.2.x |
10.2.0.1 | --> 10.2.0.5 --> 11.2.0.4/12.1.0.2 --> | 12.2.x |
10.1.0.5 | --> 11.2.0.4 --> | 12.2.x |
10.1.0.4(or lower) | --> 10.2.0.5 --> 11.2.0.4/12.1.0.2 --> | 12.2.x |
9.2.0.8 | --> 11.2.0.4 --> | 12.2.x |
9.2.0.7(or lower) | --> 9.2.0.8 --> 11.2.0.4 --> | 12.2.x |
Upgrade Compatibility Matrix for Upgrading to 12.1.x
Minimum Version of the database that can be directly upgraded to Oracle Database 12c Release 1
Source Database | Destination Database |
---|---|
10.2.0.5 | 12.1.x |
11.1.0.7 | 12.1.x |
11.2.0.2 (or higher) | 12.1.x |
The following database version will require an indirect upgrade path.
Source Database | Upgrade Path | Destination Database |
---|---|---|
11.2.0.1 | => 11.2.0.2 or higher => | 12.1.x |
11.1.0.6 | => 11.1.0.7 or 11.2.0.2 or higher => | 12.1.x |
10.2.0.4 (or earlier) | => 10.2.0.5 or later direct upgrade version => | 12.1.x |
10.1.0.5 (or earlier) | => 10.2.0.5 or later direct upgrade version => | 12.1.x |
9.2.0.8 (or earlier) | => 9.2.0.8 --> 11.2.0.2 or higher => | 12.1.x |
Upgrade Compatibility Matrix for Upgrading to 11.2.x
Minimum Version of the database that can be directly upgraded to Oracle 11g Release 2
Source Database | Destination Database |
---|---|
9.2.0.8 (or higher) | 11.2.x |
10.1.0.5 (or higher) | 11.2.x |
10.2.0.2 (or higher) | 11.2.x |
11.1.0.6 (or higher) | 11.2.x |
The following database version will require an indirect upgrade path.
Source Database | Upgrade Path | Destination Database |
---|---|---|
7.3.3 (or lower) | => 7.3.4.0 => 9.2.0.8 => | 11.2.x |
8.0.5 (or lower) | => 8.0.6.x => 9.2.0.8 => | 11.2.x |
8.1.7 (or lower) | => 8.1.7.4 => 10.2.0.4 => | 11.2.x |
9.0.1.3 (or lower) | => 9.0.1.4 => 10.2.0.4 => | 11.2.x |
9.2.0.7 (or lower) | => 9.2.0.8 => | 11.2.x |
For more information, refer to the following link :
http://docs.oracle.com/cd/E11882_01/server.112/e23633/preup.htm#UPGRD12358
(The above link takes to Oracle Technology Network and requires OTN username and password)
Upgrade Compatibility Matrix for Upgrading to 11.1.x
Minimum Version of the database that can be directly upgraded to Oracle 11g Release 1
Source Database | Destination Database |
---|---|
9.2.0.4 (or higher) | 11.1.x |
10.1.0.2 (or higher) | 11.1.x |
10.2.0.1 (or higher) | 11.1.x |
The following database version will require an indirect upgrade path.
Source Database | Upgrade Path | Destination Database |
---|---|---|
7.3.3 (or lower) | => 7.3.4.0 => 9.2.0.8 => | 11.1.x |
8.0.5 (or lower) | => 8.0.6.x => 9.2.0.8 => | 11.1.x |
8.1.7 (or lower) | => 8.1.7.4 => 9.2.0.8 => | 11.1.x |
9.0.1.3 (or lower) | => 9.0.1.4 => 9.2.0.8 => | 11.1.x |
9.2.0.3 (or lower) | => 9.2.0.4.0 => | 11.1.x |
For more information, refer to the following link :
http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/preup.htm#CEGEIBHC
(The above link takes to Oracle Technology Network and requires OTN username and password)
Upgrade Compatibility Matrix for Upgrading to 10.2.x
Minimum Version of the database that can be directly upgraded to Oracle 10.2.x
Source Database | Destination Database |
---|---|
8.1.7.4 (or higher) | 10.2.x |
9.0.1.4 (or higher) | 10.2.x |
9.2.0.4 (or higher) | 10.2.x |
10.1.0.2 (or higher) | 10.2.x |
The following database version will require an indirect upgrade path.
Source Database | Upgrade Path | Destination Database |
---|---|---|
7.3.3 (or lower) | => 7.3.4 => 8.1.7 =>8.1.7.4 => | 10.2.x |
7.3.4 (or lower) | =>8.1.7 => 8.1.7.4 => | 10.2.x |
8.0.n (or lower) | =>8.1.7 => 8.1.7.4 => | 10.2.x |
8.1.n (or lower) | =>8.1.7 => 8.1.7.4 => | 10.2.x |
For more information, refer to the following link :
http://download.oracle.com/docs/cd/B19306_01/server.102/b14238/preup.htm#CEGEIBHC
Upgrade Compatibility Matrix for Upgrading to 10.1.x
Minimum Version of the database that can be directly upgraded to Oracle 10.1.x
Source Database | Destination Database |
---|---|
8.0.6 (or higher) | 10.1.x |
8.1.7 (or higher) | 10.1.x |
9.0.1 (or higher) | 10.1.x |
9.2.0 (or higher) | 10.1.x |
The following database version will require an indirect upgrade path.
Source Database | Upgrade Path | Destination Database |
---|---|---|
7.3.4 (or lower) | => 8.0.6 => | 10.1.x |
8.0.5 (or lower) | => 8.0.6 => | 10.1.x |
8.1.6 (or lower) | => 8.1.7 => | 10.1.x |
For more information, refer to the following link :
http://download.oracle.com/docs/cd/B14117_01/server.101/b10763/preup.htm#CEGEIBHC
Upgrade Compatibility Matrix for Upgrading to 9.2.x
Minimum Version of the database that can be directly upgraded to Oracle 9.2.x
Source Database | Destination Database |
---|---|
7.3.4 (or higher) | 9.2.x |
8.0.6 (or higher) | 9.2.x |
8.1.7 (or higher) | 9.2.x |
9.0.1 (or higher) | 9.2.x |
The following database version will require an indirect upgrade path
Source Database | Upgrade Path | Destination Database |
---|---|---|
7.3.3 (or lower) | => 7.3.4 => | 9.2.x |
8.0.5 (or lower) | => 8.0.6 => | 9.2.x |
8.1.6 (or lower) | => 8.1.7 => | 9.2.x |
For more information, refer to the following link :
http://download.oracle.com/docs/cd/B10501_01/server.920/a96530/migprep.htm#1006863
DOWNGRADE
Downgrade Compatibility Matrix for Downgrading from 19c
Source Database | Downgrade Possible to |
---|---|
Non-CDB 19c | 18c,12.2.0.1,12.1.0.2,12.1.0.1,11.2.0.4 |
PDB/CDB 19c | 18c,12.2.0.1,12.1.0.2 |
For more information, refer to the 19c Downgrade link.
Downgrade Compatibility Matrix for Downgrading from 18c
Source Database | Downgrade Possible to |
---|---|
Non-CDB 18c | 12.2.0.1,12.1.0.2,12.1.0.1,11.2.0.4 |
PDB/CDB 18c | 12.2.0.1,12.1.0.2 |
For more information, refer to the 18c Downgrade link.
Downgrade Compatibility Matrix for Downgrading from 12.2
Source Database | Downgrade Possible to |
---|---|
Non-CDB 12.2 | 12.1.0.2,12.1.0.1,11.2.0.4,11.2.0.3 |
PDB/CDB 12.2 | 12.1.0.2 |
For more information, refer to the 12.2 Downgrade link.
Downgrade Compatibility Matrix for Downgrading from 12.1.x
Source Database | Downgrade Possible to |
---|---|
12.1.x | 11.1.0.7.0 |
12.1.x | 11.2.0.2.0 (or higher) |
For more information, refer to the following link :
http://docs.oracle.com/cd/E16655_01/server.121/e17642/downgrade.htm#i1010267
Note:
You cannot downgrade back to release 10.2.0.5 because the minimum compatibility setting for Oracle Database 12c is 11.0.
You cannot downgrade a database that was upgraded from Oracle Database Express Edition.
Downgrade Compatibility Matrix for Downgrading from 11.2.x
Source Database | Downgrade Possible to |
---|---|
11.2.x | 10.1.0.5.0 (or higher) |
11.2.x | 10.2.0.2.0 (or higher) |
11.2.x | 11.1.0.6.0 (or higher) |
For more information, refer to the following link :
http://docs.oracle.com/cd/E11882_01/server.112/e23633/downgrade.htm#UPGRD00710
Downgrade Compatibility Matrix for Downgrading from 11.1.x
Source Database | Downgrade Possible to |
---|---|
11.1.x | 10.1.0.5.0 (or higher) |
11.1.x | 10.2.0.3.0 (or higher) |
For more information, refer to the following link :
http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/downgrade.htm#i1010243
Downgrade Compatibility Matrix for Downgrading from 10.2.x
Source Database | Downgrade Possible to |
---|---|
10.2.x | 9.2.0.6.0 (or higher) |
10.2.x | 10.1.0.4.0 (or higher) |
For more information, refer to the following link :
http://download.oracle.com/docs/cd/B19306_01/server.102/b14238/downgrade.htm#i1010243
Downgrade Compatibility Matrix for Downgrading from 10.1.x
Source Database | Downgrade Possible to |
---|---|
10.1.x | 9.2.0.4.0 (or higher) |
For more information, refer to the following link :
http://download.oracle.com/docs/cd/B14117_01/server.101/b10763/downgrade.htm#i1010243
Downgrade Compatibility Matrix for Downgrading from 9.2.x
Source Database | Downgrade Possible to |
---|---|
9.2.x | 9.0.1.3.0 (or higher) |
9.2.x | 8.1.7.3.0 (or higher) |
For more information, refer to the following link :
http://download.oracle.com/docs/cd/B10501_01/server.920/a96530/downgrad.htm#1008177
NOTE
1 : If you have applied a patchset since upgrading then it will not be possible to downgrade.
For example: If you upgraded from 9.2.0.6 to 10.2.0.1 and then applied the 10.2.0.3 patchset, then you cannot downgrade from 10.2.0.3 to 9.2.0.6. (You can only downgrade from 10.2.0.3 to 9.2.0.6 if you upgraded from 9.2.0.6 to 10.2.0.3)
2 : You can only downgrade to a version if you previously upgraded from that version.
For example: You can downgrade an 11.1.0.6 database to 10.2.0.3 only if you upgraded the database from 10.2.3. If you created a new 11.1.0.6 database, then you cannot downgrade the database to 10.2.0.3. Also, if you upgraded directly from 9.2.0.8 to 11.1.0.6, then you cannot downgrade to 10.2.0.3 since you did not upgrade from 10.2.0.3.
3 : You cannot downgrade if the database parameter COMPATIBLE was ever set higher than the version you upgraded from.
For example: If you upgraded from 10.2.0.3 to 11.1.0.6, then after the upgrade set COMPATIBLE to 11.1.0.6, then no downgrade is possible. Also, if you upgraded directly from 9.2.0.8 to 11.1.0.6, then after upgrade set COMPATIBLE to 10.2.0.1, then no downgrade is possible.
4 : You cannot upgrade database binaries from one major release to another.
For example : You cannot upgrade the binaries from 10.1.0.2.0 to 10.2.0.1.0. Major releases must be installed in a separate oracle home. You cannot install 10.2.0.x on any other major release to upgrade the oracle home.
注意事项
1、由于AutoUpgrade工具需要JDK版本1.8以上,11GR2的jdk版本为1.5不支持,需要升级JDK版本
官网翻译
Using AutoUpgrade for Oracle Database Upgrades
使用AutoUpgrade进行Oracle数据库升级
About Oracle Database AutoUpgrade
AutoUpgrade可在升级之前识别问题,执行升级前和升级后操作,部署升级,执行升级后操作以及启动升级Oracle数据库。
AutoUpgrade旨在在升级开始之前,升级部署期间以及升级后检查和配置迁移期间自动执行升级过程。在为新的Oracle数据库版本下载了二进制文件并设置了新的Oracle主目录之后,可以使用AutoUpgrade。使用自动升级时,可以使用单个配置文件同时升级多个Oracle数据库,该配置文件根据每个数据库部署的需要进行了自定义。
支持的版本和升级版本矩阵以及下载最新的autoupgrade.jar,
参考My Oracle Support文档2485457.1。
在Oracle Database 19c(19.3)和更高版本的目标Oracle主目录中,该文件autoupgrade.jar
默认存在。但是,在使用AutoUpgrade之前,Oracle强烈建议您下载最新的AutoUpgrade版本。每个发行更新(RU)都包含AutoUpgrade,但始终可以从My Oracle Support文档2485457.1获得最新的AutoUpgrade版本。
注意:AutoUpgrade可用于Oracle数据库企业版和Oracle数据库标准版。它不适用于Oracle Database Express Edition。
Preventing Issues: Analyze and Fixup Modes 预防问题:分析和修复模式
升级之前,在分析(Analyze)模式下,AutoUpgrade在升级之前对数据库执行只读分析,以便可以识别需要修复的问题。您可以在正常的数据库操作期间运行该实用程序。在Fixup模式下,AutoUpgrade可以检测并识别需要手动干预的两个修补程序,以及AutoUpgrade可以在升级部署阶段执行的修补程序。
Simplifying Upgrades: Deploy and Upgrade Modes 简化升级:部署和升级模式
在部署(Deploy)阶段,AutoUpgrade会修改您在配置文件中指示的数据库。它使您可以在升级期间调用自己的自定义脚本来配置数据库。在许多情况下,AutoUpgrade可以在升级过程中对数据库执行自动修复,而无需人工干预。
Deploy and Upgrade Postupgrade Checks and Fixes 部署和升级后检查和修复
使用部署或升级模式完成升级后,AutoUpgrade将执行升级后检查。它提供了一个过程,您可以根据在AutoUpgrade配置文件中提供的配置说明,在每个升级的数据库上运行自定义脚本,还可以在升级后过程中运行自动升级后修复程序。在部署模式,自动升级也证实,已成功升级,并复制数据库文件,例如sqlnet.ora
,tnsname.ora
和 listener.ora
从原始HOME到目标HOME,完成这些操作后,将在新的Oracle主目录中启动升级的Oracle数据库版本。
Checking for Java Version Support 检查Java版本支持
通常,您从要升级的Oracle主目录中启动AutoUpgrade JAR文件。但是,Oracle主目录必须包含Java 8。
AutoUpgrade是Java 8发行版JAR文件,在Oracle Database 12c Release 1 (12.1.0.2)之后的发行版中的Oracle数据库Oracle主页中提供。Oracle主目录中Java版本的路径是Oracle-home/jdk/bin/java,其中Oracle-home是源数据库Oracle主目录(您要升级的早期Oracle数据库版本)。例如:
1 | $ORACLE_HOME/jdk/bin/java -version |
结果应该是Java 8版本。例如:
1 2 3 4 5 | [oracle@sales]$ $ORACLE_HOME/jdk/bin/java -version build.version 20191125 build.date 2019/11/25 17:49:18 build.max_target_version 19 build.type production-19.7.2 |
升级Oracle Database 11g Release 2 (11.2.0.4)或更早的版本时,可以使用AutoUpgrade。但是,由于Java 8在Oracle Database 11g Release 2及更早版本的Oracle数据库Oracle主页中不可用,因此您必须从目标Oracle主页(要升级到的Oracle主页)中的Java版本启动AutoUpgrade。
成功的响应autoupgrade.jar -version
应该类似于以下内容:
1 2 3 4 | [oracle@sales ~]$ $ORACLE_HOME/jdk/bin/java -jar autoupgrade.jar -version build.version 20190201 build.date 2019/02/01 11:50:22 build.label RDBMS_PT.AUTOUPGRADE_LINUX.X64_190131.1800 |
如果您尝试使用Java 8之前的Java版本启动AutoUpgrade,则会发生以下错误:
1 2 3 4 | $ORACLE_HOME/jdk/bin/java -jar autoupgrade.jar -version Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at ... |
Examples of AutoUpgrade Workflows
AutoUpgrade with Source and Target Database Homes on Same Server (Typical)
在同一服务器上使用源数据库主页和目标数据库主页进行自动升级(典型)
当您的Oracle数据库源和目标Oracle主目录安装在同一台物理服务器上时,请使用此示例。
上下文:源ORACLE_HOME和目标ORACLE_HOME位于同一服务器上。
要开始分析(analysis),请输入以下命令。
1 | java -jar autoupgrade.jar -config config.txt -mode analyze |
该命令将生成一个报告,该报告指示该命令发现的所有错误情况。查看错误条件。如果相关,请自定义自动升级为解决错误情况而创建的修补程序。
要开始部署升级,请输入以下命令:
1 | java -jar autoupgrade.jar -config config.txt -mode deploy |
AutoUpgrade with Source and Target Database Homes on Different Servers
在不同服务器上使用源数据库主页和目标数据库主页进行自动升级
当Oracle数据库源和目标Oracle主目录位于不同的物理服务器上时,您必须在两个服务器上完成任务。
上下文:源ORACLE_HOME和目标ORACLE_HOME位于不同的物理服务器上。
要开始分析(analysis),请输入以下命令。
1 | java -jar autoupgrade.jar -config config.txt -mode analyze |
该命令将生成一个报告,该报告指示该命令发现的所有错误情况。查看错误条件。如果相关,请自定义自动升级为解决错误情况而创建的修补程序。
由于源和目标Oracle数据库Oracle主目录位于不同的服务器上,因此您需要在每个服务器上运行修订。
在源服务器上运行修补程序:
1java -jar autoupgrade.jar -config config.txt -mode fixups完成将源Oracle数据库从源服务器移动到目标服务器的任务。
在目标服务器上,以升级模式启动数据库,然后以
upgrade
模式运行自动升级:1java -jar autoupgrade.jar -config config.txt -mode upgrade
AutoUpgrade Messages and Process Description Terms
Overview of AutoUpgrade Job IDs
AutoUpgrade JOB是与升级关联的工作单元,由job标识符(jobid
)标识。
Job代表AutoUpgrade执行的一组操作。每个Job都经过一系列阶段来实现其目的。Job由唯一的正整数标识jobid
。每个新的AutoUpgrade job都会为在AutoUpgrade的配置文件中找到的每个数据库生成一个新的作业ID(jobid
)。如果AutoUpgrade检测到jobid
系统上不存在先前启动的数据库 ,则AutoUpgrade会将其识别jobid
为恢复(**resume**)操作。在恢复操作中,由jobid
从先前的AutoUpgrade运行中未完成的操作将从停止它们的位置继续。
Overview of AutoUpgrade Stages
AutoUpgrade jobs经过一系列阶段,称为stage,在这些阶段中执行特定操作。
在阶段中发生的操作由您为AutoUpgrade选择的处理模式定义:Analyze,Fixups,Deploy and Upgrade。
自动升级具有以下阶段:
- SETUP:AutoUpgrade job管理器在开始job时创建的初始阶段。
- PREUPGRADE:AutoUpgrade阶段,在此阶段,您将根据当前系统配置来确定系统是否准备升级,例如检查以确定您是否有足够的可用磁盘空间。
- PRECHECKS:AutoUpgrade分析您的源Oracle主目录以确定数据库是否满足升级要求的阶段。
- GRP:保证的还原点(GRP),由AutoUpgrade在开始升级过程之前创建。此选项仅适用于Oracle Database Enterprise Edition。它不适用于Oracle Database Standard Edition。即使AutoUpgrade默认情况下会创建GRP,Oracle还是强烈建议您在开始升级之前执行备份。
- PREFIXUPS:在开始升级之前,AutoUpgrade执行升级前修正的阶段。例如,这是AutoUpgrade在源Oracle主目录上收集字典统计信息的阶段。
- DRAIN:AutoUpgrade关闭数据库的阶段。
- DBUPGRADE:AutoUpgrade执行升级并编译在升级完成后发现的所有无效对象的阶段。
- POSTCHECKS:在启动升级后修订之前,AutoUpgrade对目标Oracle主目录(升级的Oracle数据库)执行检查的阶段。
- POSTFIXUPS:AutoUpgrade执行升级后修订程序(例如升级时区)的阶段。
- POSTUPGRADE:该阶段,其中AutoUpgrade副本或合并源Oracle主配置文件(
tnsnames.ora
,sqlnet.ora
,和其他文件)到目标ORACLE_HOME。
Overview of AutoUpgrade Stage Operations and States
在AutoUpgrade中,operation描述了阶段操作期间执行的操作,state表示阶段操作的状态。
Understanding Operation Messages \了解操作消息****
操作消息是内部阶段消息,描述了在自动升级状态期间发生的情况。有两种类型的操作消息。
准备(PREPARING):正在创建,初始化或调用AutoUpgrade实例,以准备完成AutoUpgrade阶段。这是一条信息消息。当您看到此消息时,没有任何操作要执行。
执行(EXECUTING):AutoUpgrade正在执行阶段的主要工作流程。这是一条信息消息。您无需执行任何操作。
Understanding State Messages 了解状态消息
状态消息指示显示该消息的阶段的当前工作流程的状态。有四种状态消息:
- ABORTED:AutoUpgrade停止执行阶段的工作流程中,响应于用户请求。
- ERROR:执行阶段工作流程时遇到错误。查看错误原因。
- FINISHED:AutoUpgrade成功地完成了阶段的工作流程。
- RUNNING:AutoUpgrade正在执行阶段工作流程。
About AutoUpgrade Processing Modes
Preparations for Running AutoUpgrade Processing Modes
您必须完成准备工作,然后才能运行AutoUpgrade处理(processing)模式。
在使用AutoUpgrade处理模式之前,请确认您满足以下要求:
您已经创建了用户配置文件。
AutoUpgrade已在原始Oracle主目录中启动并运行。如果重新启动AutoUpgrade,则必须在Oracle主目录中启动与升级流程中的阶段相对应的数据库。
运行数据库的服务器已在服务器主机文件(例如
/etc/hosts
)或域名服务器(DNS)上注册。如果您登录到目标数据库所在的服务器,那么在输入命令时应返回目标数据库主机名
hostname
。例如:$ hostname sales3
在容器数据库(CDB)上,要在其上运行升级的可插拔数据库(PDB)已打开,并使用AutoUpgrade本地参数pdbs在用户配置文件中对其进行了配置。
您已经下载或可以使用AutoUpgrade jar文件(
autoupgrade.jar
),并且可以使用Java 8发行版运行它。
从2019年1月发行更新(DBJAN2019RU
)起,Oracle Database 12c Release 2 (12.2) and Oracle Database 18c (18.5) 目标HOME支持AutoUpgrade。对于Oracle Database 12c Release 2 (12.2) and Oracle Database 18c (18.5) 目标目录,必须从My Oracle Support Document 2485457.1下载AutoUpgrade。
在Oracle Database 19c (19.3)和更高版本的目标Oracle主目录中,该文件autoupgrade.jar
默认存在。但是,在使用自动升级之前,Oracle强烈建议您下载最新版本,该版本可从My Oracle Support Document 2485457.1获得。
About the AutoUpgrade Analyze Processing Mode
AutoUpgrade Analyze(analyze
)处理模式将检查数据库以查看是否已准备好进行升级。
当您在分析模式下运行AutoUpgrade时,AutoUpgrade仅从数据库中读取数据,而不对数据库执行任何更新。您可以在正常工作时间使用Analyze模式运行AutoUpgrade。在设置目标版本的Oracle Database home之前,您可以在源Oracle Database home上以Analyze模式运行AutoUpgrade。
您可以使用以下语法在Analyze模式下启动AutoUpgrade,其中Java-8-home
是Java 8发行版的位置或Java 8 home的环境变量设置为:
1 | Java-8-home/bin/java -jar autoupgrade.jar -config yourconfig.txt -mode analyze |
Oracle Database Release 12.2 (12.2.0.1) 或更高版本的Oracle主目录默认具有有效的Java版本。使用以下语法在Analyze模式下启动AutoUpgrade,其中*Oracle_home*
是Oracle主目录或为Oracle主目录设置的环境变量,并且 yourconfig.txt
是您的配置文件:
1 | Oracle_home/jdk8/bin/java -jar autoupgrade.jar -config yourconfig.txt -mode analyze |
AutoUpgrade Analyze模式将生成两个输出文件,这些文件的名称分别为您检查的数据库的系统标识符(*SID*
):
*SID*.html
:使用网络浏览器查看此文件。*SID*_preupgrade.log
:使用文本编辑器查看此文件。
每个报告都标识了如果您不纠正它们而发生的升级错误,这些错误是通过运行自动修复脚本或通过手动纠正来进行的。如果发生错误,则会在用户日志文件和status.json
文件中报告这些错误。
分析模式还会在cfgtoollogs/upgrade/auto/status
路径中生成状态目录。该目录包含指示分析是成功还是失败的文件。此目录有两个JSON文件, status.json 和
progress.json
:
status.json
:一个高级状态JSON文件,其中包含升级的最终状态。progress.json
:一个JSON文件,其中包含代表配置文件执行的所有升级的当前进度。如果发生错误,则会在运行AutoUpgrade的用户的日志文件中以及status.json
文件中报告这些错误。
如果目标数据库Oracle主目录在服务器上不可用,则必须在配置文件中将源Oracle主目录参数设置为相同的路径,以便可以运行AutoUpgrade分析处理模式。例如:
1 2 3 4 5 6 7 8 | # # Source Home # sales3.source_home=d:\app\oracle\product\12.1.0\dbhome_1 # # Target Oracle Home # sales3.target_home=d:\app\oracle\product\12.1.0\dbhome_1 |
较早版本的AutoUpgrade需要您进行设置 target_home
。在更高版本的AutoUpgrade中,对于分析(Analyze)和修正(Fixups)模式都取消了此限制。
About the AutoUpgrade Fixup Processing Mode
AutoUpgrade Fixup (fixups
) 处理模式将分析您的数据库,并对必须进行更正的项目进行修复,然后才能执行升级。
在修复(fixups
)模式下运行AutoUpgrade时,AutoUpgrade执行的检查也将在分析(Analyze)模式下执行。完成这些检查后,AutoUpgrade将在开始升级之前执行修复所需的所有自动修复。当您计划将数据库移动到其他平台时,使用修复(fixups
)模式将准备升级数据库。
*警告:Oracle建议您先在分析(Analyze)模式下运行AutoUpgrade*,然后再在修复(fixups
)模式下运行AutoUpgrade。修复(fixups
)模式可以对源数据库进行更改。
作为升级准备的一部分,如果源数据库要求对可能在升级过程中导致错误的条件进行更正,则以修复(fixups
)模式运行的AutoUpgrade将对源数据库执行自动修复。因为在修复(fixups
)模式下运行AutoUpgrade是您在移至另一个系统时要执行的一个步骤,所以它不会创建有保证的还原点。Oracle建议您在正常工作时间之外运行此模式。
您可以使用以下语法在修复(fixups
)模式下启动AutoUpgrade,其中*Java-8-home*
Java 8发行版的位置,或为Java 8主目录设置的环境变量:
1 | Java-8-home/bin/java -jar autoupgrade.jar -config yourconfig.txt -mode fixup |
如果Java 8在您的源Oracle主*Oracle_home*
目录中,请使用以下语法在Fixup模式下启动AutoUpgrade,其中是Oracle主目录或为Oracle主目录设置的环境变量,并且yourconfig.txt
是您的配置文件:
1 | Oracle_home/jdk8/bin/java -jar autoupgrade.jar -config yourconfig.txt -mode fixup |
由于AutoUpgrade在Fixup模式下运行,因此它通过运行与Analyze模式下相同的预检查开始。然后,它在源数据库中运行自动修复程序以准备升级,并生成一个高级状态文件,指示修复程序操作的成功或失败。如果发生错误,则会在运行AutoUpgrade的用户的日志文件中报告这些错误。
警告:修复(fixups
)模式下的自动升级不会创建保证的还原点。在以Fixup模式启动AutoUpgrade之前,请确保已备份数据库。
About the AutoUpgrade Deploy Processing Mode
AutoUpgrade Deploy(deploy
)处理模式执行数据库的实际升级,并执行所有挂起的修补程序。
在运行Deploy之前,除了作为AutoUpgrade脚本的一部分运行的备份计划之外,还必须已经安装了目标Oracle主目录,并且还必须有一个备份计划。
您可以使用以下语法在Deploy模式下启动AutoUpgrade,其中*Oracle_home*
是Oracle主目录或为Oracle主目录设置的环境变量,并且yourconfig.txt
是您的配置文件:
1 | Oracle_home/jdk8/bin/java -jar autoupgrade.jar -config yourconfig.txt -mode deploy |
在Deploy模式下运行AutoUpgrade时,AutoUpgrade在数据库上运行所有升级操作,从升级前源数据库分析到升级后检查。 每个操作为下一个操作做准备。 如果发生错误,则操作将停止。 所有错误都记录到运行AutoUpgrade脚本的用户的日志文件中。 将为每个操作生成一个高级状态文件,该文件显示该操作的成功或失败。 如果仍然有未解决的修订程序(例如,如果您在Deploy模式下运行AutoUpgrade而不先在“分析和修补程序”模式下运行AutoUpgrade),则AutoUpgrade可以在Deploy模式下完成修订程序。
About the AutoUpgrade Upgrade Processing Mode
通过AutoUpgrade Upgrade (upgrade
)处理模式,可以在无法访问源Oracle主目录的情况下升级目标Oracle主目录。
您可以使用升级(Upgrade)模式将升级分为两个部分:首先,如果选择,则可以在其Oracle主目录上运行的源数据库上运行prefixups模式。其次,您使用升级模式在其新主目录上执行数据库的升级。要使用升级(Upgrade)模式,必须先在目标Oracle主目录中启动并运行数据库,然后才能在升级模式下运行AutoUpgrade。
您可以使用以下语法在升级(Upgrade )模式下启动AutoUpgrade,其中*Oracle_home*
是Oracle主目录或为Oracle主目录设置的环境变量,并且yourconfig.txt
是您的配置文件:
1 | Oracle_home/jdk8/bin/java -jar autoupgrade.jar -config yourconfig.txt -mode upgrade |
此命令在数据库上运行升级和升级后操作。当您将Oracle数据库移动到与原始源系统不同的系统时,请使用此选项,以使您无法使用自动升级部署模式。
由于AutoUpgrade在升级模式下运行,因此错误记录到运行AutoUpgrade脚本的用户的日志文件中。将为每个操作生成一个高级状态文件,该文件显示该操作的成功或失败。在升级模式下运行自动升级时,不执行升级后操作。
Understanding AutoUpgrade Workflows and Stages
AutoUpgrade工作流程可自动执行典型升级过程的每个步骤。运行的阶段取决于您选择的处理模式。
AutoUpgrade旨在使您能够以最少的人工干预执行升级。启动AutoUpgrade时,使用命令标识的配置文件将传递到AutoUpgrade作业管理器。作业管理器为您选择的处理模式创建所需的作业,并将该模式所需的数据结构传递给调度程序。然后,调度程序启动执行每个单独任务的低级模块。
AutoUpgrade Processing Mode Workflow Processing
要了解AutoUpgrade如何处理工作流程模式,请查看下图,该图显示了如何处理部署处理模式:
AutoUpgrade Processing Mode Stages
AutoUpgrade作业的阶段取决于您选择的处理模式。
有四种AutoUpgrade模式。对于每种模式,依次执行AutoUpgrade步骤。注意每种模式的步骤差异
- 分析(**Analyze**)模式:设置,预检查。
- 修复(**Fixups**)模式:安装,预检查,and Prefixups。
- 部署(**Deploy**)模式:设置,预升级,预检查,保证的还原点(GRP),前缀,排水,DB(数据库)升级,后检查和后升级。您可以在升级之前(升级前阶段)或升级之后(升级后阶段)运行自己的脚本,或者在升级之前和之后都运行自己的脚本。
- 升级(**Upgrade**)模式:安装程序,DB (database) 升级,后检查和后修复。
Understanding Non-CDB to PDB Upgrades with AutoUpgrade
您可以在单个操作中将non-CDB升级并转换为new CDB中的PDB,也可以先将Non-CDB数据库升级并转换为现有CDB中的PDB。
Oracle Database 19c是支持non-CDB Oracle Database体系结构的终端版本。Oracle强烈建议您转而使用可插拔数据库(PDB)。当您将数据库从non-CDB体系结构迁移到Oracle Database 19c中的PDB时,您在容器数据库(CDB)中最多可获得三个用户可配置的PDB,而无需多租户许可证。如果选择配置四个或更多PDB,则需要多租户许可证。
AutoUpgrade从non-CDB到PDB的功能为您提供了灵活的选项,以控制您在升级并将较早版本的non-CDB体系结构的Oracle数据库转换为多租户体系结构的数据库时如何升级现有的Oracle数据库。您可以通过一次操作执行此升级和转换。
*示例3-1* Non-CDB**到PDB的***AutoUpgrade*配置文件****
要使用Non-CDB到PDB选项,必须在AutoUpgrade配置文件中设置参数target_cdb。 target_cdb参数值定义要将非CDB Oracle数据库插入其中的容器数据库的Oracle系统标识符(SID)。 例如:
1 2 3 4 5 6 7 8 | global.autoupg_log_dir=/home/oracle/autoupg upg1.sid=s12201 upg1.source_home=/u01/product/12.2.0/dbhome_1 upg1.log_dir=/home/oracle/autoupg upg1.target_home=/u01/product/20.1.0/dbhome_1 upg1.target_base=/u01 upg1.target_version=19.1.0 upg1.target_cdb=cdb19x |