【kingsql分享】Oracle 18c RAC補丁升級實戰【DBRU】

kingsql發表於2019-01-04

一.補丁編號

2******5


二.升級步驟

1.檢視Oracle CRS版本資訊

[grid@rac02 ~]$ crsctl query crs softwareversion

Oracle Clusterware version on node [rac02] is [18.0.0.0.0]


2.檢查資料庫RDBMS版本

SQL> select * from v$version;

 

BANNER

--------------------------------------------------------------------------------

BANNER_FULL

--------------------------------------------------------------------------------

BANNER_LEGACY

--------------------------------------------------------------------------------

    CON_ID

----------

Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production

Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production

Version 18.4.0.0.0

Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production

         0


3.檢查是否已安裝2******5補丁

[oracle@rac02 ~]$ /u01/app/oracle/product/18.0.0.0/db_1/OPatch/opatch lsinventory -all -oh $ORACLE_HOME


4.檢查當前Opatch版本

[oracle@rac02 ~]$ $ORACLE_HOME/OPatch/opatch version

OPatch Version: 12.2.0.1.16


OPatch succeeded.


5.備份資料庫


6.清理補丁備份目錄中的無效備份集

[oracle@rac02 ~]$ $ORACLE_HOME/OPatch/opatch util cleanup

Oracle Interim Patch Installer version 12.2.0.1.16

Copyright (c) 2018, Oracle Corporation.  All rights reserved.



Oracle Home       : /u01/app/oracle/product/18.0.0.0/db_1

Central Inventory : /u01/app/oraInventory

   from           : /u01/app/oracle/product/18.0.0.0/db_1/oraInst.loc

OPatch version    : 12.2.0.1.16

OUI version       : 12.2.0.4.0

Log file location : /u01/app/oracle/product/18.0.0.0/db_1/cfgtoollogs/opatch/opatch2018-11-29_06-21-05AM_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.


7.檢視“$ORACLE_HOME”目錄空間

du -sk $ORACLE_HOME


8.檢查磁碟空間

df -lh


9.關閉叢集

[root@rac02 grid]# crsctl stop has


10.安裝補丁

[oracle@rac02 ~]$ unzip p2******5_184000DBRU_Linux-x86-64.zip 

Archive:  p2******5_184000DBRU_Linux-x86-64.zip

   creating: 2******5/

   creating: 2******5/etc/

   creating: 2******5/etc/config/

  inflating: 2******5/etc/config/actions.xml  

  inflating: 2******5/etc/config/inventory.xml  

   creating: 2******5/files/

   creating: 2******5/files/lib/

   creating: 2******5/files/lib/libserver18.a/

  inflating: 2******5/files/lib/libserver18.a/kxfp.o  

  inflating: 2******5/README.txt 


[oracle@rac02 2******5]$ /u01/app/oracle/product/18.0.0.0/db_1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./

Oracle Interim Patch Installer version 12.2.0.1.16

Copyright (c) 2018, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/18.0.0.0/db_1

Central Inventory : /u01/app/oraInventory

   from           : /u01/app/oracle/product/18.0.0.0/db_1/oraInst.loc

OPatch version    : 12.2.0.1.16

OUI version       : 12.2.0.4.0

Log file location : /u01/app/oracle/product/18.0.0.0/db_1/cfgtoollogs/opatch/opatch2018-11-29_06-52-40AM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.


[oracle@rac02 2******5]$ /u01/app/oracle/product/18.0.0.0/db_1/OPatch/opatch apply

Oracle Interim Patch Installer version 12.2.0.1.16

Copyright (c) 2018, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/oracle/product/18.0.0.0/db_1

Central Inventory : /u01/app/oraInventory

   from           : /u01/app/oracle/product/18.0.0.0/db_1/oraInst.loc

OPatch version    : 12.2.0.1.16

OUI version       : 12.2.0.4.0

Log file location : /u01/app/oracle/product/18.0.0.0/db_1/cfgtoollogs/opatch/opatch2018-11-29_06-34-52AM_1.log

