欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

OPATCH在线补丁

程序员文章站 2023-01-22 19:08:13
如果补丁中有online目录就是在线补丁,不需要数据库停机,在线的又分集群和非集群,如下查看readme可以得知在线补丁打法$ cat README.txt Oracle Database 11g Release 11.2.0.3.0ORACLE DATABASE Patch for Bug# 12... ......

如果补丁中有online目录就是在线补丁,不需要数据库停机,在线的又分集群和非集群,如下

OPATCH在线补丁查看readme可以得知在线补丁打法

$ cat readme.txt 
oracle database 11g release 11.2.0.3.0
oracle database patch for bug# 12834800 for linux-x86 platforms

(rac rolling installable and online installable patch)

(dg rolling installable)

released: sat jan 28 10:03:32 2012

this document describes how you can install the oracle database combo patch for bug#  12834800 on your oracle database 11g release 11.2.0.3.0.

a combo patch is a patch that can be applied either in offline mode or in online mode. for information about offline and online modes of patching, see my oracle support note 761111.1 available at:
https://support.oracle.com/csp/main/article?cmd=show&type=not&id=761111.1
 
(1) 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 database on which you are installing the patch or from which you are rolling back the patch is oracle database 11g release (11.2.0.3.0).

2.      oracle recommends you to use the latest version of opatch. 
        if you do not have the latest version, then follow the instructions outlined in the my oracle support note 224346.1 available at:
        https://support.oracle.com/csp/main/article?cmd=show&type=not&id=224346.1 

3.      ensure that you set the oracle_home environment variable to the oracle home of the oracle database.

4.      ensure that you set the path environment variable to include the location of the unzip executable, and the /bin and the /opatch directories present in the oracle home of the oracle database.
 
5.      ensure that you verify the oracle inventory because opatch accesses it to install the patches. to verify the inventory, run the following command. if the command displays some errors, then contact oracle support and resolve the issue.
        $ opatch lsinventory 

6.      (only for offline patching) ensure that you shut down all the services running from the oracle home.

7.      (only for online patching) ensure that all the services in the oracle home are up and running.

8.      (only for online patching) ensure that you maintain adequate memory on your system to apply this online patch. to calculate the amount of memory required for this online patch, use the following formula:
        memory consumed = (number of oracle processes + 1) x (size of patched .pch file) 

note:
-       for unix, the number of oracle processes is determined by checking the parameter "processes" in the database by querying v$parameter. for microsoft windows, the number of oracle processes is always zero (0).
-       the .pch file is available under /files/hpatch/ directory.

(2) installation
-----------------
this section describes the following modes you can use to install the combo patch. use the one that best suits your requirement. 
-       installing in offline mode
-       installing in online mode

(2.1) installing in offline mode
-----------------------------------
to  install the patch in offline mode, follow these steps:
note: in case of an oracle rac environment, perform these steps on each of the nodes.

1.      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 .

2.      extract the contents of the patch zip file to the location you created in step (1). to do so, run the following command:
        $ unzip -d  p12834800_112030_linux.zip

3.      navigate to the /12834800 directory:
        $ cd /12834800

4.      install the patch by running the following command:
        $ opatch apply

        note: 
        when opatch starts, it validates the patch and ensures that there are no conflicts with the software already installed in the oracle_home of the oracle database. opatch categorizes conflicts 
        into the following types: 
        -       conflicts with a patch already applied to the oracle_home - in this case, stop the patch installation and contact oracle support services.
        -       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.

5.      start the services from the oracle home.


(2.2) installing in online mode
-----------------------------------
to  install the patch in online mode, follow these steps:
note: in case of an oracle rac environment, perform these steps on each of the nodes.

1.      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 .

2.      extract the contents of the patch zip file to the location you created in step (1). to do so, run the following command:
        $ unzip -d  p12834800_112030_linux.zip

3.      navigate to the /12834800 directory:
        $ cd /12834800

4.      install the patch by running the following command:
        -       for non-rac environments (standalone databases):  
                $ opatch apply online -connectstring ::: 
        -       for rac environments: 
                $ opatch apply online -connectstring :::,:::,:::

        note:
        -       run the previous command on the first node of the oracle rac system, and specify details of each node separated by a comma. in the command, noden refers to the different nodes of the 
                oracle rac system. once the patch is applied on the first node, opatch automatically moves over and patches the next node you have specified in the comamnd. 
        -       when opatch starts, it validates the patch and ensures that there are no conflicts with the software already installed in the oracle_home of the oracle database. 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.

5.      start the services from the oracle home.


(3) deinstallation
--------------------
this section describes the following modes you can use to deinstall the combo patch. use the one that best suits your requirement. 
-       deinstalling in offline mode
-       deinstalling in online mode

(3.1) deinstalling in offline mode
-------------------------------------
to deinstall the patch in offline mode, follow these steps:
note: in case of an oracle rac environment, perform these steps on each of the nodes.

1.      navigate to the /12834800 directory:
        $ cd /12834800

2.      deinstall the patch by running the following command:
        $ opatch rollback -id 12834800

3.      start the services from the oracle home.


(3.2) deinstalling in online mode
--------------------------------------
to deinstall the patch in online mode, follow these steps:
note: in case of an oracle rac environment, perform these steps on each of the nodes.

1.      navigate to the /12834800 directory:
        $ cd /12834800

2.      deinstall the patch by running the following command:
        -       for non-rac environments (standalone databases):  
                $ opatch rollback -id 12834800 -connectstring :::
        -       for rac environments: 
                $ opatch rollback -id 12834800 -connectstring :::,:::,:::

        note:
        run the previous command on the first node of the oracle rac system, and specify details of each node separated by a comma. in the command, noden refers to the different nodes of the 
        oracle rac system. once the patch is rolled back from the first node, opatch automatically moves over and rolls back the patch from the next node you have specified in the comamnd. 

3.      start the services from the oracle home.


(4) bugs fixed by this patch
---------------------------------
the following are the bugs fixed by this patch:
  12834800: ora-7445 [qkxrpxformunm()+92]


--------------------------------------------------------------------------
copyright 2012, oracle and/or its affiliates. all rights reserved.

打个补丁

$ /u01/app/oracle/product/11.2.0/db_1/opatch/opatch apply online -connectstring prod4:sys:oracle:
invoking opatch 11.2.0.1.7

oracle interim 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/opatch2019-04-01_16-45-58pm.log


the patch should be applied/rolled back in '-all_nodes' mode only.
converting the rac mode to '-all_nodes' mode.
applying interim patch '12834800' to oh '/u01/app/oracle/product/11.2.0/db_1'
verifying environment and performing prerequisite checks...

do you want to proceed? [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 active database instances.
installing and enabling the online patch 'bug12834800.pch', on database 'prod4'.

patch 12834800 successfully applied
log file location: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2019-04-01_16-45-58pm.log

opatch succeeded.
$ /u01/app/oracle/product/11.2.0/db_1/opatch/opatch lsinventory
invoking opatch 11.2.0.1.7

oracle interim 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/opatch2019-04-01_16-48-44pm.log

lsinventory output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2019-04-01_16-48-44pm.txt

--------------------------------------------------------------------------------
installed top-level products (1): 

oracle database 11g                                                  11.2.0.3.0
there are 1 products installed in this oracle home.


interim patches (1) :

patch (online) 12834800: applied on mon apr 01 16:47:17 cst 2019
unique patch id:  14522435
   created on 28 jan 2012, 10:16:59 hrs pst8pdt
   bugs fixed:
     12834800



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

opatch succeeded.