Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1471708
  • 博文数量: 246
  • 博客积分: 3353
  • 博客等级: 中校
  • 技术积分: 3295
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-09 17:56
个人简介

精通测试技术,linux,shell,性能测试

文章分类

全部博文(246)

文章存档

2024年(3)

2023年(7)

2022年(7)

2021年(4)

2020年(1)

2019年(2)

2017年(2)

2016年(3)

2015年(11)

2014年(20)

2013年(10)

2012年(176)

分类:

2012-06-15 20:07:01


从patch中的readme来。 bug:10214450


测试数据:

SQL> create table t (t timestamp);

Table created.

SQL>
SQL>
SQL>
SQL>    
SQL>
SQL> insert into t values (sysdate);

1 row created.

SQL> /

1 row created.

SQL> select * from t;

T
---------------------------------------------------------------------------
04-DEC-11 10.01.23.000000 AM
04-DEC-11 10.01.24.000000 AM

SQL> commit;

Commit complete.

SQL> 


SQL> select * from t;   

T
---------------------------------------------------------------------------
04-DEC-11 10.01.23.000000 AM
04-DEC-11 10.01.24.000000 AM
04-DEC-11 10.02.44.000000 AM
04-DEC-11 10.02.45.000000 AM
04-DEC-11 10.02.46.000000 AM
04-DEC-11 10.02.46.000000 AM
04-DEC-11 10.02.46.000000 AM
04-DEC-11 10.02.47.000000 AM
04-DEC-11 10.02.47.000000 AM
04-DEC-11 10.02.47.000000 AM
04-DEC-11 10.02.47.000000 AM

T
---------------------------------------------------------------------------
04-DEC-11 10.02.48.000000 AM

12 rows selected.






=========================================================================
Interim Patch for Base Bug: 10214450
=========================================================================

Date: Wed Nov 24 10:33:30 2010
-------------------------------------------------------------------------
Platform Patch for          : Linux-x86-64
Product Patched             : ORACLE DATABASE
Product Version #           : 10.2.0.4.0
RAC Rolling Installable     : YES


Bugs Fixed by this patch:
-------------------------
  10214450: FIX FOR BUG 5476091 MAY CAUSE BUG 9929820

Patch Preinstall Steps
----------------------


1. For non-recommended patches, you must have the exact symptoms
   described in the service request (SR).

==》 OK

2. Confirm the version of Perl installed and configured for the ORACLE_HOME.

Oracle requires that all customers have at least Perl 5.00503 installed
and configured for patching activities inside the ORACLE_HOME.  Follow
these steps to check the Perl version for the ORACLE_HOME being patched:

  - source the ORACLE_HOME environment
  - execute "perl -v"
  - verify that the returned version of Perl is 5.00503 or higher

If the Perl configured for the ORACLE_HOME is not at 5.00503 or
higher, follow the directions in this My Oracle Support note to update to
a more recent version
:

Note 189489.1 - Oracle Data Server Interim Patch Installation


==》 
[oracle@rac1 db1]$ echo $ORACLE_HOME
/opt/oracle/product/10.2.0/db1
[oracle@rac1 db1]$
[oracle@rac1 db1]$ perl -v

This is perl, v5.8.8 built for x86_64-linux-thread-multi

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at the Perl Home Page.

[oracle@rac1 db1]$ which perl
/usr/bin/perl


3.  Verify the OUI Inventory.

OPatch needs access to a valid OUI inventory to apply patches.
Validate the OUI inventory with the following command:

  opatch lsinventory

If the command errors out, contact Oracle Support and work to validate
and verify the inventory setup before proceeding.

==》
[oracle@rac1 OPatch]$ pwd
/opt/oracle/product/10.2.0/db1/OPatch
[oracle@rac1 OPatch]$ ./opatch
Invoking OPatch 10.2.0.4.2

Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation.  All rights reserved.

Syntax Error... No command specified.

Usage: opatch [ -help ] [ -r[eport] ] [ command ]

            command := apply
                       lsinventory
                       napply
                       nrollback
                       rollback
                       query
                       version
                       prereq
                       util

:= -help       Displays the help message for the command.
                       -report     Print the actions without executing.

