Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Hot patching

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Online Patching description

Description: this part is excerpted from OCP 050textbook.

The feature of online patch (also known as hot patch) is introduced in Oracle 11g; Hot patching allows us to install, enable or disable a fix or diagnostic patch (diagnostic patches) while the instance is always online.

Use hot patches to install, enable, and disable bug fixes or diagnostic patches on running active Oracle instances. Using hot patches is a recommended solution to avoid downtime when applying hot patches. Oracle provides the ability to hotpatch any Oracle database using the opatch command line utility. If the scope and complexity of the code changes are small (for example, diagnostic patches or small bug fixes), hot patches are available.

2.1 install hot patches

(1) there is no need to close the instance, relink the Oracle binaries, or restart the instance to apply the hot patch.

(2) OPatch can be used to install or uninstall hot patches.

(3) OPatch can detect conflicts between two hot patches and between hot patches and regular patches.

You can use the following command to determine whether a patch is a hot patch:

Opatch query-is_online_patch or

Opatch query-all

Note:

The patched code is provided as a dynamic / shared library, which is then mapped to memory by each Oracle process.

(you can refer to Section 1.2 for the mechanism of hot patches. )

2.2 benefits of hot patches

(1) No downtime and no interruption of business

(2) the speed of installation and uninstallation is very fast

(3) Integration with OPatch:

Detect conflicts

Listed in the patch list

Working in a RAC environment

(4) although the Oracle binaries on disk are not changed, hot patches remain valid when the instance is shut down and started.

2.3 regular and hot patches

Regular patches basically require that the database instance be shut down.

Hot patches do not require any downtime. The application can continue to run when a hot patch is installed.

Similarly, installed hot patches can be uninstalled without downtime.

Comparison of regular patches and hot patches, as shown in the following figure:

2.4 Hot Patch considerations

(1) Hot patches may not be available on all platforms. Hot patches are currently available on the following platforms:

-Linux x86

-Linux x86-64

-Solaris SPARC64

-- for more information, please refer to Section 1.3.

(2) some extra memory is consumed.

-the exact amount of memory depends on:

-size of the patch

-number of Oracle processes currently running

-minimum memory: each Oracle process occupies about one OS page

For example, an operating system (OS) page is generally 4 KB on Linux x86 and 8 KB on and Solaris SPARC64.

With an average of about a thousand Oracle processes running at the same time, this means that a small hot patch takes up about 4 MB extra memory.

(3) there may be a very short delay (a few seconds) before each Oracle process installs or uninstalls hot patches.

(4) not all bug fixes and diagnostic patches can be used as hot patches.

Most diagnostic patches are available as hot patches. For bug repair, it depends on its nature. Not every bug fix or diagnostic patch can be used as a hot patch. However, the long-term goal of hot patch tools is to provide hot patch capabilities for key patch updates.

(5) Hot patches cannot be used during downtime.

(6) if downtime is possible, all relevant bug fixes should be installed as regular patches.

three。 Example of Online Patch operation

The test environment is 11.2.0.3:

SQL > select * from v$version

BANNER

-

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0-64bit Production

PL/SQL Release 11.2.0.3.0-Production

CORE 11.2.0.3.0 Production

TNS for Linux: Version 11.2.0.3.0-Production

NLSRTL Version 11.2.0.3.0-Production

Google for a while and find a corresponding version of onlinepatch:

Oracle online patching for bug 13817131 (backport for ORA-7445 near ksfqfcrx () + X during RMAN backups)

Http://jakub.wartak.pl/blog/?p=624

Here we use the related operations of online patch:13817131 as an example.

3.1 decompress:

[oracle@dave U01] $unzipp13817131_112030_Linux-x86-64.zip

Archive: p13817131_112030_Linux-x86-64.zip

Creating: 13817131/

Creating: 13817131/etc/

Creating: 13817131/etc/xml/

Inflating: 13817131/etc/xml/ShiphomeDirectoryStructure.xml

Inflating: 13817131/etc/xml/GenericActions.xml

Creating: 13817131/etc/config/

Inflating: 13817131/etc/config/inventory.xml

Inflating: 13817131/etc/config/actions.xml

Inflating: 13817131/etc/config/deploy.xml

Creating: 13817131/online/

Creating: 13817131/online/files/

Creating: 13817131/online/files/hpatch/

