Recently we upgraded our oracle database from 11.2.0.2 to 11.2.0.3 with latest SBP with out of Place Patching technique which involves minimum possible downtime for the database.

This is just a summary and should be used a reference only. Before starting the upgrade process for 11.2 oracle database, consult the relevant database upgrade guides first and then the important SAP notes. Few I have mentioned below.

1524205 – Oracle 11.2.0: Database Software Installation

1431800 – Oracle 11.2.0: Central Technical Note

1431797 – Oracle 11.2.0: Troubleshooting the Database Upgrade

1696869 – Patching of Oracle Homes with Minimal Downtime

1431793 – Oracle 11.2.0: Upgrade Scripts

As with any upgrade,before starting, take a full consistent backup of the oracle database and also the current oracle home and binaries. Anything can go wrong on any step during the upgrade.

After you have downloaded the oracle 11.2.0.3 database software, you should update the Oracle Installation scripts available with the database software, with the scripts which are attached to SAP Note 1524205

The SAP-specific installation scripts RUNINSTALLER, RUNINSTALLER_CHECK, and 11ginstall.sh are located in directory SAP in the Oracle database software. Stage the software at an appropriate location/nfs share or locally on the server.

Checking the Software Installation Prerequisites

Check the prerequisites for the Oracle Universal Installer (OUI).

  1. Log on as the Oracle user ora<dbsid>.
  2. Change to stage directory: 

cd /<stage_Directory>/database/SAP

Execute the following command to check operating system requirements (release, patches, and kernel parameters):

./RUNINSTALLER -check -install_home /oracle/SID/11203 -runtime_home /oracle/SID/112_64 -silent  -noinstall


Logs are also written in directory /oracle/SID/oraInventory/logs/  or where your oraInventory is located. Apply missing OS patches and set OS kernel parameters as recommended by the check results if any.

Database Software Installation

Check the Environment Variables. Do not make the changes to the environment permanent while the old database is  running permanent.We make them permanent in the database structure upgrade step.

  1. Make sure that the following environment variables are set for ora<sid>
  • ORACLE_BASE
  • ORACLE_SID
  • ORACLE_HOME
  • NLS_LANG
  • SAPDATA_HOME
  • LD_LIBRARY_PATH
  • PATH

Backing Up the Central Oracle Inventory


Before you install the new Oracle database patch set software, you need to back up the central Oracle inventory


Start the installation of new oracle software 11203 with the following command: Navigate to the oracle stage directory.


cd /<stage_Directory>/database/SAP


./RUNINSTALLER -silent -install_home /oracle/SID/11203 -runtime_home //oracle/SID/112_64


Let the process run and complete successfully.  Logs are also written in directory /oracle/SID/oraInventory/logs/  or where your oraInventory is located.


Installing the Required SAP Bundle Patch


