Recently we upgraded our oracle database from 188.8.131.52 to 184.108.40.206 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.
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 220.127.116.11 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).
- Log on as the Oracle user ora<dbsid>.
- Change to stage directory:
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.
- Make sure that the following environment variables are set for ora<sid>
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.
./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.
- Download the latest SAP Bundle patch for oracle 18.104.22.168.3. Downloaded and copy to appropriate location
- Set ORACLE_HOME /oracle/SID/11203 ( New Oracle home)
- 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.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
You can check the results of the pre-upgrade scripts by looking at the following log files:
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.
- 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
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 22.214.171.124 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
ln -s /oracle/<DBSID>/11203 /oracle/<DBSID>/112_64
- Unset obsolete environment variables
- 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 126.96.36.199. Please check the relevant upgrade guides for more information.