Oracle数据库升级RU和RUR实验

Oracle数据库升级RU和RUR实验本文包括两个实验 从 19 3 0 升级到 19 9 0 RU 升级 从 19 9 0 升级到 19 9 1 RUR 升级 基础环境准备 使用的是标准的 Vagrant Box 参考这里 安装完成后 版本为 19 3 0 下载 RU 和 RUR

大家好,我是讯享网,很高兴认识大家。

本文包括两个实验:

  1. 从19.3.0升级到19.9.0 (RU升级)
  2. 从19.9.0升级到19.9.1 (RUR升级)

基础环境准备

使用的是标准的Vagrant Box,参考这里。

安装完成后,版本为19.3.0。

下载RU和RUR

利用[Oracle补丁下载助手](Assistant: Download Reference for Oracle Database/GI Update, Revision, PSU, SPU(CPU), Bundle Patches, Patchsets and Base Releases (Doc ID .2))。

很好用,下载文件概况如下:

  • 19.9.0 RU/p__Linux-x86-64.zip/1.4G
  • 19.9.1 RUR/p__Linux-x86-64.zip/1.4G

查询patch的URL为:
https://support.oracle.com/epmos/faces/ui/patch/PatchDetail.jspx?patchId=

升级OPatch

如果直接升级,会因OPatch版本不够高而报错。因此需先升级OPatch。

过程参考Oracle数据库升级OPatch全过程

从19.3.0升级到19.9.0 (RU升级)

解压补丁到临时目录:

cd mkdir tmp cd tmp unzip /vagrant/p__Linux-x86-64.zip -d . $ ls  PatchSearch.xml 

讯享网

关闭数据库和监听:

讯享网$ sqlplus / as sysdba SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. $ lsnrctl stop 

打补丁:


讯享网