After the Oracle database software installation, you need to install the required SAP bundle patch using the oracle SBP upgrade script.

  1. Download the latest SAP Bundle patch for oracle 11.0.2.0.3. Downloaded and copy to appropriate location
  2. Set ORACLE_HOME /oracle/SID/11203  ( New Oracle home)
  3. Do a cd to the SBP patch folder 
  4. Extract the latest version of Opatch and MOpatch from the zip file as below. ( We applied SBP SBP_112039_201402, so the commands are as below)
    • unzip -qd $ORACLE_HOME/sapbundle SAP11203V3P_1402-20009981.ZIP ‘SBP_112039_201402/OPatch/*’
    • mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch-pre-SBP_112039_201402
    • mv $ORACLE_HOME/sapbundle/SBP_112039_201402/OPatch $ORACLE_HOME/OPatch
    • unzip -qd $ORACLE_HOME/sapbundle SAP11203V3P_1402-20009981.ZIP ‘SBP_112039_201402/MOPatch/*’
    • test -d $ORACLE_HOME/MOPatch && mv $ORACLE_HOME/MOPatch $ORACLE_HOME/MOPatch-pre-SBP_112039_201402
    • mv $ORACLE_HOME/sapbundle/SBP_112039_201402/MOPatch $ORACLE_HOME/MOPatch

Please refer to the relevant SBP Readme.htm file on the exact commands based on the SBP you are applying

  5. Start the SBP bundle patch installation with the following command. Make sure link script is executed successfully at the very end.

   $ORACLE_HOME/MOPatch/mopatch.sh -v -s <Patch_zip_file>


Logs are also written in directory /oracle/SID/oraInventory/logs/  or where your oraInventory is located.


At this stage, our new oracle database software has been installed, SBP applied and ready for the upgrade.

Copying and Adapting the SQL*Net Files

After the database software installation, copy and modify the old SQL*Net files,  copy the SQL*Net parameter files from <old_ORACLE_HOME>/network/admin to <new_ORACLE_HOME>/network/admin.


Running the Pre-Upgrade Scripts

Run the Oracle pre-upgrade scripts, which automatically perform various tasks and checks on database. See SAP Note 1431793.

Always execute these scripts as the ora<dbsid> user connected to the database as sysdba in the pre-upgrade environment of the database to be upgraded

pre_upgrade_tasks.sql

pre_upgrade_status.sql


You can check the results of the pre-upgrade scripts by looking at the following log files:

pre_upgrade_status.log

pre_upgrade_tasks.log

Note: You can run the pre-upgrade scripts as often as necessary.

Oracle Database Upgrade

This section describes how to upgrade the Oracle database.

  1. Back up the Oracle database
  2. Shut down the SAP system and Oracle listener process.
  3. Upgrade the database structure.


To upgrade the database structure, you need to start the Oracle Database Upgrade Assistant (DBUA).

  1. Set environment variable ORACLE_HOME_SRC (mandatory). <ORACLE_HOME_SRC> specifies the source Oracle home. This is the Oracle home from which the database instance  is currently running and which is configured in environment variable ORACLE_HOME.

       setenv ORACLE_HOME_SRC $ORACLE_HOME

  2.  Set environment variable ORACLE_HOME_TGT (mandatory). <ORACLE_HOME_TGT> specifies the target Oracle home. This is the Oracle home 

      to which the database is going to  be upgraded.

       setenv ORACLE_HOME_TGT /oracle/SID/11203

Check DBUA help   ./dbua.sap. sh -help  (Silent Mode)

  1. Checking the Upgrade Environment / Upgrade Settings

cd $ORACLE_HOME_TGT/sap/ora_upgrade/post_upgrade

Start the DBUA wrapper script in query mode to check and review the upgrade environment without starting the database upgrade assistant DBUA.      ./dbua.sap.sh -q -t si -silent   (Silent Mode)


Upgrading database command:           ./dbua.sap.sh -silent  (Silent Mode)

At this point database has been upgraded to release 11.2.0.3 and has been shut down by the upgrade scriptDo not start the database as we are still in the old oracle home environment.


  • Rename old oracle home directory , remove the link 112_64 and recreate the link again as below.

               mv 1120x 1120x_old

rm /oracle/<DBSID>/112_64

ln -s /oracle/<DBSID>/11203 /oracle/<DBSID>/112_64

  • Unset obsolete environment variables

unsetenv ORACLE_HOME_SRC

unsetenv ORACLE_HOME_TGT

  • Start the oracle database from the upgraded new environment
  • Adjust your _fix_control & event parameters settings in spfile as mentioned in the patch README.html file and restart the db again.


You can check the upgrade status with the following command:

sqlplus / as sysdba @post_upgrade_status.sql

Check spool log file post_upgrade_status.log

Starting the Listener Process and SAP System

Make sure that you have copied the SQL*Net configuration files from the old Oracle installation to the location of the Oracle Database. As ora<sid> user.

Start the listener:  lsnrctl start

Do a <tnsping SID> to check the connectivity.

Check the connectivity of the SAP system with the upgrade database with command R3trans -d and if OK, start the SAP system


Backup the upgraded database consistently again. Same process can be used for upgrading to version 11.2.0.4. Please check the relevant upgrade guides for more information.


Thanks

Amit

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Durga Gadde

    Very nice document with all steps Amit.

    I am in the process of patch updating from 11203 to 11204. With reference to the above steps, while applying SBP, do we need to run catsbp.sql and subsequent parameter settings as per README file?

    Kindly suggest.

    (0) 
    1. Amit Bangotra Post author

      Hi Durga,

      Yes perform all the post processing tasks after applying the SBP and also run catsbp.sql at the end.

      In the end, because after installing 11204 and applying the SBP, the active database is till connected to 11203 and not 11204 , so you can’t run catsbp. Thanks

      Thanks

      Amit

      (0) 

Leave a Reply