Wednesday, June 15, 2011

How to apply SAP Bundle patch


SAP Note 1027012 - MOPatch - Install Multiple Oracle Patches in One Run
SAP Note 839182 - Installing patches using OPatch
SAP Note 1175996 - Automated Oracle 10g11g patches check
Extract of SAP Note 1027012 - MOPatch - Install Multiple Oracle Patches in One Run

Use the following commands to determine the versions of the OPatch and MOPatch utilities installed in an Oracle Home:
$ORACLE_HOME/OPatch/opatch version
$ORACLE_HOME/MOPatch/mopatch.sh -h
 

  1. Check SAP Bundle patch installed version.
You can find the version of the currently installed SBP in an Oracle Home in file $ORACLE_HOME/sapbundle/version.txt. After you have successfully run catsbp.sql, you can also find the SBP version in the database in view dba_registry_history in the most recent row associated with bundle series SBP.

  1. Oracle SAP Bundle Patch applies.
Need to follow below steps along with referring README.html file of SAP Bundle Patch zip file.
 
2.2 Installing the SAP Bundle Patch (as per README.html file of SAP Bundle Patch zip file)
Follow the steps below.
o    Check 1.4 OPatch and MOPatch Utility Information
You must use OPatch version 11.2.0.3.1 for installing this SBP. Later 11.2 OPatch versions are supported as well, but Oracle recommends to use version 11.2.0.3.1, since it has been fully tested to interoperate with this SBP.

You must use MOPatch version 2.1.13 or later for installing this SBP.
o    Stop all database applications, in particular all SAP applications.
Performed in step 1 above.
o    Shut down the database instances, the listeners, and other processes associated with the Oracle Home.
su - ora<sapsid>
testsap1:oraehp 51> lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 27-AUG-2012 17:00:07

Copyright (c) 1991, 2010, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=EHP.WORLD))
The command completed successfully
testsap1:oraehp 52>


o    Update OPatch version which downloaded from service market place.
su - ora<sapsid>
cp /tmp/opatch-112031.zip $ORACLE_HOME           
cd $ORACLE_HOME
unzip -d $ORACLE_HOME opatch-112031.zip
rm opatch-112031.zip
 
o    Update MOPatch version which downloaded from service market place.
su - ora<sapsid>
cp /tmp/mopatch-2_1_13.zip $ORACLE_HOME
cd $ORACLE_HOME
unzip -d $ORACLE_HOME mopatch-2_1_13.zip
rm mopatch-2_1_13.zip

o    Recommended as per README file
      Some of the patches from a previous SBP have been reverted to an earlier patch version or obsoleted without being replaced by newer patches. Uninstall these patches manually as follows:

su - ora<sapsid>
/bin/sh $ORACLE_HOME/OPatch/opatch nrollback -silent -local -id 9935787,10401327,13603688,13603695

Check installed Opatch id with below command
/oracle/EHP/112_64/OPatch/opatch lsinventory -patch

o    Install the SAP Bundle Patch (11.2.0.2.7) as follows:
Create patch base directory
su - ora<sapsid>
cd /oracle/<SAPSID>
mkdir patches.112027
mv /tmp/SAP_112027_201208_LINX8664.zip /oracle/<SAPSID>/patches.112027
cd /oracle/<SAPSID>/patches.112027
/bin/sh $ORACLE_HOME/MOPatch/mopatch.sh -v -s SAP_112027_201208_LINX8664.zip
           
Check the generated MOPatch report for errors or unresolved conflicts. To resolve them, refer to section 4, "Known Issues" and to section "Resolving Patch Conflicts and Errors" of SAP Note 1027012 MOPatch - Install Multiple Oracle Patches in One Run.

o    Start up the database instances, the listeners, and other processes associated with the Oracle Home.
su - oraehp
lsnrctl start
sqlplus “/nolog”
conn sys as sysdba
startup;

o    2.3 Executing Post-Installation Instructions (setting oracle parameters)

Patch 14208494 (CBO Merge Patch), added in SBP 11.2.0.2.7 201208

Please use the following statements to adjust your _fix_control and event settings in your spfile according to SAP note 1431798 with the new SBP:

ALTER SYSTEM SET "_FIX_CONTROL"=
'5099019:ON','5705630:ON','6055658:OFF','6399597:ON','6430500:ON','6440977:ON',
'6626018:ON','6972291:ON','8937971:ON','9196440:ON','9495669:ON','13077335:ON',
'13627489:ON'
COMMENT='SAP_112027_201208 RECOMMENDED SETTINGS'
SCOPE=SPFILE;