$ export PATH=$PATH:$ORACLE_HOME/OPatch $ which opatch /opt/oracle/product/19c/dbhome_1/OPatch/opatch $ cd  [oracle@oracle-19c-vagrant ]$ time opatch apply Oracle Interim Patch Installer version 12.2.0.1.24 Copyright (c) 2021, Oracle Corporation. All rights reserved. Oracle Home : /opt/oracle/product/19c/dbhome_1 Central Inventory : /opt/oracle/oraInventory from : /opt/oracle/product/19c/dbhome_1/oraInst.loc OPatch version : 12.2.0.1.24 OUI version : 12.2.0.7.0 Log file location : /opt/oracle/product/19c/dbhome_1/cfgtoollogs/opatch/opatch2021-02-21_07-02-22AM_1.log Verifying environment and performing prerequisite checks... OPatch continues with these patches:  Do you want to proceed? [y|n] y User Responded with: Y All checks passed. Please shutdown Oracle instances running out of this ORACLE_HOME on the local system. (Oracle Home = '/opt/oracle/product/19c/dbhome_1') Is the local system ready for patching? [y|n] y User Responded with: Y Backing up files... Applying interim patch '' to OH '/opt/oracle/product/19c/dbhome_1' ApplySession: Optional component(s) [ oracle.network.gsm, 19.0.0.0.0 ] , [ oracle.rdbms.ic, 19.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 19.0.0.0.0 ] , [ oracle.tfa, 19.0.0.0.0 ] , [ oracle.options.olap.awm, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.oraolap.mgmt, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.assistants.usm, 19.0.0.0.0 ] , [ oracle.assistants.asm, 19.0.0.0.0 ] , [ oracle.sqlj, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ] not present in the Oracle Home or a higher version is found. Patching component oracle.rdbms.rsf, 19.0.0.0.0... Patching component oracle.rdbms, 19.0.0.0.0... Patching component oracle.rdbms.util, 19.0.0.0.0... Patching component oracle.assistants.acf, 19.0.0.0.0... Patching component oracle.assistants.deconfig, 19.0.0.0.0... Patching component oracle.assistants.server, 19.0.0.0.0... Patching component oracle.buildtools.rsf, 19.0.0.0.0... Patching component oracle.ctx, 19.0.0.0.0... Patching component oracle.dbjava.ic, 19.0.0.0.0... Patching component oracle.dbjava.jdbc, 19.0.0.0.0... Patching component oracle.dbjava.ucp, 19.0.0.0.0... Patching component oracle.dbtoolslistener, 19.0.0.0.0... Patching component oracle.ldap.rsf, 19.0.0.0.0... Patching component oracle.network.rsf, 19.0.0.0.0... Patching component oracle.oracore.rsf, 19.0.0.0.0... Patching component oracle.rdbms.dbscripts, 19.0.0.0.0... Patching component oracle.rdbms.deconfig, 19.0.0.0.0... Patching component oracle.sdo, 19.0.0.0.0... Patching component oracle.sdo.locator.jrf, 19.0.0.0.0... Patching component oracle.sqlplus, 19.0.0.0.0... Patching component oracle.usm.deconfig, 19.0.0.0.0... Patching component oracle.rdbms.crs, 19.0.0.0.0... Patching component oracle.oraolap, 19.0.0.0.0... Patching component oracle.precomp.rsf, 19.0.0.0.0... Patching component oracle.javavm.client, 19.0.0.0.0... Patching component oracle.precomp.common.core, 19.0.0.0.0... Patching component oracle.network.client, 19.0.0.0.0... Patching component oracle.rdbms.scheduler, 19.0.0.0.0... Patching component oracle.ctx.atg, 19.0.0.0.0... Patching component oracle.marvel, 19.0.0.0.0... Patching component oracle.oraolap.dbscripts, 19.0.0.0.0... Patching component oracle.ovm, 19.0.0.0.0... Patching component oracle.bali.ice, 11.1.1.7.0... Patching component oracle.ctx.rsf, 19.0.0.0.0... Patching component oracle.rdbms.lbac, 19.0.0.0.0... Patching component oracle.rdbms.oci, 19.0.0.0.0... Patching component oracle.odbc, 19.0.0.0.0... Patching component oracle.rdbms.rman, 19.0.0.0.0... Patching component oracle.nlsrtl.rsf, 19.0.0.0.0... Patching component oracle.rdbms.install.plugins, 19.0.0.0.0... Patching component oracle.rdbms.drdaas, 19.0.0.0.0... Patching component oracle.ldap.rsf.ic, 19.0.0.0.0... Patching component oracle.ldap.security.osdt, 19.0.0.0.0... Patching component oracle.network.listener, 19.0.0.0.0... Patching component oracle.ons, 19.0.0.0.0... Patching component oracle.rdbms.dv, 19.0.0.0.0... Patching component oracle.javavm.server, 19.0.0.0.0... Patching component oracle.xdk, 19.0.0.0.0... Patching component oracle.ldap.owm, 19.0.0.0.0... Patching component oracle.dbdev, 19.0.0.0.0... Patching component oracle.rdbms.install.common, 19.0.0.0.0... Patching component oracle.sdo.locator, 19.0.0.0.0... Patching component oracle.duma, 19.0.0.0.0... Patching component oracle.sqlplus.ic, 19.0.0.0.0... Patching component oracle.xdk.rsf, 19.0.0.0.0... Patching component oracle.xdk.parser.java, 19.0.0.0.0... Patching component oracle.rdbms.rsf.ic, 19.0.0.0.0... Patching component oracle.precomp.common, 19.0.0.0.0... Patching component oracle.precomp.lang, 19.0.0.0.0... Patching component oracle.jdk, 1.8.0.201.0... Patch  successfully applied. Sub-set patch [] has become inactive due to the application of a super-set patch []. Please refer to Doc ID .1 for any possible further required actions. Log file location: /opt/oracle/product/19c/dbhome_1/cfgtoollogs/opatch/opatch2021-02-21_07-02-22AM_1.log OPatch succeeded. real 5m20.318s user 3m29.001s sys 0m47.564s 

7月10日做了一次到19.11的升级,耗时为:

讯享网OPatch succeeded. real 6m44.056s user 1m57.009s sys 0m33.108s 

启动数据库和监听:

[oracle@oracle-19c-vagrant ]$ lsnrctl start LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 21-FEB-2021 08:55:59 Copyright (c) 1991, 2020, Oracle. All rights reserved. Starting /opt/oracle/product/19c/dbhome_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 19.0.0.0.0 - Production System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora Log messages written to /opt/oracle/diag/tnslsnr/oracle-19c-vagrant/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 21-FEB-2021 08:55:59 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora Listener Log File /opt/oracle/diag/tnslsnr/oracle-19c-vagrant/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) The listener supports no services The command completed successfully [oracle@oracle-19c-vagrant ]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Sun Feb 21 08:55:14 2021 Version 19.9.0.0.0 Copyright (c) 1982, 2020, Oracle. All rights reserved. Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area  bytes Fixed Size  bytes Variable Size  bytes Database Buffers  bytes Redo Buffers  bytes Database mounted. Database opened. SQL> exit Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.9.0.0.0 

验证,版本对的,PDB状态正常:

讯享网[oracle@oracle-19c-vagrant ]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Sun Feb 21 08:56:39 2021 Version 19.9.0.0.0 Copyright (c) 1982, 2020, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.9.0.0.0 SQL> select banner_full from v$version; BANNER_FULL -------------------------------------------------------------------------------- Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.9.0.0.0 SQL> alter session set container=orclpdb1; Session altered. SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 3 ORCLPDB1 READ WRITE NO 

