Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

Upgrade from Oracle 11.2 to Oracle 12 (Linux Red Hat) (1/3)

Upgrade from Oracle 11.2 to Oracle 12 (Linux Red Hat) (2/3)



Post upgrade steps

Updating oratab

Adapt the environment variables

Updating the SQL*Net Configuration Files

listener.ora

tnsnames.ora

Checking the Symbolic Link for Runtime Oracle Home

Adapting the Environment of the <sapsid>adm user

.dben.csh

.dbenv.sh

.dbenv_ls-sap-tmpvm11.csh

Adapting the Environment of the ora<dbsid> User

Start the listener

Start the database Instance

Performing SAP Bundle Patch Post-Installation Steps

Performing Post-Upgrade Checks

Performing Post-Upgrade Tasks

Updating the Oracle Instant Client

Create the symbolic link for BR*Tools 7.40:

Updating the JDBC Driver References

Configuring the New Features for Oracle Database 12c Release 1 (12.1)

Deinstalling the Old Oracle Home

Start SAP System

Post upgrade steps

After running DBUA, some tasks must be performed in order to assure the correct execution of the system.

Updating  oratab

After the database upgrade, change the entry in /etc/oratab, so this must appear:

MW1:/oracle/MW1/12102:N

It may be already modified.

Adapt  the environment variables

Environment variables for user 'oracle' must be modified because now the ORACLE_HOME belongs to the Oracle 12 version.

This is an example and how it can look:

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi



# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export ORACLE_SID=MW1

export ORACLE_BASE=/oracle/

#export ORACLE_HOME=/oracle/MW1/11203

export ORACLE_HOME=/oracle/MW1/121

export PATH=$ORACLE_HOME/bin:$PATH

#export IHRDBMS=/oracle/MW1/11203

export IHRDBMS=/oracle/MW1/121

#export OHRDBMS=/oracle/MW1/11203

export OHRDBMS=/oracle/MW1/12102

export SBPFUSER=/sbin/fuser

export DB_SID=MW1




Updating  the SQL*Net Configuration Files

It's necessary to adapt the SQL*Net files that are located in the directory <ORACLE_HOME>/network/admin and in the directory (server) pointed by the environment variable TNS_ADMIN (client), for example, under /usr/sap/<SID>/SYS/profile/oracle


listener.ora

Was previously modified. It's necessary that 'SID_LIST_<LISTENER_NAME>' and 'ADR_BASE_<LISTENER_NAME>' are set. If they are missing, copy them from the listener.ora from the source Oracle home <OLD_ORACLE_HOME> and check that Oracle home in listener.ora is set to <NEW_ORACLE_HOME>.


When the database instance is started, this entry is used to resolve the parameter local_listener. For recommendations on setting local_listener, see SAP Note 1888485.


################

# Filename......: listener.ora

# Created.......: created by SAP AG, R/3 Rel. >= 6.10

# Name..........:

# Date..........:

# @(#) $Id: //inst/inst_scripts/lmts_006_REL/tpls/ora/LISTENER.ORA#1 $

################

ADMIN_RESTRICTIONS_LISTENER_MW1 =      on

LISTENER_MW1  =

(ADDRESS_LIST =

(ADDRESS =

(PROTOCOL = IPC)

(KEY = MW1.WORLD)

)

(ADDRESS=

(PROTOCOL = IPC)

(KEY = MW1)

)

(ADDRESS =

(COMMUNITY = SAP.WORLD)

(PROTOCOL = TCP)

(HOST = sapbiwm01)

(PORT = 1651)

)

)

STARTUP_WAIT_TIME_LISTENER_MW1 =      0

CONNECT_TIMEOUT_LISTENER_MW1      = 10

TRACE_LEVEL_LISTENER_MW1      = OFF

SID_LIST_LISTENER_MW1      =

(SID_LIST =

(SID_DESC =

(SID_NAME = MW1)

(ORACLE_HOME = /oracle/MW1/12102)

)

)

ADR_BASE_LISTENER_MW1      = /oracle/MW1/saptrace



Only valid for SAP systems running the SAP Java stack:

When upgrading an SAP 7.0X system with AS Java or dual-stack (ABAP+Java), add the parameter SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8 to SQLNET.ora on the database server in directory <ORACLE_HOME>/network/admin and on the SAP application server(s) in the directory $TNS_ADMIN.