ALTER SYSTEM SET EVENT=
'10027',
'10028',
'10142',
'10183',
'10191',
'10995 level 2',
'31991',
'38068 level 100',
'38085',
'38087',
'44951 level 1024'
COMMENT='SAP_112026_201207 RECOMMENDED SETTINGS'
SCOPE=SPFILE;

Please restart the database after you have adjusted these parameters.

o    For each database instance running from the Oracle home*, connect to the database instance as SYSDBA using SQL*Plus and run the post-installation script catsbp.sql: ( total time taken 2 hrs )

cd /oracle/EHP/11202/sapbundle/SBP_112027_201208

sqlplus / as sysdba
SQL> @/oracle/EHP/11202/sapbundle/SBP_112027_201208/catsbp.sql
SQL> quit

The script evaluates the log files generated by all intermediate steps for unkown errors. If it detects such errors, refer to the log files for more information, resolve the errors and, depending on the error cause, re-start the script. The script may furthermore perform some checks on whether additional post-installation actions are required depending on the state of the database.

To avoid an extra shutdown-startup cycle of the database instance, you should implement any system parameter changes (for example, additions of events and fix controls) from section 2.3, "Executing Post-Installation Instructions" in the above step as well.

o    2.3 Executing Post-Installation Instructions

Patch 14243939, added in SBP 11.2.0.2.7 201208

    After catsbp.sql has been executed please check if there are some invalid objects left over.
    If this is the case please run utlrp.sql to get rid of those invalid objects.

    Please perform the following steps:
      cd /oracle/EHP/11202/
      sqlplus sys as sysdba
    -- List all invalid objects before executing utlrp.sql
       spool invalid_objects_before_utlrp.txt
set cmdsep on
set lines 150 pages 40
col compiled_at for a30; col compiled_by for a10; col owner for a10; col object_name for a35;
col object_type for a12; col object_id for 999999 head obj_id
select do.owner,do.object_name,do.object_type,urc.*
from utl_recomp_compiled urc, dba_objects do where urc.obj# = do.object_id order by compiled_at;

select owner,object_name,object_id,object_type,created,last_ddl_time,timestamp,status
from dba_objects where status = 'INVALID' order by object_name;
spool off

    -- Execute utlrp
       @/oracle/EHP/11202/rdbms/admin/utlrp.sql

    -- List all invalid objects after executing utlrp.sql
       spool invalid_objects_after_utlrp.txt
set cmdsep on
set lines 150 pages 40
col compiled_at for a30; col compiled_by for a10; col owner for a10; col object_name for a35;
col object_type for a12; col object_id for 999999 head obj_id
select do.owner,do.object_name,do.object_type,urc.*
from utl_recomp_compiled urc, dba_objects do where urc.obj# = do.object_id order by compiled_at;

select owner,object_name,object_id,object_type,created,last_ddl_time,timestamp,status
from dba_objects where status = 'INVALID' order by object_name;
spool off
Patch 14252895, added in SBP 11.2.0.2.7 201208 (already fixed earlier hence not perform this time)

    To enable this fix event 31991 level 1 has to be set.

    To set this event 31991 please use the 'ALTER SYSTEM SET EVENT' statement that is listed in the Post-Installation Instructions section for the current CBO Merge Patch.

    Please restart the database after you have adjusted these parameters.

Patch 13575265, added in SBP 11.2.0.2.5 201203      (not performed below as not using DATA VAULT)

    For Database Vault systems, if Database Vault is already installed,
    run the following script (for RAC systems, run the script on one of the nodes):

    sqlplus / as sysdba                                                    
    spool patch_13575265.log                                           
    @?/rdbms/admin/prvtlbac.plb                                       
    spool off                                                         
    exit  

    The following error message can be ignored:
    'ORA-00955: name is already used by an existing object'

o    Oracle PSUs don't change the oracle release version/fifth digit. That is also described in metalink note #861152.1.
The significance of each number (reading from left to right) is as follows: The release number is 11.2.0.2.0.
11 is the major database release number
2 is the database maintenance release number
0 is the application server release number
2 is the component-specific release number
0 is the platform-specific release number

You can verify the installed PSUs / SBPs with the following query (check the comment section):
1.execute below query
set linesize 500
select substr(action_time,1,30) action_time, substr(id,1,10) id, substr(action,1,10) action,
substr(version,1,8) version, substr(BUNDLE_SERIES,1,6) bundle, substr(comments,1,20) comments
from registry$history;

2. execute below query (this get updated post executation catsbp.sql script after SBP update. if you fogot to execute this script you will not get detail in this view)
select * from dba_registry_history;

o    Start all database applications, in particular all SAP applications.