ORACLE UPGRADE STEPS FROM 11g TO 12c FOR SAP SYSTEMS ON LINUX - PART I
Document creation date : 10th OCT 2015 | 09:30 AM INDIA
Document Part : 1st
Document Author : Gaurav Rana
Referred SAP Guide : Database Upgrade Guide to Oracle database 12c Release 1 (12.1.0.2 ) UNIX
Referred SAP NOTES : 1. NOTE : 1914631 - Starting point for info about oracle 12c .
2. NOTE : 1915317-Migrating Software owner to 'oracle'
3. NOTE : 1915323 - OS User Concept for database release 12c.
STEPS TO FOLLOW :
PREREQUISITES
a) Source release must be Oracle DB 10.2.0.5,11.2.0.2,11.2.0.3 or 11.2.0.4 (Check your database version with command, SQL>select version from v$instance;)
b) Only 12.1.0.2 release 1 is supported for SAP platforms instead of 12.1.0.1 .
c) For SAP environments, Oracle Instant Client versions 11.2.0.4 and 12.1.0.2 are supported.
RESTRICTIONS
a) In order to run the SAP system with Oracle Instant Client version 12.1.0.2 ,you'll have to apply the SAP support packages from SAP Note 1777021.
b) SAP Kernel release must be >= 7.21 EXT.
c) SAP BR*Tools minimum version for 12.1: BR*Tools 7.40 Patch Level 14.
d) Mandatory to apply the appropriate SAP Support package according to SAP Note 2157904.
e) Must be applied before or immediately after a database upgrade to Oracle release 12c or after a new installation with Oracle release 12c.
f) Secure Storage on File System (SSFS) must be configured and enabled to run SAP with Oracle Database 12c.
CHECKLIST BEFORE STARTING SAP SYSTEM OF UPGRADED SYSTEM
a). Migration of oracle software owner from ora<sid> to 'oracle'.
b). Installation of database 12.1.0.2 with Patches.
c). Install the latest Oracle client (12.1.0.2) for the database 12.1.0.2 .
d). Update BR*Tools with version 7.40 .
e). SSFS database connection configurations (SAP Notes 1639578 & 1622837) .
PREPARATION
a). Download the Oracle 12c software with patches from http://service.sap.com
b). Download latest version of DBATOOLS (BR*Tools) which we need to be used after the upgrade .
c). Set the display parameters <host_name>:0.0 or use command xhost + .
CHECKLIST STEPS IN DETAIL
a) Migration of database user ora<sid> to 'oracle' user .
For the step i recommends to refer SAP NOTE 1915317-Migrating Software owner to 'oracle' or can follow steps as below :
1.Shutdown the running SAP System & the database with use of command stopsap all or can stop the SAP System & Database individually along with listener with command lsnrctl stop .
2.Creation of oracle software owner account 'oracle' from the root account
# groupadd oinstall
# useradd -g oinstall -G dba,oper -c "Oracle Software Owner" -m -s "/bin/sh" oracle
# passwd oracle
# su - oracle -c "id;pwd"
3.Modification of SAP Admin account <sapsid>adm
Add the <sapsid>adm account as OS group 'oinstall' (Required to run BR*TOOLS)
# groupmod -A <sapsid>adm oinstall or execute
# usermod -G sapsys,sapinst,dba,oper,oinstall <sid>adm
4.Modification of Database Admin account 'ora<dbsid>
Log on as 'root' and run the commands ...
# mkdir -p /home/ora<dbsid>
# chown orasbx:dba /home/ora<dbsid>
# usermod -d /home/orasbx ora<dbsid>
# usermod -g dba -G oper,oinstall ora<dbsid>
From the root account :
# cd /oracle/<SID>
# mv .profile .login .bashrc .cshrc .sap* .dbenv* .j2eenv* /home/ora<dbsid>
# mv startdb stopdb /home/ora<dbsid>
# chown -R ora<dbsid>:dba /home/ora<dbsid>
Oracle Environment consistency
Note : If Oracle env for <SID> set for user 'oracle' differs from the oracle env for user <SID>ADM then system will not connect to the database.
To check, logon with user account <sid>adm & oracle to verify variables ORACLE_BASE,ORACLE_HOME & ORACLE_SID which should be set identical .
Ownership changes for data files & directories
Permissions & ownerships can be changed with help of script 'orasid2oracle.sh' (Script is attached with SAP Note 1915317 named orasid2oracle.zip)
On unzip the file, a directory will be created with name sapnote_1915317, contains executable script orasid2oracle.sh.
Parameters to be set before execution of the script :
1.Log on with root account
#export SAPDATA_HOME=/oracle/<SID>
#export ORACLE_BASE=/oracle/<SID>
#export DB_SID=<SID>
2.To test run
#./orasid2oracle.sh -v
3.To perform changes
#./orasid2oracle.sh -v -exec
Ownership change of Oracle Home
Under this step we’ll change the software owner of Oracle Home from ‘ora<sid>’ to ‘oracle’ and same can be achieved with the help of oracle cloning tool from SAP Note 1983457 (Recommended).
You can find the clone tool script named clone_oh-1.7-005.zip as an attachment with the SAP Note 1983457,& on extraction of the zip file a new directory will be created as sapnote_1983457.
From the directory we need to execute clone_assistant.sh .
Steps to execute clone_assistant.sh
Log on as ora<dbsid> & execute clone_assistant.sh script to generate the scripts.This script will ask some questions for further execution steps, For help sample answers can be find from the same SAP Note 1983457.
To save generated scripts from clone_assistant.sh we can provide our own location on the system. For ex. /oracle/<SID>/ora_clone/pkg_clone_oh/change_sw_owner/
Scripts generated by the execution of clone_assistant.sh will be as follows :
config00_settings.sh
config01_show_env.sh
config02_detach_oh.sh
config03_set_swowner.sh
config04_clone_oh.sh
config05_run_rootsh.sh
config06_cleanup.sh
From the script directory execute the generated Oracle Home configuration scripts as per steps
From the old software owner ora<dbsid>
su - ora<dbsid>
>./config01_show_env.sh
>./config02_detach_oh.sh
As a root user
# ./config03_set_swowner.sh
From the new software owner ‘oracle’
>./config04_clone_oh.sh
As a root user
#./config05_run_rootsh.sh
For cleanup action, login as a old software owner
su – ora<dbsid>
>./config06_cleanup.sh
STARTING OF DATABASE LISTENER AS A NEW SOFTWARE OWNER ‘oracle’
During startup of listener from new software owner ‘oracle’ i experienced troubles in terms of environment variable settings for same.
As shell of new owner ‘oracle’ by default was /bin/sh & unable to execute commands lsnrctl status / lsnrctl start & was getting message command not found.(More obviously it’s an issue related with wrong environment settings).
WORKAROUND TO OVERCOME THE ISSUE. (WILL UPDATE SOON WITH DEFAULT SHELL ENVIRONMENT SETTINGS TO AVOID TO FOLLOW ANY WORKAROUND).
Changed the shell from /bin/sh to /bin/bash under system file /etc/paaswd for new database software owner ‘oracle’
Insertion of environment variables ORACLE_SID,ORACLE_HOME,ORACLE_BASE & PATH under .bash_profile file of new software owner ‘oracle’
su – oracle
ls –a
After saving the values under file .bash_profile ,re login with user as ‘oracle’ & check to execute command lsnrctl start for starting the database listener.
su – oracle
Next step is to start the database with new software owner ‘oracle’
su – oracle
If any issues (ORA-01033) occurs during the startup of database instance kindly refer troubleshooting part of SAP Note 1915317 .Mainly the issue happens only when oracle environment (ORACLE_HOME,ORACLE_SID,ORACLE_BASE) is not identical to the Oracle environment of <sapsid>adm..
DATABASE CONNECTIVITY CHECK from account <sapsid>adm
su - <sid>adm
>R3trans –d
Hope after following all steps you’ll be able to get R3trans finish code result 0000.If any issue happens you can refer trans.log file for analysis.
Configuration of Secure Storage in File System :
To configure SSFS database connection configurations in detail for the system you can follow SAP Notes 1639578 & 1622837 & some good documents on SCN http://scn.sap.com/docs/DOC-49333 .
INSTALLATION OF ORACLE DATABASE SOFTWARE
Pre-Steps
Before installation of Oracle Database software we need to take the backup of central oracle inventory.
Location of inventory for Linux could be found in file oraInst.loc under /etc .
Create directory to place the extracted Oracle database 12c software.
Updating the SAP RUNINSTALLER Scripts
Check the patch level of RUNINSTALLER & check with SAP Note 1915301 for a higher version is available.
Latest available RUNINSTALLER version at SAP NOTE 1915301 is
| 2015-06-0 |
So we can upgrade existing i.e from Patch level 058 up to 059 by following the SAP Note 1915301.
Installation of a new SAP RUNINSTALLER version :
1. Download the latest RUNINSTALLER package from the SAP NOTE as 12cinstall-12102-059-complete-201506021232.zip.
2. Extract the zip file under /oracle/stage/12102/database/SAP .
3.After extraction a new directory with similar name of SAP will get created under /oracle/stage/12102/database/SAP/ .You can replace the newly created SAP directory with old directory SAP.
On re-checking the RUNINSTALLER version we’ll get the latest version i.e patch level 059.
DATABASE SOFTWARE INSTALLATION PREREQUISITES
Procedure:
1.Log on as Oracle database software owner ‘oracle’
2.Set environment variable DB_SID,ORACLE_STAGE
Execute the below commands in dialog mode
Fix the above warning by executing the script runfixup.sh which is generated by selecting tab Fix & check again.
Oracle 12c database Installation:
Logon with new software owner ‘oracle’ to execute RUNINSTALLER .Before execution of RUNINSTALLER don’t forget to set two environment variables (DB_SID,ORACLE_STAGE).
Provide relevant information as required by the software to proceed further.
Execute the root.sh script from the location /oracle/<SID>/12102 & click on OK to finish the installation of 12c database.
INSTALLATION OF CURRENT SAP BUNDLE PATCH
Download the latest available SAP latest Bundle patch (SAP12102P_1509-20012300.ZIP) from https://support.sap.com/software/databases.html .
Refer README.html file from the software extraction to follow steps or follow steps as below :
Download the latest patch available (SAP12102P_1509-20012300.ZIP) from the service marketplace & save it under directory /oracle/stage by changing permissions & ownerships from root user to new database software owner.
Setting of environment variables IHRDBMS & OHRDBMS
Before proceeding we need to set the parameters IHRDBMS & OHRDBMS for the env of user ‘oracle’
>su – oracle
>env
>export IHRDBMS=/oracle/<SID>/121
>export OHRDBMS=/oracle/<SID>/12102
INSTALLING THE SAP BUNDLE PATCH
Before installation of SAP Bundle Patch need to follow the steps.
Stop all database applications, in particular all SAP applications.
Shut down the database instances, the listeners, and other processes running from the Oracle Home.
Install the SAP Bundle Patch as follows:
env ORACLE_HOME=$IHRDBMS $IHRDBMS/MOPatch/mopatch.sh -v -s SAP12102P_1509-20012300.ZIP
After successful installation we’ll be able to get screen as similar
Start up the database instances, the listeners, and other processes running from the Oracle Home
PRE-UPGRADE SCRIPT RUNNING
Pre-steps before the upgrade :
1.Pre-Upgrade scripts always execute as the current Oracle DB admin ora<sid>/oracle.
2.Copy the listener.ora,tnsnames.ora & other from /oracle/<SID>/112_64/network/admin to /oracle/<SID>/12102/network/admin
3.Edit listener.ora & change the ORACLE_HOME with value /oracle/<SID>/12102
4.Execute the pre upgrade script from location /oracle/<SID>/12102/sap/ora_upgrade/pre_upgrade
Execute the script pre_upgrade_checks.sql to check the status of your database.
ORACLE DATABASE UPGRADE
NOTE : Recommends to take a complete offline database backup to restore if upgrade fails.
Steps to consider :
1.Stop the SAP system with stopsap r3 or sapcontrol –nr <SAP_Instance_Number> -function stop
2.Oracle software owner must have write permissions on oratab file .
3.ORATAB file would contain entry similar <DBSID>:<ORACLE_HOME>:N
4.Database & listener should be in running state.
Procedure :
1 .Log on with ‘oracle’
2.Save the administration directory of existing DB(Old ORACLE_HOME/network/admin)
3.Before starting DBUA environment variable must be set ORACLE_HOME_SRC,ORACLE_HOME_TGT,DB_SID & ORACLE_BASE
4.Change to the directory cd $ORACLE_HOME_TGT/sap/ora_upgrade/post_upgrade
5.Test the DBUA script to verify correct env variable for upgrade.
6.Run script ./dbua.sap.sh to perform the upgrade in interactive mode.
Due to restrictions of uploading of images,i'll publish the Part-2 as well as troubleshooting for the same document very soon and requests all experts/SCN Members to guide me or hand me to make this document more informative & helpful for others by denoting any misstep in it.Hope you guys will find it helpful for your future references of database upgrades from Oracle 11g to 12c.
Part 2nd : Refer SCN document at SAP ORACLE UPGRADE STEPS FROM 11g TO 12c FOR SAP SYSTEMS ON LINUX - PART II
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
2 | |
2 |