Without the entry in SQLNET.ora, the following error occurs: ORA-28040: No Matching authentication.



tnsnames.ora

The easiest method to do this is to just copy the complete LISTENER_<DBSID> entry from the file <OLD_ORACLE_HOME>/network/admin/tnsnames.ora and add this entry unchanged to the file in <ORACLE_HOME>/network/admin and $TNS_ADMIN/tnsnames.ora on the SAP side

In this guide, this is the content of those files:

################

# Filename......: tnsnames.ora

# Created.......: created by SAP AG, R/3 Rel. >= 6.10

# Name..........:

# Date..........:

# @(#) $Id: //inst/inst_scripts/lmts_006_REL/tpls/ora/TNSNAMES.ORA#1 $

################

MW1.WORLD=

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS =

(COMMUNITY = SAP.WORLD)

(PROTOCOL = TCP)

(HOST = sapbiwm01)

(PORT = 1651)

)

)

(CONNECT_DATA =

(SID = MW1)

(GLOBAL_NAME = MW1.WORLD)

)

)



Checking  the Symbolic Link for Runtime Oracle Home

For upgrades from 10.2 to 12.1.0.2 or 11.2 to 12.1.0.2, the symbolic link /oracle/<DBSID>/121 has already been created by RUNINSTALLER.

Change to the required directory:

cd /oracle/<DBSID>



Check that the following symbolic link exists:

ls -l /oracle/<DBSID>/121



If this link does not exist, create a symbolic link to the new Oracle home:

ln -s /oracle/<DBSID>/12102 /oracle/<DBSID>/121

Adapting  the Environment of the <sapsid>adm user

You have to change the environment of user <sapsid>adm for SAP application servers that are installed on the Oracle database server.



In order to allow “startsap” to work, copy the file:

/oracle/MW1/12102/network/admin/tnsnames.ora      to the SAP path: /sapmnt/MW1/profile/oracle

cp /oracle/MW1/12102/network/admin/tnsnames.ora tnsnames.ora



Set the ORACLE_HOME environment variable to new Oracle home, for example '/oracle/<DBSID>/121'

Adapt the PATH variable so that it no longer contains references to the old Oracle home.



These are the files which much be modified


.dben.csh

#nano .dbenv.csh

### MORE TEXT BEFORE

if ( -r "$_t" || `uname -n` == "$SAPDBHOST" ) then

setenv ORACLE_HOME /oracle/MW1/121

endif

else

setenv ORACLE_HOME /oracle/MW1/121

set ADD="$ORACLE_HOME"/lib

endif

setenv NLS_LANG AMERICAN_AMERICA.UTF8

setenv SAPDATA_HOME /oracle/MW1

### MORE TEXT AFTER



.dbenv.sh

#nano .dbenv.sh

#### MORE TEXT BEFORE

ORACLE_SID=$DBSID;      export ORACLE_SID

ORACLE_HOME=/oracle/MW1/121; export      ORACLE_HOME

ORACLE_BASE=/oracle;      export ORACLE_BASE

NLS_LANG=AMERICAN_AMERICA.UTF8 ;      export NLS_LANG

SAPDATA_HOME=/oracle/MW1; export      SAPDATA_HOME

DIR_LIBRARY=$SAPEXE;      export DIR_LIBRARY

# check for running user and set for orasid ORA_NLS10

USER=`id | awk -F\( '{print $2}' | awk -F\) '{print $1}'`

TRUL='tr "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz"'

ORASID="ora`echo      $DB_SID | $TRUL`"

if [ $USER != $ORASID ]; then

TNS_ADMIN=/usr/sap/MW1/SYS/profile/oracle; export TNS_ADMIN

ADD=/oracle/client/11x_64/instantclient

_f=/sapmnt/MW1/profile/DEFAULT.PFL

_t=/oracle/MW1/112_64/bin/sqlplus

SAPDBHOST=""

if [ -r "$_f" ]; then

SAPDBHOST=`awk -F= '/^[ ]*SAPDBHOST[ ]*=/ {print $2; exit}' $_f | awk '{print $1}'`

fi

if [ -r "$_t" -o `uname -n` = "$SAPDBHOST" ]; then