从19.9.0升级到19.9.1 (RUR升级)

升级RUR和RU并没有区别。简明过程如下:

cd mkdir tmp cd tmp unzip /vagrant/p__Linux-x86-64.zip -d . lsnrctl stop echo "shutdown immediate" | sqlplus / as sysdba export PATH=$PATH:$ORACLE_HOME/OPatch cd  opatch apply 

打补丁耗时5分钟,和前面RU接近:

讯享网[oracle@oracle-19c-vagrant ]$ time opatch apply Oracle Interim Patch Installer version 12.2.0.1.24 Copyright (c) 2021, Oracle Corporation. All rights reserved. Oracle Home : /opt/oracle/product/19c/dbhome_1 Central Inventory : /opt/oracle/oraInventory from : /opt/oracle/product/19c/dbhome_1/oraInst.loc OPatch version : 12.2.0.1.24 OUI version : 12.2.0.7.0 Log file location : /opt/oracle/product/19c/dbhome_1/cfgtoollogs/opatch/opatch2021-02-21_09-23-08AM_1.log Verifying environment and performing prerequisite checks... OPatch continues with these patches:  Do you want to proceed? [y|n] y User Responded with: Y All checks passed. Please shutdown Oracle instances running out of this ORACLE_HOME on the local system. (Oracle Home = '/opt/oracle/product/19c/dbhome_1') Is the local system ready for patching? [y|n] y User Responded with: Y Backing up files... Applying interim patch '' to OH '/opt/oracle/product/19c/dbhome_1' ApplySession: Optional component(s) [ oracle.network.gsm, 19.0.0.0.0 ] , [ oracle.rdbms.ic, 19.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 19.0.0.0.0 ] , [ oracle.tfa, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ] not present in the Oracle Home or a higher version is found. Patching component oracle.rdbms, 19.0.0.0.0... Patching component oracle.rdbms.util, 19.0.0.0.0... Patching component oracle.rdbms.rsf, 19.0.0.0.0... Patching component oracle.assistants.acf, 19.0.0.0.0... Patching component oracle.assistants.deconfig, 19.0.0.0.0... Patching component oracle.assistants.server, 19.0.0.0.0... Patching component oracle.buildtools.rsf, 19.0.0.0.0... Patching component oracle.ctx, 19.0.0.0.0... Patching component oracle.dbjava.ic, 19.0.0.0.0... Patching component oracle.dbjava.jdbc, 19.0.0.0.0... Patching component oracle.dbjava.ucp, 19.0.0.0.0... Patching component oracle.dbtoolslistener, 19.0.0.0.0... Patching component oracle.ldap.owm, 19.0.0.0.0... Patching component oracle.ldap.rsf, 19.0.0.0.0... Patching component oracle.network.rsf, 19.0.0.0.0... Patching component oracle.oracore.rsf, 19.0.0.0.0... Patching component oracle.rdbms.dbscripts, 19.0.0.0.0... Patching component oracle.rdbms.deconfig, 19.0.0.0.0... Patching component oracle.sdo, 19.0.0.0.0... Patching component oracle.sdo.locator.jrf, 19.0.0.0.0... Patching component oracle.sqlplus, 19.0.0.0.0... Patching component oracle.sqlplus.ic, 19.0.0.0.0... Patching component oracle.ldap.rsf.ic, 19.0.0.0.0... Patching component oracle.rdbms.install.plugins, 19.0.0.0.0... Patching component oracle.xdk.parser.java, 19.0.0.0.0... Patching component oracle.odbc, 19.0.0.0.0... Patching component oracle.ons, 19.0.0.0.0... Patching component oracle.rdbms.rman, 19.0.0.0.0... Patching component oracle.oraolap, 19.0.0.0.0... Patching component oracle.rdbms.crs, 19.0.0.0.0... Patching component oracle.ovm, 19.0.0.0.0... Patching component oracle.rdbms.drdaas, 19.0.0.0.0... Patching component oracle.rdbms.oci, 19.0.0.0.0... Patching component oracle.dbdev, 19.0.0.0.0... Patching component oracle.ctx.rsf, 19.0.0.0.0... Patching component oracle.sdo.locator, 19.0.0.0.0... Patching component oracle.rdbms.lbac, 19.0.0.0.0... Patching component oracle.rdbms.dv, 19.0.0.0.0... Patching component oracle.nlsrtl.rsf, 19.0.0.0.0... Patching component oracle.rdbms.scheduler, 19.0.0.0.0... Patching component oracle.network.client, 19.0.0.0.0... Patching component oracle.oraolap.dbscripts, 19.0.0.0.0... Patching component oracle.precomp.rsf, 19.0.0.0.0... Patching component oracle.javavm.client, 19.0.0.0.0... Patching component oracle.precomp.common.core, 19.0.0.0.0... Patching component oracle.rdbms.install.common, 19.0.0.0.0... Patching component oracle.ldap.security.osdt, 19.0.0.0.0... Patching component oracle.xdk, 19.0.0.0.0... Patching component oracle.network.listener, 19.0.0.0.0... Patching component oracle.ldap.client, 19.0.0.0.0... Patching component oracle.marvel, 19.0.0.0.0... Patching component oracle.xdk.rsf, 19.0.0.0.0... Patching component oracle.javavm.server, 19.0.0.0.0... Patching component oracle.duma, 19.0.0.0.0... Patching component oracle.ctx.atg, 19.0.0.0.0... Patching component oracle.rdbms.rsf.ic, 19.0.0.0.0... Patching component oracle.precomp.common, 19.0.0.0.0... Patching component oracle.precomp.lang, 19.0.0.0.0... Patching component oracle.jdk, 1.8.0.201.0... Patch  successfully applied. Sub-set patch [] has become inactive due to the application of a super-set patch []. Please refer to Doc ID .1 for any possible further required actions. Log file location: /opt/oracle/product/19c/dbhome_1/cfgtoollogs/opatch/opatch2021-02-21_09-23-08AM_1.log OPatch succeeded. real 5m31.091s user 4m30.302s sys 0m45.906s 

验证,启动信息显示版本升级到了19.9.1:

lsnrctl start $ echo "startup"|sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Sun Feb 21 09:39:34 2021 Version 19.9.1.0.0 Copyright (c) 1982, 2020, Oracle. All rights reserved. Connected to an idle instance. SQL> ORACLE instance started. Total System Global Area  bytes Fixed Size  bytes Variable Size  bytes Database Buffers  bytes Redo Buffers  bytes Database mounted. Database opened. SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.9.1.0.0 

清理

清理包括两部分:

  1. 删除解压的补丁
  2. 清理patch_storage目录

Patch过程中备份的文件在$ORACLE_HOME/.patch_storage目录。但这个目录时隐藏目录,不要直接删,而应该用opatch命令删。可是似乎没效果:

讯享网[oracle@oracle-19c-vagrant dbhome_1]$ du -sh .patch_storage/ 2.6G .patch_storage/ [oracle@oracle-19c-vagrant ]$ opatch util cleanup Oracle Interim Patch Installer version 12.2.0.1.24 Copyright (c) 2021, Oracle Corporation. All rights reserved. Oracle Home : /opt/oracle/product/19c/dbhome_1 Central Inventory : /opt/oracle/oraInventory from : /opt/oracle/product/19c/dbhome_1/oraInst.loc OPatch version : 12.2.0.1.24 OUI version : 12.2.0.7.0 Log file location : /opt/oracle/product/19c/dbhome_1/cfgtoollogs/opatch/opatch2021-02-21_09-32-28AM_1.log Invoking utility "cleanup" OPatch will clean up 'restore.sh,make.txt' files and 'scratch,backup' directories. You will be still able to rollback patches after this cleanup. Do you want to proceed? [y|n] y User Responded with: Y Backup area for restore has been cleaned up. For a complete list of files/directories deleted, Please refer log file. OPatch succeeded. [oracle@oracle-19c-vagrant dbhome_1]$ du -sh .patch_storage/ 2.6G .patch_storage/ 

如何清理参见:

  • How To Avoid Disk Full Issues Because OPatch Backups Take Big Amount Of Disk Space. (Doc ID .1)
  • Can You Delete $ORACLE_HOME/.patch_storage Directory ? (Doc ID .1)

错误处理

在打RUR补丁时,出现了空间不够的情况,此时删除掉第1个补丁解压文件就好了。

$ time opatch apply Oracle Interim Patch Installer version 12.2.0.1.24 Copyright (c) 2021, Oracle Corporation. All rights reserved. Oracle Home : /opt/oracle/product/19c/dbhome_1 Central Inventory : /opt/oracle/oraInventory from : /opt/oracle/product/19c/dbhome_1/oraInst.loc OPatch version : 12.2.0.1.24 OUI version : 12.2.0.7.0 Log file location : /opt/oracle/product/19c/dbhome_1/cfgtoollogs/opatch/opatch2021-02-21_09-19-33AM_1.log Verifying environment and performing prerequisite checks... Prerequisite check "CheckSystemSpace" failed. The details are: Required amount of space(5896.646MB) is not available. UtilSession failed: Prerequisite check "CheckSystemSpace" failed. Log file location: /opt/oracle/product/19c/dbhome_1/cfgtoollogs/opatch/opatch2021-02-21_09-19-33AM_1.log OPatch failed with error code 73 
小讯
上一篇 2025-03-14 22:39
下一篇 2025-03-27 18:55

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/122844.html