example:
   'opatch -help'
   'opatch apply -help'
   'opatch lsinventory -help'
   'opatch napply -help'
   'opatch nrollback -help'
   'opatch rollback -help'
   'opatch prereq -help'
   'opatch util -help'
  


OPatch failed with error code 14
[oracle@rac1 OPatch]$

[oracle@rac1 OPatch]$ ./opatch lsinventory
Invoking OPatch 10.2.0.4.2

Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation.  All rights reserved.


Oracle Home       : /opt/oracle/product/10.2.0/db1
Central Inventory : /opt/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.4.2
OUI version       : 10.2.0.4.0
OUI location      : /opt/oracle/product/10.2.0/db1/oui
Log file location : /opt/oracle/product/10.2.0/db1/cfgtoollogs/opatch/opatch2011-12-04_09-36-22AM.log

Lsinventory Output file location : /opt/oracle/product/10.2.0/db1/cfgtoollogs/opatch/lsinv/lsinventory2011-12-04_09-36-22AM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (2):

Oracle Database 10g                                                  10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3                            10.2.0.4.0
There are 2 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.


Rac system comprising of multiple nodes
  Local node = rac1
  Remote node = rac2


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

OPatch succeeded.
[oracle@rac1 OPatch]$

 


 
4.  Review and download the latest version of OPatch.

Oracle recommends that all customers be on the latest version of OPatch.
Please review the following My Oracle Support note and follow the instructions
to update to the latest version if needed:

Note 224346.1 - Opatch - Where Can I Find the Latest Version of Opatch?


==》 From step 3, the version is ok.


5.  Confirm executables appear in your system PATH.

The patching process will use the unzip and the opatch executables.  After
sourcing the ORACLE_HOME environment, confirm both of these exist before
continuing:

  - "which opatch"
  - "which unzip"

If either of these executables do not show in the PATH, correct the problem
before proceeding.

==》