ORACLE_HOME=/oracle/MW1/121; export ORACLE_HOME

fi

else

ORACLE_HOME=/oracle/MW1/121; export ORACLE_HOME

ADD="$ORACLE_HOME"/lib

### MORE TEXT AFTER



.dbenv_ls-sap-tmpvm11.csh

It's necessary to change the ORACLE_HOME definition inside this file.

##### MORE TEXT BEFORE

if ( -r "$_t" || `uname -n` == "$SAPDBHOST" ) then

setenv ORACLE_HOME /oracle/MW1/121

endif

else

setenv ORACLE_HOME /oracle/MW1/121

set ADD="$ORACLE_HOME"/lib

endif

setenv NLS_LANG AMERICAN_AMERICA.UTF8

##### MORE TEXT AFTER



Check the environment with:

$ env | grep ORACLE_HOME

$ env | grep ORACLE_BASE

$ env | grep PATH (this should no longer contain a reference to 112_64)

Adapting  the Environment of the ora<dbsid> User

We need to edit the file /home/oracle/.bash_profile. We can erase the references to the old ORACLE_HOME.

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs



PATH=$PATH:$HOME/bin

export ORACLE_SID=MW1

export ORACLE_BASE=/oracle/

export ORACLE_HOME=/oracle/MW1/121

export PATH=$ORACLE_HOME/bin:$PATH

#export IHRDBMS=/oracle/MW1/11203

export IHRDBMS=/oracle/MW1/121

export OHRDBMS=/oracle/MW1/12102

export SBPFUSER=/sbin/fuser

export DB_SID=MW1



Start  the listener

As user 'oracle' type:

$ lsnrctl start LISTENER_MW1



LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 20-NOV-2015 22:57:57



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



Starting /oracle/MW1/121/bin/tnslsnr: please wait...



TNSLSNR for Linux: Version 12.1.0.2.0 - Production

System parameter file is /oracle/MW1/121/network/admin/listener.ora

Log messages written to /oracle/MW1/saptrace/diag/tnslsnr/ls-sap-tmpvm11/listener_mw1/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=MW1.WORLD)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=MW1)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.7.151)(PORT=1651)))



Connecting  to (ADDRESS=(PROTOCOL=IPC)(KEY=MW1.WORLD))

STATUS of the LISTENER

------------------------

Alias LISTENER_MW1

Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production

Start Date 20-NOV-2015 22:57:57

Uptime 0 days 0 hr. 0 min. 0 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /oracle/MW1/121/network/admin/listener.ora

Listener Log File /oracle/MW1/saptrace/diag/tnslsnr/ls-sap-tmpvm11/listener_mw1/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=MW1.WORLD)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=MW1)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.7.151)(PORT=1651)))

Services Summary...

Service "MW1" has 1 instance(s).

Instance "MW1", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully



Start  the database Instance

As user 'oracle', type:

$ sqlplus /"as sysdba"

SQL*Plus: Release 12.1.0.2.0 Production on Fri Nov 20 22:59:38 2015

Copyright (c) 1982, 2014, Oracle. All rights reserved.

Connected to an idle instance.



SQL> STARTUP

ORACLE instance started.



Total System Global Area 3422552064 bytes

Fixed Size 2930080 bytes

Variable Size 1711278688 bytes

Database Buffers 1694498816 bytes

Redo Buffers 13844480 bytes

Database mounted.

Database opened.

SQL>



Performing  SAP Bundle Patch Post-Installation Steps

You have installed an SAP bundle patch (SBP) before you upgraded to the new Oracle Release. Now you need to run the SBP post-installation steps.

Use the following statements with 'sqlplus' to adjust your _fix_control and event settings in your spfile according to SAP note 1888485 with the new SBP:

ALTER SYSTEM SET "_FIX_CONTROL"=

'5099019:ON','5705630:ON','6055658:OFF','6120483:OFF','6399597:ON','6430500:ON',

'6440977:ON','6626018:ON','6972291:ON','7168184:OFF','7658097:ON','8937971:ON',

'9196440:ON','9495669:ON','13077335:ON','13627489:ON','14255600:ON','14595273:ON',

'18405517:2'

COMMENT='SAP_121023_201505 RECOMMENDED      SETTINGS'

SCOPE=SPFILE;



