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. 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
1524205 - Oracle 11.2.0: Database Software Installation
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).
- Log on as the Oracle user ora<dbsid>.
- 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
Checking and Setting the Environment Variables. Make sure that you set the environment variables as described below for the duration of this session only.
Do not make the changes to the environment permanent while the old database is running.We make them permanent in the database structure upgrade step.
- 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 -ignorePrereq –ignoreSysPrereqs
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.
- Download the latest SAP Bundle patch for oracle 11.0.2.0.3. Downloaded and copy to appropriate location
- Set ORACLE_HOME /oracle/SID/11203
- Do a cd to the SBP patch folder
- 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 file on the exact commands base on the SBP you are applying
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.
Till, now our new oracle database software is 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.
- Back up the Oracle database
- Shut down the SAP system and Oracle listener process from veritas cluster
- Upgrade the database structure.
To upgrade the database structure, you need to start the Oracle Database Upgrade Assistant (DBUA).
- 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)
- 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 script. Do not start the database as we are still in the old oracle home environment.
- Rename old oracle home
- Unset obsolete environment variables
unsetenv ORACLE_HOME_SRC
unsetenv ORACLE_HOME_TGT
- Start the oracle database from the upgraded new environment
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
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:
tlsnrctl start
Do a <tnsping SID> to check the connectivity.
Starting the SAP System
Check the connectivity of the SAP system with the upgrade database with command R3trans -d