Verifying environment and performing prerequisite checks...

OPatch continues with these patches:   2******5  

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 = '/u01/app/oracle/product/18.0.0.0/db_1')

Is the local system ready for patching? [y|n]

y

User Responded with: Y

Backing up files...

Applying interim patch '2******5' to OH '/u01/app/oracle/product/18.0.0.0/db_1'

Patching component oracle.rdbms, 18.0.0.0.0...

Patch 2******5 successfully applied.

Log file location: /u01/app/oracle/product/18.0.0.0/db_1/cfgtoollogs/opatch/opatch2018-11-29_06-34-52AM_1.log

OPatch succeeded.


11.啟動叢集

啟動叢集[root@rac02 grid]# crsctl start has

CRS-4123: Oracle High Availability Services has been started.


12.如果需要回退

[oracle@rac02 ~]$ $ORACLE_HOME/OPatch/opatch rollback -id 2******5 -local -oh $ORACLE_HOME

Oracle Interim Patch Installer version 12.2.0.1.16

Copyright (c) 2018, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/oracle/product/18.0.0.0/db_1

Central Inventory : /u01/app/oraInventory

   from           : /u01/app/oracle/product/18.0.0.0/db_1/oraInst.loc

OPatch version    : 12.2.0.1.16

OUI version       : 12.2.0.4.0

Log file location : /u01/app/oracle/product/18.0.0.0/db_1/cfgtoollogs/opatch/opatch2018-11-29_06-49-25AM_1.log

Patches will be rolled back in the following order: 

   2******5

The following patch(es) will be rolled back: 2******5  

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.

(Oracle Home = '/u01/app/oracle/product/18.0.0.0/db_1')

Is the local system ready for patching? [y|n]

y

User Responded with: Y

Rolling back patch 2******5...

RollbackSession rolling back interim patch '2******5' from OH '/u01/app/oracle/product/18.0.0.0/db_1'

Patching component oracle.rdbms, 18.0.0.0.0...

RollbackSession removing interim patch '2******5' from inventory

Log file location: /u01/app/oracle/product/18.0.0.0/db_1/cfgtoollogs/opatch/opatch2018-11-29_06-49-25AM_1.log

OPatch succeeded.


另附說明書

Oracle Database 18 Release 18.4.0.0.181016DBRU

PARALLEL QUERY Patch for Bug# 2******5 for Linux-x86-64 Platforms

This patch is RAC Rolling Installable  - Please read My Oracle Support Document 244241.1 https://support.us.oracle.com/oip/faces/secure/km/DocumentDisplay.jspx?id=244241.1 

Rolling Patch - OPatch Support for RAC.

This patch is Data Guard Standby-First Installable - Please read My Oracle Support Note 1265700.1 https://support.us.oracle.com/oip/faces/secure/km/DocumentDisplay.jspx?id=1265700.1

Oracle Patch Assurance - Data Guard Standby-First Patch Apply for details on how to remove risk and reduce downtime when applying this patch. 

Released: Fri Dec 14 13:30:31 2018

This document describes how you can install the PARALLEL QUERY overlay patch for bug#  2******5 on your Oracle Database 18 Release 18.4.0.0.181016DBRU

 (I) Prerequisites

--------------------

Before you install or deinstall the patch, ensure that you meet the following requirements:

Note: In case of an Oracle RAC environment, meet these prerequisites on each of the nodes.

1.Ensure that the Oracle home on which you are installing the patch or from which you are rolling back the patch is Oracle Database 18 Release 18.4.0.0.181016DBRU.

2.Ensure that 18 Release 18.4.0.0.181016DBRU Patch Set Update (PSU) 28655784 is already applied on the Oracle Database.

3. Ensure that you have OPatch 18 Release 12.2.0.1.14 or higher. Oracle recommends that you use the latest version available for  18 Release 12.2.0.1.14. 

Note:

If you do not have OPatch 18 Release 12.2.0.1.14 or the latest version available for 18 Release 12.2.0.1.14, then download it from patch# 6880880 for  12.2.0.1.14.

For information about OPatch documentation, including any known issues, see My Oracle Support Document 293369.1 OPatch documentation list:

https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=224346.1

4.Ensure that you set (as the home user) the ORACLE_HOME environment variable to the Oracle home.

5.Ensure that the $PATH definition has the following executables: make, ar, ld and nm. The location of these executables depends on your operating system. On many operating systems, they are located in /usr/ccs/bin.

6.Ensure that you verify the Oracle Inventory because OPatch accesses it to install the patches. To verify the inventory, run the following command.

       $ opatch lsinventory 

Note:

-If this command succeeds, it will list the Top-Level Oracle Products and one-off patches if any that are installed in the Oralce Home.

- Save the output so you have the status prior to the patch apply.

-If the command displays some errors, then contact Oracle Support and resolve the issue first before proceeding further.

7.(Only for Installation) Maintain a location for storing the contents of the patch ZIP file. In the rest of the document, this location (absolute path) is referred to as <PATCH_TOP_DIR>. Extract the contents of the patch ZIP file to the location (PATCH_TOP_DIR) you have created above. To do so, run the following command:

$ unzip -d <PATCH_TOP_DIR>  p2******5_184000DBRU_Linux-x86-64.zip 

8.(Only for Installation) Determine whether any currently installed interim patches conflict with this patch 2******5 as shown below:

$ cd <PATCH_TOP_DIR>/2******5

$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./

The report will indicate the patches that conflict with this patch and the patches for which the current 2******5 is a superset.

Note:

When OPatch starts, it validates the patch and ensures that there are no conflicts with the software already installed in the ORACLE_HOME. OPatch categorizes conflicts into the following types: 

-Conflicts with a patch already applied to the ORACLE_HOME that is a subset of the patch you are trying to apply  - In this case, continue with the patch installation because the new patch contains all the fixes from the existing patch in the ORACLE_HOME. The subset patch will automatically be rolled back prior to the installation of the new patch.

-Conflicts with a patch already applied to the ORACLE_HOME - In this case, stop the patch installation and contact Oracle Support Services.

9.Ensure that you shut down all the services running from the Oracle home.

Note:

-For a Non-RAC environment, shut down all the services running from the Oracle home. 

-For a RAC environment, shut down all the services (database, ASM, listeners, nodeapps, and CRS daemons) running from the Oracle home of the node you want to patch. After you patch this node, start the services on this node.Repeat this process for each of the other nodes of the Oracle RAC system. OPatch is used on only one node at a time.

(II) Installation  

-----------------

To install the patch, follow these steps:

1.Set your current directory to the directory where the patch is located and then run the OPatch utility by entering the following commands:

$ cd <PATCH_TOP_DIR>/2******5

$ opatch apply

2.Verify whether the patch has been successfully installed by running the following command:

$ opatch lsinventory

3.Start the services from the Oracle home.

(III) Deinstallation

----------------------

Ensure to follow the Prerequsites (Section I). To deinstall the patch, follow these steps:

1.Deinstall the patch by running the following command:

$ opatch rollback -id 2******5

2.Start the services from the Oracle home.

3.Ensure that you verify the Oracle Inventory and compare the output with the one run before the patch installation and re-apply any patches that were rolled back as part of this patch apply. To verify the inventory, run the following command:

$ opatch lsinventory


轉載請註明出處


本來好幾年沒有更新部落格了,最近我的學生們都在勤勞的寫部落格,所以帶動了我。。

--------------------------------------------------------------------------------------------------------------

我曾發現有寫網站直接拷貝貼上,連圖片都能複製,請把作者也加上謝謝O(∩_∩)O

--------------------------------------------------------------------------------------------------------------


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28389881/viewspace-2305487/,如需轉載,請註明出處,否則將追究法律責任。

相關文章