ALTER SYSTEM SET EVENT=

'10027',

'10028',

'10142',

'10183',

'10191',

'10995 level 2',

'38068 level 100',

'38085',

'38087',

'44951 level 1024'

COMMENT='SAP_121022_201503 RECOMMENDED      SETTINGS'

SCOPE=SPFILE;

Please restart the database after you have adjusted these parameters.



Performing   Post-Upgrade Checks

As user 'oracle', we must execute the following scripts

/oracle/MW1/12102/rdbms/admin/utlu121s.sql

/oracle/MW1/12102/sap/ora_upgrade/post_upgrade/post_upgrade_tasks.sql

/oracle/MW1/12102/sap/ora_upgrade/post_upgrade/post_upgrade_checks.sql



Performing   Post-Upgrade Tasks

Gather Oracle optimizer statistics by executing the following commands as the user <sapsid>adm

brconnect -u / -c -f stats -t system_stats

Check the Oracle database parameters against SAP Note 1888485 -      Database Parameter for 12.1.0.2 and adjust them if necessary.

Check SAP Note 1171650 -      Automated Oracle DB parameter check to see whether an automated script for Oracle 12c is already available. This helps you check whether your SAP system complies with the database parameter recommendations at any given point in time.



Update the Oracle database statistics with BRCONNECT as follows:

brconnect -u / -c -f stats -t all -f collect -p 4



Updating  the Oracle Instant Client

After the upgrade to Oracle 12.1.0.2, it is strongly recommended to install an Oracle client supported for Oracle 12c. If it is not possible to install Oracle client 12.1.0.2 (for example, due to SAP limitations or hardware restrictions), you need at least Oracle client 11.2.0.4.

Follow these steps as user <sapsid>adm

Create the new client directory:

mkdir -p /oracle/client/12x

Change to the new client directory:

cd /oracle/client/12x



Mount the Oracle client DVD 12.1.0.2 and unpack the client software in this folder:

SAPCAR -xvf <Oracle client DVD>/OCL<your OS>/OCL12164.SAR



Check and create the symbolic links:

cd /oracle/client/12x

ln -s instantclient_12102 instantclient



Create  the symbolic link for BR*Tools 7.40:

Enter this command to change directory:

cd /oracle/client



If the link or directory 11x_64 already exists, rename it, as in this example:

mv 11x_64 11x_64_save



Create the symbolic link:

ln -s /oracle/client/12x /oracle/client/11x_64

Updating  the JDBC Driver References

If you have an SAP system with Java components, you have to change the JDBC driver references after you have upgraded the database client software. Otherwise the J2EE Engine cannot start because the driver references still point to the old Oracle client software home.



Procedure

Change to the correct directory containing the file <SAPSID>_J<instance_number>_<host>.



Open the file with your text editor and search for property j2ee/dbdriver.



Replace the old driver location with the new one:

/oracle/client/<Oracle_client_major_version>x/instantclient/<java_class_archive>.jar

where <Oracle_client_major_version> is the major version of the Oracle client that you are using after this upgrade. So for example, if you are now using Oracle 12.1, set the new driver location to

/oracle/ client/12x/instantclient/<java_class_archive>.jar.



For Oracle client 11g, make sure the new driver location is set to /oracle/client/11x_64/instantclient/<java_class_archive>.jar.



Caution Do not change the file <java_class_archive>.jar, which is one of the following:

ojdbc14.jar

ojdbc6.jar



Configuring  the New Features for Oracle Database 12c Release 1 (12.1)

You can configure the new Oracle Database 12c Release 1 (12.1) features.

For more information about new features with Oracle Database 12c Release 1 (12.1), see SAP Note 1914631 -      Central Technical Note for Oracle Database 12c Release 1 (12.1).

This note provides links to other SAP notes that describe how to configure or activate each new feature.



Deinstalling   the Old Oracle Home

Once the database is running correctly, it is recommended to deinstall the old Oracle Home to prevent accidental usage of the old binaries.

Please, check note 1525025 -      Oracle 11.2.0: Removing Oracle Homes of Release 11.2.0.x if you wish to do that.




Start SAP System

Once finished, you can start SAP system normally by typing, as user <sap>sid, 'startsap” and check the installed version.



2 Comments
Labels in this area