An Oracle White Paper Configuration of S
An Oracle White Paper Configuration of S
March 2011
Preface................................................................................................... 5
Basic Setup: Prepare the SAP System.................................................. 6
Option 1: New SAP System Install and Upgrade to Oracle 11.2.0.2 6
Option 2: Upgrade Single Instance Database to Oracle 11.2.0.2.....7
Option 3: Upgrade RAC enabled Database to Oracle RAC 11.2.0.2 8
System Preparation for Oracle GRID Infrastructure before Installation. 10
Check MTU Size on Network Cards.................................................. 10
Request DNS Subdomain Entry for the Cluster................................. 10
Prepare Users and Groups for the Oracle Grid Installation...............11
Install Oracle Grid Infrastructure Software on your Cluster .................. 14
Network Option 1: Use Oracle GNS Service for Name Resolution....15
Network Option 2: Use existing DNS without GNS............................ 17
All Installations: Specify Network Interfaces...................................... 19
Storage Option 1: Place OCR and Voting Files on Oracle ASM........ 19
Storage Option 2: Shared Filesystem for OCR and Voting Files.......20
All installations: ORACLE_BASE for GRID Infrastructure................. 21
Oracle Clusterware Parameter Adjustments for SAP Installations........ 25
Install Oracle RAC 11.2.0.2 Software on a Cluster................................ 27
Configuration of SAP NetWeaver for Oracle Grid Infrastructure 11.2.0.2 and Oracle Real Application Clusters 11g Release 2
Execute “init –q” after saving the file. After that, check that no CRS processes are running. If
so, you can either kill the processes or reboot the system.
Note to SAPCTL users: You must install a new version of SAPCTL designed for Oracle
Clusterware 11.2.0.2. The SAPCTL version you run with Oracle CRS 10.2. is not compatible
with the Oracle 11.2.0.2 cluster framework.
System Preparation for Oracle GRID Infrastructure before
Installation
Note: We recommend the use of GNS and avoid manual setup of cluster naming.
For other example on setting up DNS and DHCP on Linux, see MOS note 946452.1
The user oracle has the primary group oinstall and is the software owner of all Oracle
software starting with Oracle RAC 11.2.0.1 databases. User oracle also belongs to group dba.
If you want to manage the Oracle ASM instances and the Oracle ASM storage by user oracle
as some sort of superadmin, you can assign the groups asmdba, asmoper and asmadmin to
user oracle. If your security constraints require separate users for storage administration tasks
you must create additional users and assign them to the appropriate groups asmdba, asmoper
and asmadmin.
Note: The home directory of user oracle must be local on every node in the cluster. You
should not use a shared or remote filesystem like NFS to store the home directory as
during the boot process this user account must be available for start of several daemon
processes.
Log on to the first node as user oracle. Create directory ~/.ssh, if it does not exist already. Go
to this directory.
$ mkdir .ssh
$ cd .ssh
Create private and public key files for RSA and DSA authorization:
Copy all files containing public keys from all nodes to a temporary directory on one node.
Then concatenate these files containing public keys from all nodes to the file
authorized_keys.
Copy the file authorized_keys to the .ssh directory in the home directory of user oracle and
change the file permissions as shown below. Execute this on every node.
$chmod 600 config
$chmod 600 authorized_keys
$cd
$chmod 700 .ssh
$chmod 755 ~
You should now be able to open a ssh connection to all hosts without being prompted for a
password. Try this by executing
Repeat this on all nodes in order to have the fingerprints recorded in the file known_hosts.
Check the Oracle documentation for all other minimum requirements before starting the
installation. Oracle provides a tool for verifying that the conditions for a successful
installation have been met. This tool is called cluvfy and is shipped with the Oracle software.
Note: Use the tool cluvfy to verify that all minimum requirements are met.
Note: Before you start the installation, shut down an existing Oracle 10.2 cluster. Stop
all CRS processes currently running and edit the file /etc/inittab, comment out the line
with startup directive. Execute an init –q command, or reboot the node.
$ORIGIN cluster1.my-company.com.
@ IN NS gns.cluster1.my-company.com.
gns.cluster1.my-company.com IN A 10.165.111.103
Cluster Name A valid name for your cluster,
e.g cluster1
SCAN Name Fully qualified name for the SCAN
e.g.
cluster1-scan.cluster1.my-company.com
SCAN Port 1521
GNS Sub Domain Subdomain name for GNS
e.g.
cluster1.my-company.com
GNS VIP Address IP Address for GNS,
e.g
10.165.111.103
Cluster Node Information Add all cluster nodes to the configuration.
Select “Install and Configure Grid Infrastructure for a Cluster”. Do this even if there is an
existing Oracle CRS 10.2 installation. Upgrading an existing installation will require many
additional changes which are not documented in this white paper. Only the installation option
“Install and Configure Grid Infrastructure for a Cluster” is supported by SAP.
Select the Product Language. We recommend to select the English language.
The Oracle Grid Infrastructure software requires a local ORACLE_HOME directory.
Network Option 2: Use existing DNS without GNS
Note that using this configuration option the SCAN name is resolved through your DNS
server. There is no additional subdomain given in the name.
The DNS entry must be present before you start with the installation. It must resolve to three
IP addresses. All addresses must belong to the public network of your cluster.
Example DNS entry:
cluster1-scan.my-company.com IN A 10.165.110.166
IN A 10.165.110.167
IN A 10.165.110.168
If you have an existing Oracle CRS 10.2 installation, you may want to use the existing names
for the virtual IP name of the nodes.
All Installations: Specify Network Interfaces
You must identify the network adapters for public and private networks. You need at least a
public and a private network. For the public network, which is used for the VIP, the subnet
mask must match the subnet mask from the network configuration of the operating system.
Otherwise, the virtual IP cannot be bound to the network adapter.
If you have more than two network cards, use only two: one for the private and one for the
public network. Specify "Do not use" for any additional network adapters.
Note: If your operating system allows virtual network adapters, make sure that the interface
configuration for the public network can hold the VIP on every node.
Note: The names of all network interfaces for the private interconnect as well as the public
network adapters must be identical on all nodes. Make sure the system setup on all cluster
nodes use the same interface name for public and private network.
Create an Oracle ASM diskgroup with name OCR. This Oracle ASM diskgroup consists of 3
separate disks in normal redundancy mirroring. With high redundancy, you will need 5 disks
to build the diskgroup. The OCR diskgroup is only used for storing voting files and OCR
repository data. No other data should go to this diskgroup.
If you do not see any disk at all or not all disks you have expected, press the “Change
Discovery Path” button and specify the pattern to filter for available disks.
If your OCR and voting information is located on Oracle ASM, you must specify a password
for the Oracle ASM administrator. This password should be different from your database
password for user account SYS and SYSDBA.
If you place OCR and voting files on Oracle ASM, we recommend to use the fine grained
permission model as suggested and used per default by Oracle.
Do not reuse the OCR and voting files from an existing Oracle 10.2 CRS installation.
Choose new files instead. If anything fails during installation and you need to deconfigure the
failed installation, you can always switch back to the previous configuration.
The voting disks are a three-way-mirror in normal redundancy configurations. The three
voting disks should therefore reside in three separate partitions/filesystems of the shared
filesystem.
The ORACLE_BASE location for the Oracle Grid Infrastructure 11.2 holds diagnostic and
metadata information for the local 11.2 grid installation. As the grid software location is local
for each cluster node, the ORACLE_BASE location should be local as well. This deviates
from the Oracle database software installation, where a shared location for ORACLE_BASE
and ORACLE_HOME must be used. Select an Oracle Base directory residing on a local
filesystem. Select a software location residing on a local filesystem.
If this is the first installation of Oracle products, you must specify a location for the Oracle
inventory. The inventory location must be private for each node.
The Oracle inventory holds metadata information of all installed Oracle software on a node.
In our example the inventory location is in the directory /oracle/oraInventory. This directory
is local on every node in the cluster. Do not confuse the inventory location with the software
installation directory for the Oracle Grid software.
Make sure to specify a path for the inventory that is not shared among the nodes in the
cluster. Check that the Oracle inventory can be fully accessed by the OS user performing the
installation. In case of Oracle Grid make sure that the inventory directory and all
subdirectories are writable by user oracle. On all nodes, do a "chown -R oracle:oinstall
/oracle/oraInventory". This check also applies if you install a patchset or a single patch for the
Oracle software..
The Oracle Universall Installer checks that all minimum requirements have been met. If this
check is not passed, do not continue with the installation!
In case of errors or warnings, cancel the installation,, resolve the root cause of the error, and
then repeat the installation. Look for MOS (My Oracle Support formerly known as Metalink)
notes on how to completely delete a failed installation for your platform.
The Oracle Clusterware is started at the end of the installation. You can verify this by
executing the crsctl command. The output of command “/oracle/GRI/11202/bin/crsctl status
resource -t” should confirm that all the defined resources are created successfully.
Depending on your choosen installation option, you will notice resources for Oracle ASM,
GNS and some additional VIPs. Note that the GSD service is OFFLINE by default. All the
rest should be ONLINE.
$ /oracle/GRID/11202/bin/crsctl status resource -t
------------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
------------------------------------------------------------------------------------
Local Resources
------------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE vmkb1
ONLINE ONLINE vmkb2
ONLINE ONLINE vmkb3
ONLINE ONLINE vmkb4
ora.OCR.dg
ONLINE ONLINE vmkb1
ONLINE ONLINE vmkb2
ONLINE ONLINE vmkb3
ONLINE ONLINE vmkb4
ora.asm
ONLINE ONLINE vmkb1
ONLINE ONLINE vmkb2 Started
ONLINE ONLINE vmkb3 Started
ONLINE ONLINE vmkb4 Started
ora.gsd
OFFLINE OFFLINE vmkb1
OFFLINE OFFLINE vmkb2
OFFLINE OFFLINE vmkb3
OFFLINE OFFLINE vmkb4
ora.net1.network
ONLINE ONLINE vmkb1
ONLINE ONLINE vmkb2
ONLINE ONLINE vmkb3
ONLINE ONLINE vmkb4
ora.ons
ONLINE ONLINE vmkb1
ONLINE ONLINE vmkb2
ONLINE ONLINE vmkb3
ONLINE ONLINE vmkb4
ora.registry.acfs
ONLINE ONLINE vmkb1
ONLINE ONLINE vmkb2
ONLINE ONLINE vmkb3
ONLINE ONLINE vmkb4
------------------------------------------------------------------------------------
Cluster Resources
------------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE vmkb2
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE vmkb4
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE vmkb3
ora.cvu
1 ONLINE ONLINE vmkb3
ora.gns
1 ONLINE ONLINE vmkb4
ora.gns.vip
1 ONLINE ONLINE vmkb4
ora.oc4j
1 ONLINE ONLINE vmkb3
ora.scan1.vip
1 ONLINE ONLINE vmkb2
ora.scan2.vip
1 ONLINE ONLINE vmkb4
ora.scan3.vip
1 ONLINE ONLINE vmkb3
ora.vmkb1.vip
1 ONLINE ONLINE vmkb1
ora.vmkb2.vip
1 ONLINE ONLINE vmkb2
ora.vmkb3.vip
1 ONLINE ONLINE vmkb3
ora.vmkb4.vip
1 ONLINE ONLINE vmkb4
Oracle Clusterware Parameter Adjustments for SAP
Installations
In some cases the default values of several timing related parameters for error detection and
health check are too aggressive for a complex SAP environment, especially if the service
times of components like network or disk I/O is not deterministic in a sense that there is a
high deviation from the mean or average values.
Important timing parameters for the Oracle Clusterware are misscount, disktimeout,
reboottime and diagwait.
The parameter disktimeout specifies the maximum I/O completion time for read/write access
to the OCR repository and the voting disks. Timing values are given in seconds. A node must
be able to access at least one of the OCR repository files and at least one of the voting disks;
otherwise the node will leave the cluster by issuing a reboot.
The parameter misscount gives the maximum time in seconds for outstanding communication
probes via the network connections among the nodes. It checks network healthiness. If a node
can’t reach any of the other nodes within misscount seconds timeframe, it will start split-
brain resolution and probably evict itself from the cluster by doing a reboot.
Parameter reboottime holds the estimated time for a reboot. Default value is 3 seconds. It is
the time assumed to bring down a node completely.
The parameter diagwait is the amount of time to wait in seconds after a node is considered
dead and reconfiguration can safely start. This parameter is important in conjunction with the
oprocd timing values. A dead or blocked node must already be fenced out by oprocd (via a
fast reboot) before the remaining nodes can safely start reconfiguration. If reconfiguration
starts to early, data integrity may be compromised.
Always check MOS note 294430.1 “CSS Timeout Computation in Oracle Clusterware” for
latest information regarding the parameters and their relationship.
You can query the values by the crsctl command. Switch to user root, then issue the command
as an example.
You must restart Oracle Clusterware on all nodes to have the parameters take effect. Easiest
way is to reboot all nodes.
In rare cases, the default timing constraints for the Oracle health monitoring processes can’t
be met due to long or poor scheduling times in the operating system, which may cause false
node evictions (Oracle Clusterware will reboot the node).
If you notice suspicious node evictions by Oracle Clusterware you should change the timeout
values of the 'diagwait' parameter (see MOS note 559365.1). The Oracle Clusterware stack
must be down on all nodes, modification to diagwait should be made using the crsctl
command and the Oracle Clusterware should be re-started. Always make sure that the
Clusterware 'misscount' is greater than diagwait.
Recommended value for diagwait is 13.
See MOS note 265769.1 “Troubleshooting CRS Reboots” for further information.
Install Oracle RAC 11.2.0.2 Software on a Cluster
Once the Oracle Grid Infrastructure software has been successfully installed and started, the
next step in the configuration process is to install the database software.
A major change compared to earlier releases of Oracle Database Software in an SAP
environment is that the installation of Oracle RAC 11.2.0.2. is now performed by the user
oracle. This is the same user and owner of the software as used for the installation of the
Oracle Grid Infrastructure .
If this user already exists, no additional preparation for the installation is required.
Nevertheless, for SAP management purposes, the user ora<sid> is required. If not already
configured, this task should be executed now.
Create user ora<sid> on all nodes in the cluster, if this has not already been done. Use a
shared home directory on the shared filesystem for user ora<sid>. This makes administrative
tasks much easier, as changes to profiles must be performed only once and are valid or visible
on all nodes in the cluster. All configuration examples in this paper assume a shared home
directory for user ora<sid>.
If the home directory of user ora<sid> already exists on a local filesystem from a previous
SAP installation, relocate this directory to a shared home directory on the shared filesystem.
Similarly to the way the user oracle was set up for the CRS software, secure shell access
between all nodes in the cluster must be set up as explained below so that they all can use a
shared home directory.
Log on to the first node as user ora<sid>.
Create directory ~/.ssh, if it does not exist already. Go to this directory.
$ mkdir .ssh
$ cd .ssh
Create private and public key files for RSA and DSA authorization:
$ ssh-keygen –t rsa –f <path_to_homedirectory>/.ssh/id_rsa_<nodename>
ForwardX11 no
PasswordAuthentication no
Host oracx1
IdentityFile /saphome1/orarac/.ssh/id_rsa_oracx1
IdentityFile /saphome1/orarac/.ssh/id_dsa_oracx1
Host oracx2
IdentityFile /saphome1/orarac/.ssh/id_rsa_oracx2
IdentityFile /saphome1/orarac/.ssh/id_dsa_oracx2
Host oracw1
IdentityFile /saphome1/orarac/.ssh/id_rsa_oracw1
IdentityFile /saphome1/orarac/.ssh/id_dsa_oracw1
Host oracw2
IdentityFile /saphome1/orarac/.ssh/id_rsa_oracw2
IdentityFile /saphome1/orarac/.ssh/id_dsa_oracw2
You should now be able to open a ssh connection to all hosts without being prompted for a
password. Try this by executing
Repeat this on all nodes in order to have the fingerprints recorded in the file known_hosts.
Check the Oracle documentation for all other minimum requirements before starting the
installation. Oracle provides you with a tool for verifying that the conditions for a successful
installation have been met. This tool is called cluvfy and is shipped with the Oracle software.
Note: It is recommended that you use the tool cluvfy to verify that all minimum requirements
have been met.
Note that you must install the database software in a separate ORACLE_HOME location. Do
not choose the same location as for the Oracle Clusterware.
Prepare the storage location for storing the shared ORACLE_HOME directory in the cluster.
The Oracle RDBMS software should be installed into an empty directory, accessible from all
nodes in the cluster. We assume that the name for this directory is /oracle/<SID>/11202. This
directory naming scheme follows the SAP defaults for single instance database installations.
Note: If you already have a single instance Oracle 11.2 installation, rename the existing
directory and use an empty directory.
Prepare a directory for ORACLE_BASE of the RDBMS installation on the shared filesystem.
This directory will be used for holding diagnostic data and must be shared among all cluster
nodes for SAP installations.
Note: The ORACLE_BASE for Oracle Database software and Oracle Grid Infrastructure
software are different directories. Do not use the same for both installation types with SAP.
We recommend that you use directory /oracle/SID as the location for ORACLE_BASE on a
shared filesystem.
This differs from the recommendations for a single instance database installation, where
ORACLE_BASE is /oracle. It is a tribute to the fact that the Oracle database software is
installed on a shared filesystem and the information stored under ORACLE_BASE should be
accessible from all nodes in the cluster.
Log on as user oracle and start the installation with the Oracle Universal Installer. Select
“Install database software only” in the step Installation Option.
Please note: Although you can use the same Oracle Base directory for all installations, we
recommend to use a separate Oracle Base location with every Oracle database software
installation. For use with SAP, the Oracle Base directory has to be on a shared filesystem.
Use exactly the suggested groups. Remember that the software installation owner is user
oracle with primary group oinstall. By choosing dba as the OSDBA and oper as OSOPER
group, any user belonging to these groups can perform administrative tasks like starting or
stopping the database.
SAP user ora<sid> belongs to group dba and is allowed to perform all administrative tasks.
Note: Software updates, patchsets and single patches are configuration tasks and must be
accomplished by user oracle.
Check the summary screen. If all information is correct, press Install to start the installation
process.
The Oracle Universal Installer checks that all minimum requirements have been met. If this
check is not passed, do not continue with the installation!
Once the software has been installed, you must run the root.sh scripts on all nodes as user
root.
The last screen shows the result of the installation. Do not continue with configuration
changes if there are any warning messages.
Note: The shared filesystem holding the shared ORACLE_HOME software installation
directory should support memory mapped files. Memory mapped files are used by Oracle
Clusterware to monitor the health of a running Oracle instance.
If the shared filesystem on your platform does not allow memory mapped files, you must
create a symbolic link to a local filesystem, which supports memory mapped files.
The name of the memory mapped file is hc_<INSTANCE_NAME>.dat. The file is located in
directory $ORACLE_HOME/dbs.
After the software installation, create a local directory on a local filesystem on every node.
Copy the file $ORACLE_HOME/dbs/hc_<INSTNAME>.dat to the local directory. Perform
this on every node in the cluster.
Now delete the file $ORACLE_HOME/dbs/hc_<INSTNAME>.dat. On each node of the
cluster, create a symbolic link in $ORACLE_HOME/dbs pointing to the copied file in the
local filesystem.
ln -s /<local>/hc_<INSTNAME>.dat
$ORACLE_HOME/dbs/hc_<INSTNAME>.dat
Prepare the Database Upgrade
The following sections apply only if you upgrade an existing Oracle RAC 10.2 system. If you
perform a single instance to Oracle RAC migration, you can skip these steps as your database
is already upgraded or installed with Oracle 11.2.0.2. Continue with configuration in section
”Database Controlfile Parameters”.
Before you can start the database upgrade using DBUA, some preparations need to be
performed. As already mentioned, the software owner of the RDBMS software will be
changed from user ora<sid>:dba to user oracle:oinstall. We recommend that you re-install
the Oracle 10.2 RDBMS software as user oracle:oinstall and also re-apply the patchset
10.2.0.4/5, depending on the actual version you are using.
$runInstaller –ignoreSysPrereqs
If the OUI complains on the CRS version or other checks, you can ignore this.
Perform a software installation only. Select all nodes from your cluster. Do not create a
database. A temporary database will be created after the patchsets are applied.
After the initial installation, re-apply the patchset (10.2.0.4 or later) which you have been
using before. Note that this step is required as the upgrade assistant can´t upgrade directly
from 10.2.0.1.
Next preparation for use of DBUA is a valid registration of the database in the CRS
repository. You can achieve this by creating a simple temporary cluster database with DBCA,
specifying same database name and instance names as in your old 10g RAC installation.
First, before starting DBCA, use NETCA to configure a listener for the temporary database.
From your freshly re-installed 10g ORACLE_HOME start netca with user account oracle:
$ export ORACLE_HOME=/oracle/NW4/102_64
$ /oracle/NW4/102_64/bin/netca
Create only a listener configuration for all your nodes in the cluster. Use same port settings as
in your previous setup, so it is probably SAP default 1527.
Use the same listener name as in your previous setup, e.g. LISTENER_<SID>
After netca is finished with the configuration, use command crsctl status resource –t to check
that the listener resources are created and started on all nodes in the cluster.
Now create a simple temporary cluster database with tool DBCA from the freshly re-installed
10g ORACLE_HOME. Use same database name (<SID>).
Start dbca
$ /oracle/NW4/102_64/dbca
Create a cluster database by selecting all nodes in your cluster. Use the same name as your
old database.
Be careful with the SID Prefix for the instances: If your instance-numbers from the old
installation have been 3 letters, e.g. <SID>001 for the first database instance, specify
<SID>00 for the SID Prefix as dbca will only add a single letter for instance number on the
tail.
Create a custom database without datafiles (only SYSTEM and SYSAUX), and deselect all
database options as this database will be created to just register in CRS.
It will not be used at all and the datafiles can be dropped later.
When asked for listener registration, select “Register the database with all listeners”.
These are the listeners you have created with NETCA.
After dbca is finished, the temporary database should be running on all nodes.
Try to connect to the instances: Set environment variables ORACLE_HOME and
ORACLE_SID, use sqlplus / as sysdba to connect.
Copy the server parameter file (spfile<SID>.ora) for the existing database in the dbs
subdirectory from the old, renamed $ORACLE_HOME to the freshly created server
parameter file (spfile<SID>00.ora).
Note: You must keep the name spfile<SID>00.ora, as this is the filename and path
registered in CRS.
Check that the owner of the replaced server parameter file is oracle:oinstall.
Location for the server parameter file spfile<SID>00.ora can be found in files
/oracle/<SID>/102_64/dbs/init<SID><THREAD>.ora.
$export ORACLE_SID=NW4001
$export ORACLE_HOME=/oracle/NW4/102_64
$/oracle/NW4/102_64/bin/sqlplus / as sysdba
SQL>startup
If this test is successful, shutdown the instance and test with CRS command:
$/oracle/GRID/11202/bin/crs_start ora.<SID>.db
You should see that the database instances come up on all configured nodes.
Check /etc/oratab
Check that the enty in file /etc/oratab for your database is valid on all nodes in your cluster.
Select the recompilation option in the upgrade options screen. Backup of your existing
database is a prerequisite which you must have completed before any upgrade step was
performed.
Don´t move the datafiles, especially Oracle ASM is no valid option.
Note: If you plan to migrate your database to Oracle ASM, this must be done in a
separate task.
Check SAP note 1550133 on this. Read the two white papers mentioned in the note:
“Moving your SAP Database to Oracle Automatic Storage Management 11g Release 2: A
Best Practices Guide” and
“SAP Databases on Oracle Automatic Storage Management 11g Release 2 Configuration
Guidelines for UNIX and Linux Platforms”.
Here you find recommendations on the supported procedures as well as naming conventions
for Oracle ASM disks and other relevant information.
Specify your flash recovery area if the existing database already used a flash recovery area.
Specify the Diagnostic Destination, which is ORACLE_BASE
Select only the listener from the GRID installation.
Once DBUA is finished, you can start and stop the database with tool srvctl.
SPFILE=’/oracle/<SID>/11202/dbs/spfile<SID>.ora’
Update information in the Oracle Clusterware:
$ sqlplus / as sysdba
Change the ownership of all database files as described in section “Change the ownership of
database files to oracle:oinstall or oracle:asmadmin”
$ sqlplus / as sysdba
In this example every instance running on a node connects to the local node listener by using
the node VIP. The remote listener entry is the same for all instances and uses the SCAN VIP
for the connection.
In the template above, GNS name resolution is assumed. If you don´t have configured GNS,
you don´t need to include subdomain information ( .cluster1.)
After this modification is in place, you can delete the listener configuration performed with
NETCA as preparation for the upgrade with DBCA / DBUA
Variable Value
ORACLE_HOME /oracle/<dbsid>/11202
ORACLE_SID <dbsid><instance_number>
ORACLE_BASE /oracle/<dbsid>
Additionally, the $PATH and the $LD_LIBRARY_PATH variable should include the path to
the new Oracle executables.
We recommend that you use MOPatch to apply all required patches.
This generates an SQL statement together with hints for generating a new set of control files
in the current database trace file. The location of the directory for this file can be determined
by SQL*Plus as follows:
The most recent database trace file contains all necessary information. Save the relevant part
of this trace file to a temporary file and modify the parameters to appropriate values.
This command gives a list:
ls –lr
Note: Leveraging automatic undo management also requires changes to the initialization file
of an instance. The entries for the rollback segments need to be deleted or commented out.
Add the lines:
*.undo_management = auto
<dbsid>001.undo_tablespace = PSAPUNDO
<dbsid>002.undo_tablespace = PSAPUNDO_002
<dbsid>00n.undo_tablespace = PSAPUNDO_00n
to the instance-specific initialization files.
Use of automatic undo management is mutually exclusive with the use of rollback segments
for the instances in the cluster. It is not allowed to use a mix of both methods. Either none
or all instances in the cluster must be configured to use automatic undo tablespaces.
Note: If you decide to use undo tablespaces, you have to drop all the tablespace(s) holding the
old rollback segments. You cannot set these tablespaces in offline mode, as the database
server may hang.
Redo Log Groups and Members
Note: This section applies to upgrades from single-instance databases only. If your existing
system is already Oracle 10.2 RAC enabled, you can skip this section.
In a standard SAP installation, there are four groups of Oracle redo log files. By default, each
group contains one original and one mirrored redo log file. If redo log files are mirrored with
the help of hardware or operating system, then each group will consist of one original redo
log file only. The default layout in a single instance database installation is organized as
follows:
The log files are periodically written from redo log log_g101m?.dbf to redo log
log_g104m?.dbf. The redo log in use and the redo log being archived always belong to a
different set: GROUP 101 and GROUP 103 belong to set A, GROUP 102 and GROUP 104
belong to set B.
In an Oracle RAC configuration with multiple instances, every database instance needs its
own group of redo log files. The naming conventions are changed slightly for these additional
log file groups. The second instance (thread2) should use a redo log set A containing GROUP
21 and GROUP 23, and a set B containing GROUP 22 and GROUP 24. The third instance
will then use set A and B and so on.
Creating additional redo log files for the new database instances can be performed with a
simple SQL script as shown in the following example for an Oracle RAC solution with four
database instances:
After the files and groups have been created and enabled, the old set of redo log files can be
dropped. Query v$log to see which log file group is current:
44 NO UNUSED
Do as many log switches as needed to ensure that the current log is in the newly created
group. Query v$log again if in doubt.
Once you have done this, the old log file groups can be dropped safely:
SQL> alter database drop logfile group 101;
SQL> alter database drop logfile group 102;
SQL> alter database drop logfile group 103;
SQL> alter database drop logfile group 104;
Don’t forget to delete the log files of group 101-104 at the OS-level!
In the given example, it is assumed that the log files are not mirrored by hardware.
SAP recommends that the members of a log file group reside on different disks for
performance reasons. The diagram above shows the optimal configuration in which every set
of redo logs resides on a separate disk or disk volume.
Modify Oracle Initialization Parameters for RAC
For correct operation of the RAC cluster database environment, the database initialization
parameters have to be changed. With a single-instance Oracle database, there is only one
parameter file init<dbsid>.ora in the directory $ORACLE_HOME/dbs. If you are running a
RAC cluster database configuration, every database instance needs a separate parameter file
with the name init<dbsid> or the default init.ora file for instance startup. In an SAP
environment, SPFILE is now supported, and the modification to use it, is simple to perform.
Note: With a shared $ORACLE_HOME, the single server parameter file is stored in a shared
location on the shared filesystem.
SAP uses the location $ORACLE_HOME/dbs for configuration files as well. The
configuration of the BR*SPACE utility is stored in this directory. Maintaining these files and
the Oracle server parameter file with SAP tools require a shared location. Distributed (local to
a node) configuration is not supported.
Oracle and SAP recommend to use an SPFILE in an RAC environment.
Note: The following section applies if you are upgrading an existing SAP installation
and you are using a PFILE init<SID>.ora.
The original initialization file init<dbsid>.ora must be copied from the old directory to the
new directory $ORACLE_HOME/dbs. If the IFILE parameter is used in the old file, then any
referenced file within should also be copied from the old location to the new location. Note
that if this include mechanism was used for database initialization, then it should be avoided
in the future. This recommendation is also from SAP and is valid for normal upgrades to
Oracle 11g as well. This will ensure an easier transition to binary SPFILEs in future releases.
In the planned RAC environment, every Oracle database instance needs a private
initialization file init<dbsid><thread>.ora. A good practice if you want to stay with instance-
specific files is to use this file for the instance-specific settings only and to include the
common parameters for all instances in a file named icommon.ora.
Note: If you are already using an SPFILE, you may create a human-readable pfile
init.ora to adjust the configuration using a text editor.
If you modify an existing spfile, use sqlplus commands “alter system set parameter=…”
Example: Set instance number 1 for instance NW4001
The instance-specific part of the initialization file should look like this:
instance_number = <thread>
thread = <thread>
instance_name = <dbsid><thread>
service_names = <dbsid>, <dbsid><thread>
undo_management = auto
undo_tablespace=<tablespacename>
An undo tablespace has to be created in the database for every instance. See section undo
tablespaces for an explanation of automatic undo management.
Oracle and SAP recommend to use undo tablespaces in an RAC environment.
The file icommon.ora contains all other initialization parameters, which are valid for all
instances. In an RAC environment, you need to pay particular attention to the parameters
shown in the following table after upgrading:
Note: Adjust the parameters shown in the previous table after the database upgrade. For the
upgrade procedure itself, the old settings must be used.
Once the migration to a RAC-enabled database has finished, you should create a single
init.ora initialization file instead of multiple init<dbsid>.ora files. Instance-specific values are
tagged by the instance name in front of the parameter. The instance name is resolved from the
ORACLE_SID environment variable.
Example from an extract of a single init.ora file:
<dbsid>001.instance_number = 001
<dbsid>002.instance_number = 002
<dbsid>001.thread = 001
<dbsid>002.thread = 002
<dbsid>001.instance_name = <dbsid>001
<dbsid>002.instance_name = <dbsid>002
<dbsid>001.service_names = (<dbsid>, <dbsid>001)
*.undo_management = auto
<dbsid><thread>.undo_tablespace=<tablespacename>
Any parameter that is valid for all instances is preceded by a “*”. You can omit the “*” for
common parameters.
Delete any init<dbsid>.ora or init<dbsid><thread>.ora initialization files from the
$ORACLE_HOME/dbs directory.
Create a binary SPFILE (with filename spfile.ora) by using sqlplus
connect “/ as sysdba”
The file parameter specifies the filename and is mandatory. Enter the password of the
database user SYS for the password parameter. The entries parameter is optional and denotes
the number of distinct users with DBA and OPER privileges.
Enable the Cluster Database and Start all Instances
Note: This section applies to upgrades from single-instance databases only. If your existing
system is already Oracle RAC 10.2 enabled, you can skip this section.
Once you have finished upgrading to Oracle RAC 11.2 and completed all modifications to the
database as explained in this part, (re)enable the cluster database. In the case of a single-
server parameter file spfile.ora which is required by SAP for RAC, change the setting of the
cluster database parameter using sqlplus:
$ sqlplus / as sysdba
Log on to every node in the cluster as user ora<sid>. Set the environment variable
ORACLE_SID to the unique value of the instance intended to run on the cluster node.
Start the Oracle database instance on each node using sqlplus.
$ export ORACLE_SID=<DBSID><THREAD>
$sqlplus / as sysdba
connected to an idle instance
SQL> startup
The database and the instances are not yet known to the Oracle Clusterware. You must use
sqlplus to start the database instances. Once you have completed the configuration use the
tool srvctl for controlling the database instances.
Oracle Network Configuration
Correct setup of the network configuration inside and outside the cluster nodes is vital for the
smooth and error-free operation of the SAP R/3 system and various administration tools.
Depending on the specific needs of the actual operating environment, the underlying
operating system and the preference of other Oracle installations at a certain site, the Oracle
network configuration files have several possible locations.
This document assumes that EZCONNECT naming is used for the Oracle RAC 11.2
database. Using this naming method no maintenance of network configuration files
listener.ora and tnsnames.ora in directory $ORACLE_HOME/network/admin is required.
Listeners should be started and stopped using srvctl command. Do not use the lsnrctl
start/stop command to control the listener.
Starting a listener manually:
Furthermore, the status of the listener can be obtained with the command
$ lsnrctl status
Beside the automatic registration of the Oracle instances to the listener processes, there is still
a SID_LIST for every listener to maintain. The SID_LIST entries in the file listener.ora
inform the local node listener about the existence of the instance, even if the instance is not
running. This is important for the SAP BR*Tools, to differentiate between a stopped and a
non-existing instance.
Log on to the system as user oracle. Add the SID_LIST enty at the end of the file listener.ora
in the /oracle/GRID/11202/network/admin directory.
SID_LIST_LISTENER =
(SID_LIST=(SID_DESC=(SID_NAME=<SID>001)
(ORACLE_HOME=/oracle/<SID>/11202)))
Remember that you must do this on every node in the cluster as the Grid installation is local
on every node. Put everything in one line, do not use CR/LF or whitespaces.
The first part contains one generic entry for the database as a whole, and as many net service
entries as there are database instances for this database. The general net service name is
<DBSID>, as used in the various profiles of the SAP R/3 application. The main purpose here
is to serve as a last resort or default entry for R/3 work processes or other tools that must
connect sporadically to the database without the need for a specific instance or service.
The remaining net service entries in this section contain connect descriptors for the database
instances running on the cluster nodes. These entries are mostly required for maintaining the
database instance. BR*Tools, for example, can use these entries. Another use for these entries
is SAP clients using older OCI clients that are not able to log on to the database using
database services.
The second section contains all entries that connect to database services in the database. The
clients from the SAP R/3 application server instances should use these net service entries to
connect not to a single database or a database instance running on a specific node but to a
database service which can be relocated to any instance and node by simple CRS commands.
Note: You must add the domain to any service definition (SERVICE_NAME=…), if
your database uses db_domain parameter. Check with command
“/oracle/GRID/11202/bin/lsnrctl status LISTENER” if database instances register with
domain information set.
The Oracle tool srvctl is used to define services within the database instances. For a
description and examples of how to define service entries to the database see the section
"Define database services for SAP R/3 application instances".
Example: Database NW4 with 4 instances and 4 service definitions for SAP dialog instances
D01, D02, D03 and D04:
################
# Filename......: tnsnames.ora
# Created.......: created by SAP AG, R/3 Rel. >= 6.10
# Name..........:
# Date..........:
################
NW4=
(DESCRIPTION =
(ADDRESS=(PROTOCOL=TCP)
(HOST=cluster1-scan.cluster1.my-company.com)
(PORT=1521)
)
(CONNECT_DATA =
(SERVICE_NAME = NW4)
(GLOBAL_NAME = NW4)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
)
)
)
NW4001=
(DESCRIPTION =´
(ADDRESS=(PROTOCOL=TCP)
(HOST=node1-vip.cluster1.my-company.com)
(PORT=1521))
(CONNECT_DATA =
(SID = NW4001)
(GLOBAL_NAME = NW4)
)
)
NW4002=
(DESCRIPTION =
(ADDRESS=(PROTOCOL=TCP)
(HOST=node2-vip.cluster1.my-company.com)
(PORT=1521))
(CONNECT_DATA =
(SID = NW4002)
(GLOBAL_NAME = NW4)
)
)
NW4003=
(DESCRIPTION =
(ADDRESS=(PROTOCOL=TCP)
(HOST=node3-vip.cluster1.my-company.com)
(PORT=1521))
(CONNECT_DATA =
(SID = NW4003)
(GLOBAL_NAME = NW4)
)
)
NW4004=
(DESCRIPTION =
(ADDRESS=(PROTOCOL=TCP)
(HOST=node4-vip.cluster1.my-company.com)
(PORT=1521))
(CONNECT_DATA =
(SID = NW4004)
(GLOBAL_NAME = NW4.WORLD)
)
)
NW4_D01=
(DESCRIPTION =
(ADDRESS=(PROTOCOL=TCP)
(HOST=cluster1-scan.cluster1.my-company.com)
(PORT=1521)
)
(CONNECT_DATA =
(SERVICE_NAME = NW4_D01)
(GLOBAL_NAME = NW4)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
)
)
)
NW4_D02=
(DESCRIPTION =
(ADDRESS=(PROTOCOL=TCP)
(HOST=cluster1-scan.cluster1.my-company.com)
(PORT=1521)
)
(CONNECT_DATA =
(SERVICE_NAME = NW4_D02)
(GLOBAL_NAME = NW4)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
)
)
)
NW4_D03=
(DESCRIPTION =
(ADDRESS=(PROTOCOL=TCP)
(HOST=cluster1-scan.cluster1.my-company.com)
(PORT=1521)
)
(CONNECT_DATA =
(SERVICE_NAME = NW4_D03)
(GLOBAL_NAME = NW4)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
)
)
)
NW4_D04=
(DESCRIPTION =
(ADDRESS=(PROTOCOL=TCP)
(HOST=cluster1-scan.cluster1.my-company.com)
(PORT=1521)
)
(CONNECT_DATA =
(SERVICE_NAME = NW4_D04)
(GLOBAL_NAME = NW4)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
)
)
)
The next step is the addition of all database instances to the configuration. In the example
below, 4 instances are added:
Once the database and the instances are known to the Oracle clusterware, starting and
stopping the database should only be performed by using the srvctl command. Use of sqlplus
is not recommended.
Example: Starting the database
$ srvctl start database –d NW4
If there is a problem with the database like media corruption, recovery problems etc., srvctl
command will not report these kind of problems to the user. So if you notice that the database
or some instances does not start correctly, check the alert log of the instances. If the database
or some database files need to be repaired by a media recovery, you must perform all
administrative task with sqlplus.
Note: The name of the service must match the service name given in the connect descriptor in
tnsnames.ora if you do not use EZCONNECT. If you use EZCONNECT, the servicename is
given directly in the connect string
See the section "Network configuration file tnsnames.ora" for configuring network services in
tnsnames.ora if not using EZCONNECT.
Note: The service description should contain the name of the database (NW4) and the name
of the SAP instance (D01)
If all these naming conventions are followed, more than one SAP system and Oracle database
can run on the cluster without conflicting with each other.
The command given above creates a new resource in CRS with resource name
ora.nw4.nw4_d01.svc. NW4001 is the name of the instance running on node oracx1.
This was defined with the “srvctl add instance …” command above. It is the instance running
the service NW4_D01 as preferred instance. The status and attributes of this CRS resource for
the service can be obtained by the command crsctl status resource ora.nw4.nw4_d01.svc –f
Use SRVCTL to define as many services to the database as there are SAP R/3 application
instances configured for the SAP system. The example below shows additional services for
the SAP instances D02, D03 and D04:
Example: .dbenv_<hostname>.sh
...
dbms_type=ORA; export dbms_type
# dbs_ora_tnsname=$DBSID; export dbs_ora_tnsname
ORACLE_PSRV=NW4; export ORACLE_PSRV
ORACLE_SID=$DBSID; export ORACLE_SID
DB_SID=NW4; export DB_SID
...
In the file tnsnames.ora, a net service entry for an SAP application instance is formed as
follows: <SID><SERVICENAME>.<DOMAIN>. This value must be given in the profile
parameter dbs/ora/tnsnames. The profiles for the SAP application instances are located in
directory /usr/sap/<SID>/SYS/profile.
Example if using tnsnames.ora configuration file: Sapsystemname is NW4; Instance name is
D01 running on host oracx1. Filename of instance profile is NW4_D01_oracx1
...
SAPSYSTEMNAME=NW4
INSTANCE_NAME=D01
dbs/ora/tnsname=NW4_D01
...
Note: The sapuser environment parameter dbs_ora_tnsname overrides the parameter setting in
the profile for an instance.
The environment variable dbs_ora_tnsname will be set to the appropriate name for a specific
SAP instance in the START profile for that instance.
SAP START Profile
All SAP application instances will be started by the script startsap in a standard installation.
In order to be able to use dedicated database services for SAP instances, the START profile
of the SAP instances require small changes to interact with the Oracle network setup. The
sapstart script sets the environment variable dbs_ora_tnsname to the database SID, which is
the SAPSID as well, for checks to determine whether the database is already running. Just
before the SAP instance is started by the sapstart executable, the environment variable
dbs_ora_tnsname is set to the value given user environment, or unset if not specified there. If
the environment variable dbs_ora_tnsname is set, it overrides the setting in the instance
profile parameter dbs/ora/tnsname. Nevertheless, the parameter dbs_ora_tnsname is required
for programs and tools like R3trans or tp. So just unsetting this variable in the user
environment is not a complete solution.
Note: The user environment parameter dbs_ora_tnsname is required to run programs R3trans
or tp directly from the command line. Unset this parameter only if you do not run these
programs from the command line or for testing purpose to verify that the changes in the
START profiles work as expected.
Example if using EZCONNECT: Sapsystemname is NW4, Instance name is D01 running on
host oracx1. Filename of instance START profile is START_D01_oracx1
. . .
SETENV_02 = LIBPATH=$(DIR_LIBRARY):%(LIBPATH)
EZCONNECT =//cluster1-scan.cluster1.my-company.com/NW4_D01
SETENV_03 = dbs_ora_tnsname=$(EZCONNECT)
. . .
This section is valid for Java Add-In installations (JAVA + ABAP stack) as well as for Java
Standalone installations of SAP NetWeaver.
The JVM (Java Virtual Machine) by SAP uses the thin JDBC driver from Oracle to connect
to the database. Therefore the Oracle network configuration for the Java stack is different
from the ABAP stack. With the thin JDBC driver the network configuration files
tnsnames.ora, sqlnet.ora and listener.ora are not used. The URL which defines the connect
description is stored in an encrypted flat file in the filesystem. The content of this file is also
stored in the database. The content of this configuration file is valid for all Java Server
Engines in an SAP system. The configuration file is shared via the sapmnt access path.
The path to the configuration tool in a mixed ABAP+JAVA installation is
/usr/sap/<SID>/<CI>/j2ee/configtool. As user <sidadm>, go to this directory and start the
configuration tool configtool.sh from there:
$ cd /usr/sap/<SID>/<CI>/j2ee/configtool
$ ./configtool.sh
If you see the popup screen asking for the use of default connection settings, answer “yes” to
use the default settings. You will then see the starting screen of the “J2EE Engine Config
Tool”
In the starting screen, navigate to the “secure store” icon in the navigation tree on the left
side.
Look for a key “jdbc/pool/<SID>/Url”. This key holds the connect descriptor for the thin
JDBC driver. For Oracle RAC use a EZCONNECT connection:
jdbc:oracle:thin@//cluster1-scan.cluster1.my-company.com/NW4_J2EE
The SAP J2EE engine will use the database service “NW4_J2EE” in the example given. The
connection request will be serviced by one of the Oracle database instances providing
database service “NW4_J2EE”. If more than one database instance is eligible for the
connection, the listener process makes a decision depending on the workload of the database
instances.
You must specify the database domain ”WORLD” in the connect descriptor if the parameter
file of the database (spfile) has the parameter db_domain set to the default domain
“WORLD”. You can check this by issuing the command “lsnrctl status LISTENER” and see
if the domain qualifier is part of the service names. The database services for the SAP J2EE
instances must be already defined when you want to check with the lsnrctl command, see
below.
Note: The configuration in the secure store is valid for all SAP J2EE instances. So all SAP
J2EE instances will use the same database service. This is different from the ABAP
configuration as an ABAP instances uses a private, dedicated database service for the
instance.
Note: The name of the service must match the service name given in the jdbc URL in the
secure store configuration. The service name is stated without the domain qualifier
“.WORLD”. This qualifier is automatically added by the ORACLE database instances when
the database service is published to the listener processes.
The workload distribution for the SAP J2EE engines is managed completely by the database.
There is no explicit connection balancing like with the ABAP work processes. Instead,
“server side load balancing” is used if the service is defined to run on more than one database
instance.
This type of configuration provides the capability to evenly distribute all connections of a
single SAP J2EE server engine among all those database instances for which the database
service is defined. This connection scenario is different from the ABAP stack as the workload
from the J2EE engine is completely random and therefore cannot be controlled as compared
with the ABAP stack.
Note: You can configure different services for ABAP and Java application servers,
normally running on dedicated nodes in the cluster. By this, you are able to separate the
ABAP and Java workload.
SAP BR*Tools
The SAP BR*Tools for Oracle database administration support a RAC configuration. Always
download the latest version of the BR*Tools from the SAP service marketplace when using
Oracle RAC 11.2.0.2. All required configuration changes for an SAP system with RAC are
documented in chapter 6 of the SAP manual "SAP Database Guide: Oracle".
Older versions of BR*Tools store configuration information in directory
$ORACLE_HOME/dbs. The SAP user ora<SID> must be able to write to this directory and
perform housekeeping in directory $ORACLE_HOME/rdbms/audit. This is no longer
possible with Oracle default software owner oracle:oinstall.
As a temporary workaround, you can add user ora<SID> to group oinstall.
Still some restrictions on backup and restore apply. Full support is planned for end of
Q2CY2011. Check out SAP note 1550133 for updates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective