redhat 8.5 oracle 19.3 restart环境升级

网友投稿 660 2022-09-02

redhat 8.5 oracle 19.3 restart环境升级

redhat 8.5 oracle 19.3 restart环境升级

1.查看当前环境

[grid@asm01 ~]$ crsctl query has softwareversionOracle High Availability Services version on the local node is [19.0.0.0.0][grid@asm01 ~]$ crsctl query has releaseversionOracle High Availability Services release version on the local node is [19.0.0.0.0][grid@asm01 ~]$ crsctl check hasCRS-4638: Oracle High Availability Services is online[grid@asm01 ~]$ /u01/app/oracle/product/19.3.0/dbhome_1/OPatch/opatch lspatches29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)29517247;ACFS RELEASE UPDATE 19.3.0.0.0 (29517247)29517242;Database Release Update : 19.3.0.0.190416 (29517242)29401763;TOMCAT RELEASE UPDATE 19.0.0.0.0 (29401763)OPatch succeeded.

2.升级OPatch

[root@asm01 ~]# su - oracle[oracle@asm01 ~]$ cd $ORACLE_HOME/OPatch/[oracle@asm01 OPatch]$ ./opatch versionOPatch Version: 12.2.0.1.17OPatch succeeded.[oracle@asm01 OPatch]$ cd $ORACLE_HOME[oracle@asm01 dbhome_1]$ mv OPatch/ OPatchbak[oracle@asm01 dbhome_1]$ unzip /tmp/p6880880_190000_Linux-x86-64.zip -d $ORACLE_HOME[oracle@asm01 dbhome_1]$ cd /u01/app/oracle/product/19.3.0/dbhome_1/OPatch[oracle@asm01 OPatch]$ ./opatch versionOPatch Version: 12.2.0.1.27OPatch succeeded.升级grid用户OPatch[root@asm01 ~]# cd /u01/app/19.3.0/grid[root@asm01 grid]# mv OPatch/ OPatchbak[root@asm01 grid]# unzip /tmp/p6880880_190000_Linux-x86-64.zip[root@asm01 grid]# chown -R grid.oinstall OPatch[root@asm01 grid]# cd OPatch[root@asm01 OPatch]# ./opatch versionOPatch Version: 12.2.0.1.27OPatch succeeded.

3.验证Oracle Inventory的有效性​