Inflating: 13817131/online/files/hpatch/bug13817131.pch

Creating: 13817131/online/etc/

Creating: 13817131/online/etc/xml/

Inflating: 13817131/online/etc/xml/GenericActions.xml

Inflating: 13817131/online/etc/xml/ShiphomeDirectoryStructure.xml

Creating: 13817131/online/etc/config/

Inflating: 13817131/online/etc/config/actions.xml

Inflating: 13817131/online/etc/config/deploy.xml

Inflating: 13817131/online/etc/config/inventory.xml

Creating: 13817131/files/

Creating: 13817131/files/lib/

Creating: 13817131/files/lib/libserver11.a/

Inflating: 13817131/files/lib/libserver11.a/ksfq.o

Inflating: 13817131/README.txt

3.2View Patch type 3.2.1 take a look at the tree structure: if it is online patch, there will be a directory of online:

[oracle@dave U01] $ls

13817131 dave dave2.trc p13817131_112030_Linux-x86-64.zip rcopy.sh rename.sh

App dave1.trc nohup.out rcopy.out rcopy.sh.out

[oracle@dave U01] $tree 13817131

13817131

|-- etc

| |-- config |

| | |-- actions.xml |

| | |-- deploy.xml |

| | `--inventory.xml |

| | `--xml |

| |-- GenericActions.xml |

| | `--ShiphomeDirectoryStructure.xml |

|-- files

| | `--lib |

| | `--libserver11.a |

| | `--ksfq.o |

|-- online

| |-- etc |

| | |-- config |

| |-- actions.xml |

| |-- deploy.xml |

| | `--inventory.xml |

| | `--xml |

| | |-- GenericActions.xml |

| | `--ShiphomeDirectoryStructure.xml |

| | `--files |

| | `--hpatch |

| | `--bug13817131.pch |

