Oracle数据库一键升级工具AutoUpgrade介绍(Doc ID 2485457.1、1577660.1)

0    1031    1

Tags:

👉 本文共约34848个字,系统预计阅读时间或需132分钟。

目录

自动升级工具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),是一个轻量级的命令行工具,可以协助我们实现升级数据库自动化。

Oracle数据库一键升级工具AutoUpgrade介绍(Doc ID 2485457.1、1577660.1)

通过AutoUpgrade Tool可以同时升级一个或多个数据库,AutoUpgrade会自动运行升级前的预检查任务,在需要的地方执行自动修复(能修复99%的潜在问题),接着执行升级数据库,最后完成升级后的后续动作(比如编译失效对象,调整时区、更新密码文件、spfile以及/etc/oratab等)。整个过程我们无需干预,只需要一个命令和一个配置文件,AutoUpgrade显著减少了与数据库升级相关的手工工作,使数据库升级过程更简单,从而大大降低风险。

Oracle数据库一键升级工具AutoUpgrade介绍(Doc ID 2485457.1、1577660.1)

截止到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工作流程

https://docs.oracle.com/en/database/oracle/oracle-database/19/upgrd/understanding-autoupgrade-workflows-stages.html#GUID-8C1FC4E1-2C9C-4CBC-AF5B-95F311D73BE4

比如java -jar $OH19/rdbms/admin/autoupgrade.jar -config config.txt -mode deploy这个命令,该命令会读取配置文件coonfig.txt,启动一个升级job,然后由该job负责完成升级阶段的所有工作。如果升级过程中出现特殊问题,解决该问题后,可以从失败的地方继续执行。

Oracle数据库一键升级工具AutoUpgrade介绍(Doc ID 2485457.1、1577660.1)

AutoUpgrade工作内容

Autoupgrade的四种模式。我们常用的是analyze和deploy

Oracle数据库一键升级工具AutoUpgrade介绍(Doc ID 2485457.1、1577660.1)

每个阶段执行的内容:

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的文档

Oracle数据库一键升级工具AutoUpgrade介绍(Doc ID 2485457.1、1577660.1)

Autoupgrade非常完美

通过日志我们可以看出,autoupgrade真的是太贴心了,做了很多东西。

  1. 创建spfile

  2. 更新/etc/oratab

  3. 复制tnsnames.ora,listener.ora,sqlnet.ora到新ORACLE HOME

  4. 执行srvctl upgrade database

  5. 健康检查

Oracle数据库一键升级工具AutoUpgrade介绍(Doc ID 2485457.1、1577660.1)

Reference

https://docs.oracle.com/en/database/oracle/oracle-database/19/upgrd/using-autoupgrade-oracle-database-upgrades.html

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.

官网: https://docs.oracle.com/en/database/oracle/oracle-database/21/upgrd/using-autoupgrade-oracle-database-upgrades.html

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

数据库 升级/降级 兼容性矩阵 (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(OCP、OCM)、MySQL(OCP)、PostgreSQL(PGCA、PGCE、PGCM)等数据库的培训和考证业务,私聊QQ646634621或微信db_bao,谢谢!
Oracle数据库一键升级工具AutoUpgrade介绍(Doc ID 2485457.1、1577660.1)后续精彩内容已被小麦苗无情隐藏,请输入验证码解锁本站所有文章!
验证码:
请先关注本站微信公众号,然后回复“验证码”,获取验证码。在微信里搜索“DB宝”或者“www_xmmup_com”或者微信扫描右侧二维码都可以关注本站微信公众号。

标签:

Avatar photo

小麦苗

学习或考证,均可联系麦老师,请加微信db_bao或QQ646634621

您可能还喜欢...

发表回复

嘿,我是小麦,需要帮助随时找我哦。
  • 18509239930
  • 个人微信

  • DB宝
  • 个人邮箱
  • 点击加入QQ群
  • 个人微店

  • 回到顶部