[grid@asm01 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME[oracle@asm01 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME

4.查看19.12 RU包p33182768_190000_Linux-x86-64.zip为grid的升级包p33192793_190000_Linux-x86-64.zip为oracle的升级包

[root@asm01 tmp]# chown -R grid.oinstall p33182768

5.检查Patch 是否冲突

[grid@asm01 tmp]$ cat /tmp/patch_list_gihome.txt /tmp/33182768/32585572/tmp/33182768/33192793/tmp/33182768/33208107/tmp/33182768/33208123/tmp/33182768/33239955[grid@asm01 tmp]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txtOracle Interim Patch Installer version 12.2.0.1.27Copyright (c) 2022, Oracle Corporation. All rights reserved.PREREQ sessionOracle Home : /u01/app/19.3.0/gridCentral Inventory : /u01/app/oraInventory from : /u01/app/19.3.0/grid/oraInst.locOPatch version : 12.2.0.1.27OUI version : 12.2.0.7.0Log file location : /u01/app/19.3.0/grid/cfgtoollogs/opatch/opatch2022-01-14_10-00-30AM_1.logInvoking prereq "checksystemspace"Prereq "checkSystemSpace" passed.OPatch succeeded.

安装grid包

[root@asm01 OPatch]# ./opatchauto apply /tmp/33182768/ -oh /u01/app/19.3.0/gridOPatchauto session is initiated at Fri Jan 14 10:04:14 2022System initialization log file is /u01/app/19.3.0/grid/cfgtoollogs/opatchautodb/systemconfig2022-01-14_10-04-21AM.log.Session log file is /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/opatchauto2022-01-14_10-04-27AM.logThe id for this session is JGSIExecuting OPatch prereq operations to verify patch applicability on home /u01/app/19.3.0/gridPatch applicability verified successfully on home /u01/app/19.3.0/gridExecuting patch validation checks on home /u01/app/19.3.0/gridPatch validation checks successfully completed on home /u01/app/19.3.0/gridPerforming prepatch operations on CRS - bringing down CRS service on home /u01/app/19.3.0/gridPrepatch operation log file location: /u01/app/grid/crsdata/asm01/crsconfig/hapatch_2022-01-14_10-05-27AM.logCRS service brought down successfully on home /u01/app/19.3.0/gridStart applying binary patch on home /u01/app/19.3.0/grid Binary patch applied successfully on home /u01/app/19.3.0/gridPerforming postpatch operations on CRS - starting CRS service on home /u01/app/19.3.0/gridPostpatch operation log file location: /u01/app/grid/crsdata/asm01/crsconfig/hapatch_2022-01-14_10-19-50AM.logCRS service started successfully on home /u01/app/19.3.0/gridOPatchAuto successful.--------------------------------Summary--------------------------------Patching is completed successfully. Please find the summary as follows:Host:asm01SIHA Home:/u01/app/19.3.0/gridVersion:19.0.0.0.0Summary:==Following patches were SUCCESSFULLY applied:Patch: /tmp/33182768/32585572Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-14_10-05-56AM_1.logPatch: /tmp/33182768/33192793Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-14_10-05-56AM_1.logPatch: /tmp/33182768/33208107Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-14_10-05-56AM_1.logPatch: /tmp/33182768/33208123Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-14_10-05-56AM_1.logPatch: /tmp/33182768/33239955Log: /u01/app/19.3.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-14_10-05-56AM_1.logOPatchauto session completed at Fri Jan 14 10:21:08 2022Time taken to complete the session 16 minutes, 55 seconds[grid@asm01 ~]$ cd /u01/app/19.3.0/grid/OPatch[grid@asm01 OPatch]$ ./opatch lspatches33239955;TOMCAT RELEASE UPDATE 19.0.0.0.0 (33239955)33208123;OCW RELEASE UPDATE 19.13.0.0.0 (33208123)33208107;ACFS RELEASE UPDATE 19.13.0.0.0 (33208107)33192793;Database Release Update : 19.13.0.0.211019 (33192793)32585572;DBWLM RELEASE UPDATE 19.0.0.0.0 (32585572)OPatch succeeded.

开始升级 DB RU (RELEASE UPDATE) 补丁

[root@asm01 ~]# cd /u01/app/oracle/product/19.3.0/dbhome_1/OPatch[root@asm01 OPatch]# ./opatchauto apply /tmp/33192793 -oh /u01/app/oracle/product/19.3.0/dbhome_1/OPatchauto session is initiated at Fri Jan 14 13:23:38 2022System initialization log file is /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatchautodb/systemconfig2022-01-14_01-23-52PM.log.Session log file is /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatchauto/opatchauto2022-01-14_01-24-01PM.logThe id for this session is YULEExecuting OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/19.3.0/dbhome_1Patch applicability verified successfully on home /u01/app/oracle/product/19.3.0/dbhome_1Executing patch validation checks on home /u01/app/oracle/product/19.3.0/dbhome_1Patch validation checks successfully completed on home /u01/app/oracle/product/19.3.0/dbhome_1Verifying SQL patch applicability on home /u01/app/oracle/product/19.3.0/dbhome_1SQL patch applicability verified successfully on home /u01/app/oracle/product/19.3.0/dbhome_1Preparing to bring down database service on home /u01/app/oracle/product/19.3.0/dbhome_1Successfully prepared home /u01/app/oracle/product/19.3.0/dbhome_1 to bring down database serviceBringing down database service on home /u01/app/oracle/product/19.3.0/dbhome_1Database service successfully brought down on home /u01/app/oracle/product/19.3.0/dbhome_1Start applying binary patch on home /u01/app/oracle/product/19.3.0/dbhome_1 Binary patch applied successfully on home /u01/app/oracle/product/19.3.0/dbhome_1Starting database service on home /u01/app/oracle/product/19.3.0/dbhome_1Database service successfully started on home /u01/app/oracle/product/19.3.0/dbhome_1Preparing home /u01/app/oracle/product/19.3.0/dbhome_1 after database service restartedNo step execution required.........Trying to apply SQL patch on home /u01/app/oracle/product/19.3.0/dbhome_1SQL patch applied successfully on home /u01/app/oracle/product/19.3.0/dbhome_1OPatchAuto successful.--------------------------------Summary--------------------------------Patching is completed successfully. Please find the summary as follows:Host:asm01SIDB Home:/u01/app/oracle/product/19.3.0/dbhome_1Version:19.0.0.0.0Summary:==Following patches were SUCCESSFULLY applied:Patch: /tmp/33192793Log: /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-14_13-25-17PM_1.logPatching session reported following warning(s): _________________________________________________[WARNING] The database instance 'testdb' from '/u01/app/oracle/product/19.3.0/dbhome_1', in host'asm01' is not running. SQL changes, if any, will not be applied.To apply. the SQL changes, bring up the database instance and run the command manually from any one node (run as oracle).Refer to the readme to get the correct steps for applying the sql changes.OPatchauto session completed at Fri Jan 14 13:39:01 2022Time taken to complete the session 15 minutes, 25 seconds

更新数字字典

[root@asm01 OPatch]# su - oracles[oracle@asm01 ~]$ sqlplus / as sysdbaSQL*Plus: Release 19.0.0.0.0 - Production on Fri Jan 14 13:40:55 2022Version 19.13.0.0.0Copyright (c) 1982, 2021, Oracle. All rights reserved.Connected to an idle instance.SQL> startupORACLE instance started.Total System Global Area 2516579048 bytesFixed Size 9138920 bytesVariable Size 620756992 bytesDatabase Buffers 1879048192 bytesRedo Buffers 7634944 bytesDatabase mounted.Database opened.SQL> show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB01 MOUNTEDSQL> alter session set container=pdb01;Session altered.SQL> alter pluggable database open;Pluggable database altered.SQL> quitDisconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - ProductionVersion 19.13.0.0.0[oracle@asm01 ~]$ cd $ORACLE_HOME/OPatch[oracle@asm01 OPatch]$ ./datapatch -verboseSQL Patching tool version 19.13.0.0.0 Production on Fri Jan 14 13:43:46 2022Copyright (c) 2012, 2021, Oracle. All rights reserved.Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_7294_2022_01_14_13_43_46/sqlpatch_invocation.logConnecting to database...OKGathering database info...doneNote: Datapatch will only apply or rollback SQL fixes for PDBs that are in an open state, no patches will be applied to closed PDBs. Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation (Doc ID 1585822.1)Bootstrapping registry and package to current versions...doneDetermining current state...doneCurrent state of interim SQL patches: No interim patches foundCurrent state of release update SQL patches: Binary registry: 19.13.0.0.0 Release_Update 211004165050: Installed PDB CDB$ROOT: Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 09-JAN-22 11.18.17.230073 PM PDB PDB$SEED: Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 09-JAN-22 11.28.22.707378 PM PDB PDB01: Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 09-JAN-22 11.28.22.707378 PMAdding patches to installation queue and performing prereq checks...doneInstallation queue: For the following PDBs: CDB$ROOT PDB$SEED PDB01 No interim patches need to be rolled back Patch 33192793 (Database Release Update : 19.13.0.0.211019 (33192793)): Apply from 19.3.0.0.0 Release_Update 190410122720 to 19.13.0.0.0 Release_Update 211004165050 No interim patches need to be appliedInstalling patches... Patch installation complete. Total patches installed: 3Validating logfiles...donePatch 33192793 apply (pdb CDB$ROOT): SUCCESS logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33192793/24462514/33192793_apply_TESTDB_CDBROOT_2022Jan14_13_45_20.log (no errors)Patch 33192793 apply (pdb PDB$SEED): SUCCESS logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33192793/24462514/33192793_apply_TESTDB_PDBSEED_2022Jan14_13_57_10.log (no errors)Patch 33192793 apply (pdb PDB01): SUCCESS logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33192793/24462514/33192793_apply_TESTDB_PDB01_2022Jan14_13_57_10.log (no errors)Automatic recompilation incomplete; run utlrp.sql to revalidate. PDBs: PDB01 PDB$SEEDSQL Patching tool complete on Fri Jan 14 14:07:01 2022[oracle@asm01 OPatch]$ cd $ORACLE_HOME/rdbms/admin[oracle@asm01 admin]$ sqlplus / as sysdbaSQL*Plus: Release 19.0.0.0.0 - Production on Fri Jan 14 14:10:35 2022Version 19.13.0.0.0Copyright (c) 1982, 2021, Oracle. All rights reserved.Connected to:Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - ProductionVersion 19.13.0.0.0SQL> @utlrp.sqlSession altered.TIMESTAMP--------------------------------------------------------------------------------COMP_TIMESTAMP UTLRP_BGN 2022-01-14 14:11:05DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalidDOC> objects in the database. Recompilation time is proportional to theDOC> number of invalid objects in the database, so this command may takeDOC> a long time to execute on a database with a large number of invalidDOC> objects.DOC>DOC> Use the following queries to track recompilation progress:DOC>DOC> 1. Query returning the number of invalid objects remaining. ThisDOC> number should decrease with time.DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);DOC>DOC> 2. Query returning the number of objects compiled so far. This numberDOC> should increase with time.DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;DOC>DOC> This script automatically chooses serial or parallel recompilationDOC> based on the number of CPUs available (parameter cpu_count) multipliedDOC> by the number of threads per CPU (parameter parallel_threads_per_cpu).DOC> On RAC, this number is added across all RAC nodes.DOC>DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallelDOC> recompilation. Jobs are created without instance affinity so that theyDOC> can migrate across RAC nodes. Use the following queries to verifyDOC> whether UTL_RECOMP jobs are being created and run correctly:DOC>DOC> 1. Query showing jobs created by UTL_RECOMPDOC> SELECT job_name FROM dba_scheduler_jobsDOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';DOC>DOC> 2. Query showing UTL_RECOMP jobs that are runningDOC> SELECT job_name FROM dba_scheduler_running_jobsDOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';DOC>#PL/SQL procedure successfully completed.TIMESTAMP--------------------------------------------------------------------------------COMP_TIMESTAMP UTLRP_END 2022-01-14 14:11:07DOC> The following query reports the number of invalid objects.DOC>DOC> If the number is higher than expected, please examine the errorDOC> messages reported with each object (using SHOW ERRORS) to see if theyDOC> point to system misconfiguration or resource constraints that must beDOC> fixed before attempting to recompile these objects.DOC>#OBJECTS WITH ERRORS------------------- 0DOC> The following query reports the number of exceptions caught duringDOC> recompilation. If this number is non-zero, please query the errorDOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errorsDOC> are due to misconfiguration or resource constraints that must beDOC> fixed before objects can compile successfully.DOC> Note: Typical compilation errors (due to coding errors) are notDOC> logged into this table: they go into DBA_ERRORS instead.DOC>#ERRORS DURING RECOMPILATION--------------------------- 0Function created.PL/SQL procedure successfully completed.Function dropped.PL/SQL procedure successfully completed.

Linux,oracle

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:SqlServer旁门左道之启动报错(cannot find one or more components.Please reinstall the application。)终极解决方案
下一篇:Swagger 生成 PHP API 接口文档详细步骤
相关文章

 发表评论

暂时没有评论,来抢沙发吧~