`--README.txt

12 directories, 13 files

3.2.2 use opatch to view patch types:

[oracle@dave U01] $mv 13817131/u01/app/oracle/product/11.2.0/db_1/OPatch

[oracle@dave U01] $cd/u01/app/oracle/product/11.2.0/db_1/OPatch

[oracle@dave OPatch] $ls

13817131 emdpatch.pl jlib opatch opatch.ini opatchprereqs

Docs fmw ocm opatch.bat opatch.pl

[oracle@dave OPatch] $. / opatch query 13817131-all

Invoking OPatch 11.2.0.1.7

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

Central Inventory: / u01/app/oraInventory

From: / etc/oraInst.loc

OPatch version: 11.2.0.1.7

OUI version: 11.2.0.3.0

Log file location: / u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch3012-10-090019-00-40????.log

-

Patch created on 25 Sep 2012, 08:46:37 hrsPST8PDT

Needto shutdown Oracle instances: true

Patch is roll-backable: true

Patch is a "Patchset Update": false

Patch is a rolling patch: true

Patch has sql related actions: false

Patch is an online patch: false

Patch is a portal patch: false

Patch is an "auto-enabled" patch:false

Listof platforms supported:

226: Linux x86-64

Listof bugs to be fixed:

13817131: OAM ORA-7445- [KSFQFCRX () + 812] [SIGSEGV] [ADDR 0X8]

Thispatch is a "singleton" patch.

Thispatch belongs to the "db" product family

Listof executables affected:

ORACLE_HOME/bin/oracle

Listof optional components:

Oracle.rdbms: 11.2.0.3.0

Listof optional actions:

Update / u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a with/ksfq.o

Cd/u01/app/oracle/product/11.2.0/db_1/rdbms/lib

; make-f ins_rdbms.mk ioracleORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

Possible XML representation of the patch:

13817131

-

OPatch succeeded.

It is shown here as False. Use opatch is_online_patch to view:

[oracle@dave OPatch] $. / opatch query-is_online_patch 13817131

Invoking OPatch 11.2.0.1.7

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

Central Inventory: / u01/app/oraInventory

From: / etc/oraInst.loc

OPatch version: 11.2.0.1.7

OUI version: 11.2.0.3.0

Log file location: / u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch3012-10-090019-02-47????.log

-

Patch is an online patch: false

OPatch succeeded.

What is shown here is still False, but in fact, our Patch is indeed the patch of online.

Apply Patch and confirm the memory consumption of Online Patch:

Installing online patch consumes some additional memory resources, so let's verify it here:

-- View the memory consumption of pmon processes:

[oracle@dave 13817131] $ps-ef | grep pmon | grep-v grep

Oracle 2118 1 0 15:15? 00:00:13 ora_pmon_dave

[oracle@dave 13817131] $pmap-d 2118 | tail-20

00007fb4ef13a000 1020-0000000000289000 008:00003libnnz11.so

00007fb4ef239000 264 rwx-- 0000000000288000 008:00003libnnz11.so

00007fb4ef27b000 12 rwx-- 0000000000000000 000:00000 [anon]

00007fb4ef28d000 4 rwxs- 0000000000000000 008:00003hc_dave.dat

00007fb4ef28e000 8 rwx-- 0000000000000000 000:00000 [anon]

00007fb4ef290000 864 rmurx 008:00003libskgxp11.so-0000000000000000

00007fb4ef368000 1024-00000000000d8000 008:00003libskgxp11.so

00007fb4ef468000 8 rwx-- 00000000000d8000 008:00003libskgxp11.so

00007fb4ef46a000 392rMuimex libcell11.so-000000000000000000000008purl 00003

00007fb4ef4cc000 1024-0000000000062000 008:00003libcell11.so

00007fb4ef5cc000 40 rwx-- 0000000000062000 008:00003libcell11.so

00007fb4ef5d6000 8 rwx-- 0000000000000000 000:00000 [anon]

00007fb4ef5d8000 4 rmurx 008:00003libodmd11.so-0000000000000000

00007fb4ef5d9000 1024-00000000001000 008:00003libodmd11.so

00007fb4ef6d9000 4 rwx-- 0000000000001000 008:00003libodmd11.so

00007fb4ef6da000 4 rwx-- 0000000000000000 000:00000 [anon]

00007ffff0261000 132 rwx-- 0000000000000000 000:00000 [stack]

00007ffff03f6000 4 rmurxMel-000000000000000000000000000 [anon]

Ffffffffff600000 4 rmurxMel-000000000000000000000000000 [anon]

Mapped: 958080K writeable/private: 8056K shared: 720900K

-- install Patch:

Oracle@dave 13817131] $opatch apply online-connectString dave:sys:oracle

Invoking OPatch 11.2.0.1.7

Oracle Intermediate Patch installer version 11.2.0.1.7

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

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

Central Inventory: / u01/app/oraInventory

From: / etc/oraInst.loc

OPatch version: 11.2.0.1.7

OUI version: 11.2.0.3.0

Log file location: / u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch3012-10-09pm 19-10-51 p.m. Log

Patches should only be applied / rolled back in'- all_nodes' mode.

Convert RAC mode to'- all_nodes' mode.

Applying interim patch '13817131' to OH'/u01/app/oracle/product/11.2.0/db_1'

Verifying environment and performingprerequisite checks...

Do you want to continue? [y | n]

Y

User Responded with: Y

All checks passed.

Backing up files...

Patching component oracle.rdbms, 11.2.0.3.0.

The patch will be installed on activedatabase instances.

The online patch 'bug13817131.pch' is being installed and enabled on database' dave'.

Patch 13817131 successfully applied

Log file location:/u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch3012-10-09pm 19-10-51 p.m. Log

OPatch succeeded.

-- View alert log:

Tue Oct 09 19:11:05 2012

Patch file bug13817131.pch is out of syncwith oracle binary; performing fixup

Patch file bug13817131.pch has been syncedwith oracle binary

Patch bug13817131.pchInstalled-Update # 1

Patch bug13817131.pchEnabled-Update # 2

Tue Oct 09 19:11:07 2012

Online patch bug13817131.pch has beeninstalled

Online patch bug13817131.pch has beenenabled

-- check the memory of the pmon process again:

[oracle@dave trace] $ps-ef | grep pmon | grep-v grep

Oracle 2118 1 0 15:15? 00:00:14 ora_pmon_dave

[oracle@dave trace] $pmap-d 2118 | tail-20

00007fb4ef239000 264 rwx-- 0000000000288000 008:00003libnnz11.so

00007fb4ef27b000 12 rwx-- 0000000000000000 000:00000 [anon]

00007fb4ef28c000 4 rmurx-000000000c955000 008:00003oracle

00007fb4ef28d000 4 rwxs- 0000000000000000 008:00003hc_dave.dat

00007fb4ef28e000 8 rwx-- 0000000000000000 000:00000 [anon]

00007fb4ef290000 864 rmurx 008:00003libskgxp11.so-0000000000000000

00007fb4ef368000 1024-00000000000d8000 008:00003libskgxp11.so

00007fb4ef468000 8 rwx-- 00000000000d8000 008:00003libskgxp11.so

00007fb4ef46a000 392rMuimex libcell11.so-000000000000000000000008purl 00003

00007fb4ef4cc000 1024-0000000000062000 008:00003libcell11.so

00007fb4ef5cc000 40 rwx-- 0000000000062000 008:00003libcell11.so

00007fb4ef5d6000 8 rwx-- 0000000000000000 000:00000 [anon]

00007fb4ef5d8000 4 rmurx 008:00003libodmd11.so-0000000000000000

00007fb4ef5d9000 1024-00000000001000 008:00003libodmd11.so

00007fb4ef6d9000 4 rwx-- 0000000000001000 008:00003libodmd11.so

00007fb4ef6da000 4 rwx-- 0000000000000000 000:00000 [anon]

00007ffff0261000 132 rwx-- 0000000000000000 000:00000 [stack]

00007ffff03f6000 4 rmurxMel-000000000000000000000000000 [anon]

Ffffffffff600000 4 rmurxMel-000000000000000000000000000 [anon]

Mapped: 964344K writeable/private: 8068K shared: 720900K

-- before installing Patch is:

Mapped: 958080K writeable/private: 8056K shared: 720900K .

Private memory has increased by 8k.

-- and after installation, you can see the following three more library files from the memory of the pmon process:

[oracle@davetrace] $pmap-d 2118 | grep 13817131

00007fb4ecf66000 168 rmurx house-0000000000000000 008:00003bug13817131.so

00007fb4ecf90000 1020-000000000002a000 008:00003bug13817131.so

00007fb4ed08f000 12 rwx-- 0000000000029000 008:00003bug13817131.so

3.4 use oradebug to disable patch

Section 1.7 mentions two ways to disable online patch using oradebug, which is not recommended by Oracle. Let's test it here.

(1) use Oradebug

SQL > oradebug patch list

Patch File Name State

= =

Bug13817131.pch ENABLED

SQL > oradebugpatch disable bug13817131.pch

Statement processed.

SQL > oradebug patch list

Patch File Name State

= =

Bug13817131.pch DISABLED

Note that this approach does not release the additional memory consumed when installing onlinepatch.

[oracle@dave trace] $pmap-d 2118 | tail-20

00007fb4ef239000 264 rwx-- 0000000000288000 008:00003libnnz11.so

00007fb4ef27b000 12 rwx-- 0000000000000000 000:00000 [anon]

00007fb4ef28c000 4 rmurx-000000000c955000 008:00003oracle

00007fb4ef28d000 4 rwxs- 0000000000000000 008:00003hc_dave.dat

00007fb4ef28e000 8 rwx-- 0000000000000000 000:00000 [anon]

00007fb4ef290000 864 rmurx 008:00003libskgxp11.so-0000000000000000

00007fb4ef368000 1024-00000000000d8000 008:00003libskgxp11.so

00007fb4ef468000 8 rwx-- 00000000000d8000 008:00003libskgxp11.so

00007fb4ef46a000 392 rmurx 008:00003libcell11.so-0000000000000000

00007fb4ef4cc000 1024-0000000000062000 008:00003libcell11.so

00007fb4ef5cc000 40 rwx-- 0000000000062000 008:00003libcell11.so

00007fb4ef5d6000 8 rwx-- 0000000000000000 000:00000 [anon]

00007fb4ef5d8000 4 rmurx 008:00003libodmd11.so-0000000000000000

00007fb4ef5d9000 1024-00000000001000 008:00003libodmd11.so

00007fb4ef6d9000 4 rwx-- 0000000000001000 008:00003libodmd11.so

00007fb4ef6da000 4 rwx-- 0000000000000000 000:00000 [anon]

00007ffff0261000 132 rwx-- 0000000000000000 000:00000 [stack]

00007ffff03f6000 4 rmurxMel-000000000000000000000000000 [anon]

Ffffffffff600000 4 rmurxMel-000000000000000000000000000 [anon]

Mapped: 964344K writeable/private: 8068K shared: 720900K

-- use oradebug enable patch:

SQL > oradebug patch enablebug13817131.pch

Statement processed.

SQL > oradebug patch list

Patch File Name State

= =

Bug13817131.pch ENABLED

(2) close the instance and remove the configuration file

Shutting the instancedown and removing the orapatch*.cfg file. Afterstopping the instance do the following:

Cd $ORACLE_HOME/hpatch

Rm orapatch$ORACLE_SID.cfg

-- it is emphasized here that the instance is being closed, otherwise other unexpected conditions may occur.

Removing the orapatch*.cfg removes all of the online patches currentlyinstalled for the instance.

-- this method removes all online patch:

[oracle@dave db_1] $cd hpatch/

[oracle@dave hpatch] $pwd

/ u01/app/oracle/product/11.2.0/db_1/hpatch

[oracle@dave hpatch] $ls

Bug13817131.pch bug13817131.pchdave.fixup bug13817131.so orapatchdave.cfg

3.5 rollback patch

Grammar reference section 1.7.

[oracle@dave db_1] $opatch rollback-id 13817131-connectString dave:sys:oracle

Invoking OPatch 11.2.0.1.7

Oracle Intermediate Patch installer version 11.2.0.1.7

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

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

Central Inventory: / u01/app/oraInventory

From: / etc/oraInst.loc

OPatch version: 11.2.0.1.7

OUI version: 11.2.0.3.0

Log file location: / u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch3012-10-09pm 19-32-31 p.m. Log

RollbackSession rollback the intermediate patch '13817131' from OH'/ u01amp

Patches should only be applied / rolled back in'- all_nodes' mode.

Convert RAC mode to'- all_nodes' mode.

Patching component oracle.rdbms, 11.2.0.3.0.

The patch will be removed from activedatabase instances.

Disabling and removing online patch 'bug13817131.pch' on database' dave'

RollbackSession removes the intermediate patch '13817131' from the product list

Log file location:/u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch3012-10-09pm 19-32-31 p.m. Log

OPatch succeeded.

-- alert log information:

Tue Oct 09 19:32:41 2012

Patch bug13817131.pch Disabled-Update # 5

Patch bug13817131.pch Removed-Update # 6

Tue Oct 09 19:32:44 2012

Online patchbug13817131.pch has been disabled

Online patchbug13817131.pch has been removed

-- View the memory consumption of PMON processes:

[oracle@dave trace] $pmap-d 2118 | tail-20

00007fb4ef239000 264 rwx-- 0000000000288000 008:00003libnnz11.so

00007fb4ef27b000 12 rwx-- 0000000000000000 000:00000 [anon]

00007fb4ef28c000 4 rmurx-000000000c955000 008:00003oracle

00007fb4ef28d000 4rwxs-0000000000000000000008purl 00003 hc_dave.dat

00007fb4ef28e000 8 rwx-- 0000000000000000 000:00000 [anon]

00007fb4ef290000 864 rmurx 008:00003libskgxp11.so-0000000000000000

00007fb4ef368000 1024-00000000000d8000 008:00003libskgxp11.so

00007fb4ef468000 8 rwx-- 00000000000d8000 008:00003libskgxp11.so

00007fb4ef46a000 392 rmurx 008:00003libcell11.so-0000000000000000

00007fb4ef4cc000 1024-0000000000062000 008:00003libcell11.so

00007fb4ef5cc000 40 rwx-- 0000000000062000 008:00003libcell11.so

00007fb4ef5d6000 8 rwx-- 0000000000000000 000:00000 [anon]

00007fb4ef5d8000 4 rmurx 008:00003libodmd11.so-0000000000000000

00007fb4ef5d9000 1024-00000000001000 008:00003libodmd11.so

00007fb4ef6d9000 4 rwx-- 0000000000001000 008:00003libodmd11.so

00007fb4ef6da000 4 rwx-- 0000000000000000 000:00000 [anon]

00007ffff0261000 132 rwx-- 0000000000000000 000:00000 [stack]

00007ffff03f6000 4 rmurxMel-000000000000000000000000000 [anon]

Ffffffffff600000 4 rmurxMel-000000000000000000000000000 [anon]

Mapped: 964344K writeable/private: 8068K shared: 720900K

The use of oradebugdisable and opatch rollback here does not free up the extra memory consumed by installing online patch. Of course, this memory will be freed after the instance is restarted.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report