[oracle@rac1 OPatch]$ which opatch
/usr/bin/which: no opatch in (/opt/oracle/product/10.2.0/db1/bin:/opt/oracle/product/crs//bin:/opt/oracle/product/10.2.0/db1/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin)
[oracle@rac1 OPatch]$ which unzip
/opt/oracle/product/10.2.0/db1/bin/unzip
[oracle@rac1 OPatch]$ 

on both nodes:
add these lines to your .bash_profile
export OPATCH=/opt/oracle/product/10.2.0/db1/OPatch
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$OPATCH:$PATH

Node1:
[oracle@rac1 OPatch]$ . ~/.bash_profile
[oracle@rac1 OPatch]$ which opatch
/opt/oracle/product/10.2.0/db1/OPatch/opatch
[oracle@rac1 OPatch]$ which unzip
/opt/oracle/product/10.2.0/db1/bin/unzip
[oracle@rac1 OPatch]$


Node2:
[oracle@rac2 ~]$ . ~/.bash_profile
[oracle@rac2 ~]$ which unzip
/opt/oracle/product/10.2.0/db1/bin/unzip
[oracle@rac2 ~]$ which opatch
/opt/oracle/product/10.2.0/db1/OPatch/opatch



6.  Create a location for storing the unzipped patch.  
This location will be referred to later in the document as .

==》
[oracle@rac1 ~]$ mkdir patch
[oracle@rac1 ~]$ pwd
/home/oracle
[oracle@rac1 ~]$ ls
Desktop  p10214450_10204_Linux-x86-64.zip  patch


7.  Unzip the patch zip file into the .

  unzip -d p10214450_10204_Linux-x86-64.zip

==》 
[oracle@rac1 ~]$ unzip -d patch/ p10214450_10204_Linux-x86-64.zip 
Archive:  p10214450_10204_Linux-x86-64.zip
   creating: patch/10214450/
   creating: patch/10214450/files/
   creating: patch/10214450/files/lib32/
   creating: patch/10214450/files/lib32/libgeneric10.a/
  inflating: patch/10214450/files/lib32/libgeneric10.a/kgx.o  
   creating: patch/10214450/files/lib/
   creating: patch/10214450/files/lib/libgeneric10.a/
  inflating: patch/10214450/files/lib/libgeneric10.a/kgx.o  
   creating: patch/10214450/files/lib/libserver10.a/
  inflating: patch/10214450/files/lib/libserver10.a/ksf.o  
   creating: patch/10214450/etc/
   creating: patch/10214450/etc/config/
  inflating: patch/10214450/etc/config/inventory.xml  
  inflating: patch/10214450/etc/config/actions.xml  
  inflating: patch/10214450/etc/config/deploy.xml  
   creating: patch/10214450/etc/xml/
  inflating: patch/10214450/etc/xml/GenericActions.xml  
  inflating: patch/10214450/etc/xml/ShiphomeDirectoryStructure.xml  
  inflating: patch/10214450/README.txt  

[oracle@rac1 ~]$ ls -l patch/
total 4
drwxr-xr-x 4 oracle oinstall 4096 Nov 25  2010 10214450
[oracle@rac1 ~]$
 


8.  Shut down services running from the ORACLE_HOME.

Before applying this patch, do a clean shut down of all services running from the ORACLE_HOME.

  (a) In a non-RAC environment:

  Shut down all services that are running from this ORACLE_HOME.
  Confirm the return status from each shutdown command to verify
  the shutdown is successful and there are no errors.

  (b) In a RAC environment:

  For each node in the RAC system, shut down the services for
  the specific machine that are running from the ORACLE_HOME.
  OPatch will be used on each node in the RAC system one at
  a time.  If this patch is not rolling RAC installable treat
  it as a non-RAC environment and shut down all services.

  As an example, in the case of a two node RAC system:
     1. Stop instances running on node 1.
==》

[oracle@rac1 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.myrac.db   application    ONLINE    ONLINE    rac2        
ora....c1.inst application    ONLINE    ONLINE    rac1        
ora....c2.inst application    ONLINE    ONLINE    rac2        
ora....SM1.asm application    ONLINE    ONLINE    rac1        
ora....C1.lsnr application    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2     


[oracle@rac1 ~]$ srvctl stop instance -d myrac -i myrac1 -o immediate
[oracle@rac1 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.myrac.db   application    ONLINE    ONLINE    rac2        
ora....c1.inst application    OFFLINE   OFFLINE               
ora....c2.inst application    ONLINE    ONLINE    rac2        
ora....SM1.asm application    ONLINE    ONLINE    rac1        
ora....C1.lsnr application    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2  


[oracle@rac1 ~]$ srvctl stop asm -n rac1
[oracle@rac1 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.myrac.db   application    ONLINE    ONLINE    rac2        
ora....c1.inst application    OFFLINE   OFFLINE               
ora....c2.inst application    ONLINE    ONLINE    rac2        
ora....SM1.asm application    OFFLINE   OFFLINE               
ora....C1.lsnr application    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2        


[oracle@rac1 ~]$ srvctl stop nodeapps -n rac1
[oracle@rac1 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.myrac.db   application    ONLINE    ONLINE    rac2        
ora....c1.inst application    OFFLINE   OFFLINE               
ora....c2.inst application    ONLINE    ONLINE    rac2        
ora....SM1.asm application    OFFLINE   OFFLINE               
ora....C1.lsnr application    OFFLINE   OFFLINE               
ora.rac1.gsd   application    OFFLINE   OFFLINE               
ora.rac1.ons   application    OFFLINE   OFFLINE               
ora.rac1.vip   application    OFFLINE   OFFLINE               
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2        
[oracle@rac1 ~]$ 

===> 自己加入的备份$ORACLE_HOME
[oracle@rac1 10.2.0]$ pwd
/opt/oracle/product/10.2.0
[oracle@rac1 10.2.0]$ cp -r db1 db1_bak
[oracle@rac1 10.2.0]$ 
[oracle@rac1 10.2.0]$ 
[oracle@rac1 10.2.0]$ du -sm db1*
1886    db1
1886    db1_bak

=======================

     2. Run 'opatch apply /10214450' on node 1.
==》
[oracle@rac1 ~]$ cd patch/
[oracle@rac1 patch]$ ls
10214450
[oracle@rac1 patch]$ cd 10214450/
[oracle@rac1 10214450]$ ls
etc  files  README.txt

[oracle@rac1 10214450]$ opatch apply /home/oracle/patch/10214450/
Invoking OPatch 10.2.0.4.2

Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation.  All rights reserved.


Oracle Home       : /opt/oracle/product/10.2.0/db1
Central Inventory : /opt/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.4.2
OUI version       : 10.2.0.4.0
OUI location      : /opt/oracle/product/10.2.0/db1/oui
Log file location : /opt/oracle/product/10.2.0/db1/cfgtoollogs/opatch/opatch2011-12-04_10-38-14AM.log

ApplySession applying interim patch '10214450' to OH '/opt/oracle/product/10.2.0/db1'

Running prerequisite checks...

OPatch detected the node list and the local node from the inventory.  OPatch will patch the local system then propagate the patch to the remote nodes.


This node is part of an Oracle Real Application Cluster.
Remote nodes: 'rac2'
Local node: 'rac1'

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/opt/oracle/product/10.2.0/db1')



Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '10214450' for restore. This might take a while...
Backing up files affected by the patch '10214450' for rollback. This might take a while...

Patching component oracle.rdbms, 10.2.0.4.0...
Updating archive file "/opt/oracle/product/10.2.0/db1/lib/libserver10.a"  with "lib/libserver10.a/ksf.o"

Patching component oracle.rdbms.rsf, 10.2.0.4.0...
Updating archive file "/opt/oracle/product/10.2.0/db1/lib/libgeneric10.a"  with "lib/libgeneric10.a/kgx.o"

Patching component oracle.rsf.hybrid, 10.2.0.4.0...
Updating archive file "/opt/oracle/product/10.2.0/db1/lib32/libgeneric10.a"  with "lib32/libgeneric10.a/kgx.o"
Running make for target ikfod
Running make for target ioracle
Running make for target client_sharedlib
ApplySession adding interim patch '10214450' to inventory

Verifying the update...
Inventory check OK: Patch ID 10214450 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 10214450 are present in Oracle Home.

The local system has been patched.  You can restart Oracle instances on it.


Patching in rolling mode.


The node 'rac2' will be patched next.


Please shutdown Oracle instances running out of this ORACLE_HOME on 'rac2'.
(Oracle Home = '/opt/oracle/product/10.2.0/db1')

Is the node ready for patching? [y|n]



     3. When the apply finishes, opatch asks for confirmation
        before going on to apply the patch to node 2.
==》 
Seen from step 3 last lines.
The node 'rac2' will be patched next.


Please shutdown Oracle instances running out of this ORACLE_HOME on 'rac2'.
(Oracle Home = '/opt/oracle/product/10.2.0/db1')

Is the node ready for patching? [y|n]




     4. Start instances on node 1.
==》
[oracle@rac1 ~]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.myrac.db   application    ONLINE    ONLINE    rac2       
ora....c1.inst application    OFFLINE   OFFLINE              
ora....c2.inst application    ONLINE    ONLINE    rac2       
ora....SM1.asm application    OFFLINE   OFFLINE              
ora....C1.lsnr application    OFFLINE   OFFLINE              
ora.rac1.gsd   application    OFFLINE   OFFLINE              
ora.rac1.ons   application    OFFLINE   OFFLINE              
ora.rac1.vip   application    OFFLINE   OFFLINE              
ora....SM2.asm application    ONLINE    ONLINE    rac2       
ora....C2.lsnr application    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    ONLINE    rac2       

[oracle@rac1 ~]$ srvctl start nodeapps -n rac1
[oracle@rac1 ~]$
[oracle@rac1 ~]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.myrac.db   application    ONLINE    ONLINE    rac2       
ora....c1.inst application    OFFLINE   OFFLINE              
ora....c2.inst application    ONLINE    ONLINE    rac2       
ora....SM1.asm application    OFFLINE   OFFLINE              
ora....C1.lsnr application    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    ONLINE    rac1       
ora....SM2.asm application    ONLINE    ONLINE    rac2       
ora....C2.lsnr application    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    ONLINE    rac2       

[oracle@rac1 ~]$ srvctl start asm -n rac1
[oracle@rac1 ~]$
[oracle@rac1 ~]$
[oracle@rac1 ~]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.myrac.db   application    ONLINE    ONLINE    rac2       
ora....c1.inst application    OFFLINE   OFFLINE              
ora....c2.inst application    ONLINE    ONLINE    rac2       
ora....SM1.asm application    ONLINE    ONLINE    rac1       
ora....C1.lsnr application    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    ONLINE    rac1       
ora....SM2.asm application    ONLINE    ONLINE    rac2       
ora....C2.lsnr application    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    ONLINE    rac2

       
[oracle@rac1 ~]$ srvctl start instance -d myrac -i myrac1
[oracle@rac1 ~]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.myrac.db   application    ONLINE    ONLINE    rac2       
ora....c1.inst application    ONLINE    ONLINE    rac1       
ora....c2.inst application    ONLINE    ONLINE    rac2       
ora....SM1.asm application    ONLINE    ONLINE    rac1       
ora....C1.lsnr application    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    ONLINE    rac1       
ora....SM2.asm application    ONLINE    ONLINE    rac2       
ora....C2.lsnr application    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    ONLINE    rac2       
[oracle@rac1 ~]$ 

     5. Stop instances running on node 2.
==》
[oracle@rac2 ~]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.myrac.db   application    ONLINE    ONLINE    rac2       
ora....c1.inst application    ONLINE    ONLINE    rac1       
ora....c2.inst application    ONLINE    ONLINE    rac2       
ora....SM1.asm application    ONLINE    ONLINE    rac1       
ora....C1.lsnr application    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    ONLINE    rac1       
ora....SM2.asm application    ONLINE    ONLINE    rac2       
ora....C2.lsnr application    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    ONLINE    rac2       
[oracle@rac2 ~]$
[oracle@rac2 ~]$
[oracle@rac2 ~]$
 srvctl stop instance -d myrac -i myrac2
[oracle@rac2 ~]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.myrac.db   application    ONLINE    ONLINE    rac2       
ora....c1.inst application    ONLINE    ONLINE    rac1       
ora....c2.inst application    OFFLINE   OFFLINE              
ora....SM1.asm application    ONLINE    ONLINE    rac1       
ora....C1.lsnr application    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    ONLINE    rac1       
ora....SM2.asm application    ONLINE    ONLINE    rac2       
ora....C2.lsnr application    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    ONLINE    rac2       
[oracle@rac2 ~]$
 

[oracle@rac2 ~]$ srvctl stop asm -n rac2
[oracle@rac2 ~]$
[oracle@rac2 ~]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.myrac.db   application    ONLINE    ONLINE    rac2       
ora....c1.inst application    ONLINE    ONLINE    rac1       
ora....c2.inst application    OFFLINE   OFFLINE              
ora....SM1.asm application    ONLINE    ONLINE    rac1       
ora....C1.lsnr application    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    ONLINE    rac1       
ora....SM2.asm application    OFFLINE   OFFLINE              
ora....C2.lsnr application    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    ONLINE    rac2        


[oracle@rac2 ~]$
 srvctl stop nodeapps -n rac2
[oracle@rac2 ~]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.myrac.db   application    ONLINE    ONLINE    rac2       
ora....c1.inst application    ONLINE    ONLINE    rac1       
ora....c2.inst application    OFFLINE   OFFLINE              
ora....SM1.asm application    ONLINE    ONLINE    rac1       
ora....C1.lsnr application    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    ONLINE    rac1       
ora....SM2.asm application    OFFLINE   OFFLINE              
ora....C2.lsnr application    OFFLINE   OFFLINE              
ora.rac2.gsd   application    OFFLINE   OFFLINE              
ora.rac2.ons   application    OFFLINE   OFFLINE              
ora.rac2.vip   application    OFFLINE   OFFLINE               

==》自己的步骤,备份$ORACLE_HOME

[oracle@rac2 10.2.0]$ cp -r db1 db1_bak
[oracle@rac2 10.2.0]$ du -sm db1 db1_bak/
1846    db1
1846    db1_bak/

=====================



     6. Ask opatch to continue to applying the patch to node 2.
==》
The node 'rac2' will be patched next.


Please shutdown Oracle instances running out of this ORACLE_HOME on 'rac2'.
(Oracle Home = '/opt/oracle/product/10.2.0/db1')

Is the node ready for patching? [y|n]
y
User Responded with: Y
Updating nodes 'rac2'
   Apply-related files are:
     FP = "/opt/oracle/product/10.2.0/db1/.patch_storage/10214450_Nov_24_2010_10_44_52/rac/copy_files.txt"
     DP = "/opt/oracle/product/10.2.0/db1/.patch_storage/10214450_Nov_24_2010_10_44_52/rac/copy_dirs.txt"
     MP = "/opt/oracle/product/10.2.0/db1/.patch_storage/10214450_Nov_24_2010_10_44_52/rac/make_cmds.txt"
     RC = "/opt/oracle/product/10.2.0/db1/.patch_storage/10214450_Nov_24_2010_10_44_52/rac/remote_cmds.txt"

Instantiating the file "/opt/oracle/product/10.2.0/db1/.patch_storage/10214450_Nov_24_2010_10_44_52/rac/copy_files.txt.instantiated" by replacing $ORACLE_HOME in "/opt/oracle/product/10.2.0/db1/.patch_storage/10214450_Nov_24_2010_10_44_52/rac/copy_files.txt" with actual path.
Propagating files to remote nodes...
Instantiating the file "/opt/oracle/product/10.2.0/db1/.patch_storage/10214450_Nov_24_2010_10_44_52/rac/copy_dirs.txt.instantiated" by replacing $ORACLE_HOME in "/opt/oracle/product/10.2.0/db1/.patch_storage/10214450_Nov_24_2010_10_44_52/rac/copy_dirs.txt" with actual path.
Propagating directories to remote nodes...
Instantiating the file "/opt/oracle/product/10.2.0/db1/.patch_storage/10214450_Nov_24_2010_10_44_52/rac/make_cmds.txt.instantiated" by replacing $ORACLE_HOME in "/opt/oracle/product/10.2.0/db1/.patch_storage/10214450_Nov_24_2010_10_44_52/rac/make_cmds.txt" with actual path.
Running command on remote node 'rac2':
cd /opt/oracle/product/10.2.0/db1/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ikfod ORACLE_HOME=/opt/oracle/product/10.2.0/db1 || echo REMOTE_MAKE_FAILED::>&2

Running command on remote node 'rac2':
cd /opt/oracle/product/10.2.0/db1/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/opt/oracle/product/10.2.0/db1 || echo REMOTE_MAKE_FAILED::>&2

Running command on remote node 'rac2':
cd /opt/oracle/product/10.2.0/db1/network/lib; /usr/bin/make -f ins_net_client.mk client_sharedlib ORACLE_HOME=/opt/oracle/product/10.2.0/db1 || echo REMOTE_MAKE_FAILED::>&2


The node 'rac2' has been patched.  You can restart Oracle instances on it.

There were relinks on remote nodes.  Remember to check the binary size and timestamp on the nodes 'rac2' .
The following make commands were invoked on remote nodes:
'cd /opt/oracle/product/10.2.0/db1/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ikfod ORACLE_HOME=/opt/oracle/product/10.2.0/db1
cd /opt/oracle/product/10.2.0/db1/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/opt/oracle/product/10.2.0/db1
cd /opt/oracle/product/10.2.0/db1/network/lib; /usr/bin/make -f ins_net_client.mk client_sharedlib ORACLE_HOME=/opt/oracle/product/10.2.0/db1
'



OPatch succeeded.

     7. Start instances on node 2.  
==》   
[oracle@rac2 10.2.0]$ srvctl start nodeapps -n rac2
[oracle@rac2 10.2.0]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.myrac.db   application    ONLINE    ONLINE    rac2       
ora....c1.inst application    ONLINE    ONLINE    rac1       
ora....c2.inst application    OFFLINE   OFFLINE              
ora....SM1.asm application    ONLINE    ONLINE    rac1       
ora....C1.lsnr application    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    ONLINE    rac1       
ora....SM2.asm application    OFFLINE   OFFLINE              
ora....C2.lsnr application    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    ONLINE    rac2   
    
[oracle@rac2 10.2.0]$ srvctl start asm -n rac2
[oracle@rac2 10.2.0]$
[oracle@rac2 10.2.0]$ srvctl start instance -d myrac -i myrac2
[oracle@rac2 10.2.0]$
[oracle@rac2 10.2.0]$
[oracle@rac2 10.2.0]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.myrac.db   application    ONLINE    ONLINE    rac2       
ora....c1.inst application    ONLINE    ONLINE    rac1       
ora....c2.inst application    ONLINE    ONLINE    rac2       
ora....SM1.asm application    ONLINE    ONLINE    rac1       
ora....C1.lsnr application    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    ONLINE    rac1       
ora....SM2.asm application    ONLINE    ONLINE    rac2       
ora....C2.lsnr application    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    ONLINE    rac2       
[oracle@rac2 10.2.0]$ 

检查两个节点的补丁情况:
节点1:
[oracle@rac1 10214450]$ opatch lsinv -all
Invoking OPatch 10.2.0.4.2

Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation.  All rights reserved.


Oracle Home       : /opt/oracle/product/10.2.0/db1
Central Inventory : /opt/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.4.2
OUI version       : 10.2.0.4.0
OUI location      : /opt/oracle/product/10.2.0/db1/oui
Log file location : /opt/oracle/product/10.2.0/db1/cfgtoollogs/opatch/opatch2011-12-04_11-33-35AM.log

Lsinventory Output file location : /opt/oracle/product/10.2.0/db1/cfgtoollogs/opatch/lsinv/lsinventory2011-12-04_11-33-35AM.txt

--------------------------------------------------------------------------------
List of Oracle Homes:
  Name          Location
   OraCrs10g_home         /opt/oracle/product/crs
   OraDb10g_home1         /opt/oracle/product/10.2.0/db1

Installed Top-level Products (2):

Oracle Database 10g                                                  10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3                            10.2.0.4.0
There are 2 products installed in this Oracle Home.


Interim patches (1) :

Patch  10214450     : applied on Sun Dec 04 10:39:48 CST 2011
   Created on 24 Nov 2010, 10:44:52 hrs PST8PDT
   Bugs fixed:
     10214450



Rac system comprising of multiple nodes
  Local node = rac1
  Remote node = rac2

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

OPatch succeeded.
[oracle@rac1 10214450]$ 


节点2:
[oracle@rac2 10.2.0]$ opatch lsinv -all
Invoking OPatch 10.2.0.4.2

Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation.  All rights reserved.


Oracle Home       : /opt/oracle/product/10.2.0/db1
Central Inventory : /opt/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.4.2
OUI version       : 10.2.0.4.0
OUI location      : /opt/oracle/product/10.2.0/db1/oui
Log file location : /opt/oracle/product/10.2.0/db1/cfgtoollogs/opatch/opatch2011-12-04_11-36-19AM.log

Lsinventory Output file location : /opt/oracle/product/10.2.0/db1/cfgtoollogs/opatch/lsinv/lsinventory2011-12-04_11-36-19AM.txt

--------------------------------------------------------------------------------
List of Oracle Homes:
  Name          Location
   OraCrs10g_home         /opt/oracle/product/crs
   OraDb10g_home1         /opt/oracle/product/10.2.0/db1

Installed Top-level Products (2):

Oracle Database 10g                                                  10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3                            10.2.0.4.0
There are 2 products installed in this Oracle Home.


Interim patches (1) :

Patch  10214450     : applied on Sun Dec 04 10:39:48 CST 2011
   Created on 24 Nov 2010, 10:44:52 hrs PST8PDT
   Bugs fixed:
     10214450



Rac system comprising of multiple nodes
  Local node = rac2
  Remote node = rac1

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

OPatch succeeded.




已使用上面的方法进行打补丁:

Patch Installation Steps:
-------------------------


1.  Set your current directory to the directory where the patch is located.

  cd /10214450

2.  Apply the patch.


Use the following command to apply the patch to the ORACLE_HOME:

  opatch apply

When OPatch starts, it will validate the patch and make sure there
are no conflicts with the software already installed in the ORACLE_HOME.
OPatch categorizes two types of conflicts:

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

  (b) Conflicts with subset patch already applied to the ORACLE_HOME
  In this case, please continue the install, as 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.



Patch Post Install Instructions:
--------------------------------



Patch Deinstallation Instructions:
----------------------------------

1. Make sure to follow the same pre-install steps when deinstalling
a patch.  This includes verifying the inventory and shutting down
any services running from the ORACLE_HOME / machine before rolling
the patch back.

2. Change to the directory where the patch was unzipped.
  cd /10214450

3. Run OPatch to deinstall the patch.
opatch rollback -id 10214450
阅读(1792) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~