29
An Oracle White Paper February 2009 Document version 1.0 SQL*Net Configuration for SAP taking RAC as an example

wp-ora4sap-sqlnet-303806.pdf

  • Upload
    daithi

  • View
    7

  • Download
    4

Embed Size (px)

Citation preview

  • An Oracle White Paper February 2009 Document version 1.0

    SQL*Net Configuration for SAP taking RAC as an example

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Overview ............................................................................................. 1

    Description of example setup.............................................................. 2

    SQL*Net setup in 10g RAC on CRS and SAP .................................... 3

    sqlnet.ora ........................................................................................ 3

    listener.ora ...................................................................................... 4

    tnsnames.ora .................................................................................. 6

    Database parameters.................................................................... 10

    SAP instance setup........................................................................... 12

    ADM environment ............................................................... 12

    SAP instance profile...................................................................... 13

    SAP instance START profile ......................................................... 14

    Oracle Instant Client for local or SAP application server use........ 15

    CRS service definition....................................................................... 15

    BR*Tools setup ................................................................................. 16

    Example output ................................................................................. 18

    Annex: TNS name resolution and domain names............................. 22

    SQL*Net domain ........................................................................... 22

    IP or DNS domain ......................................................................... 23

    Service name ................................................................................ 24

    Database domain .......................................................................... 25

    Annex: Some Relevant SAP OSS notes........................................... 25

    Conclusion ........................................................................................ 26

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Overview This paper provides anoverview of how to

    configure SQL*Net in SAP

    on RAC with CRS for all

    involved components using

    an example configuration

    This SQL*Net configuration covers all necessary environment settings, configuration files, database parameters and service definitions which are required to operate SAP with RAC.

    The objective of this configuration is to connect an SAP instance to one Oracle database instance at any one time. Each SAP instance has a default database service instance assigned. The database service is provided by a predefined database instance and in the event of instance failure, the SAP instance connects to another failover database instance which then provides the database service of the failed instance. All processes of a particular SAP instance are always connected to one database service which is provided by one of the database instances. All database instances provide a common database service with the name of the SAP system ID . This additional configuration enables R3trans, sapstart, tp and BR*Tools to be used with Oracle instances and database services controlled by CRS.

    The TNS or SQL*Net setup is an important part of the RAC installation and configuration process. Errors in the TNS layer may have various consequences such as

    Connection and performance problems Failover problems Other functional problems, for example none of the BR*Tools functions may work.

    The example configuration illustrated in this white paper is consistent, which means, a change to any item may require more changes to other items. The directory names mentioned are for Unix installations. Path names will need to be changed for Windows. This white paper does not explain either the SQL commands needed or all the background information, please refer to Oracle and SAP documentation for fundamental information about RAC, RDBMS and SAP. Please also refer to the OSS notes listed in the Annex. 1

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Description of example setup Describes the systemsetup used for this

    example configuration The configuration presented here applies to a 3-node Linux cluster system. Each of the 3 nodes operates a database instance. The cluster serves an SAP central instance as well as standalone and enqueue replication servers.

    For this example the following settings are used:

    The 3-node Linux cluster running the database EDU has the following node names and instances:

    saprac1, operating Oracle instance EDU001 saprac2, operating Oracle instance EDU002 saprac3, operating Oracle instance EDU003

    Usually the SAP instances hosted by the cluster itself do not cover the common user workload. This workload is covered by SAP application instances outside the cluster. The message server and enqueue server are separate from the central instance which makes the old central instance a common application instance. But for other purposes like SAP's solution manager, the former central instance is still needed so we would recommend it is placed under cluster control for high availability and that it keeps its name.

    Old SAP central instance (without message and enqueue servers):

    SAPSYSTEMNAME = EDU Instance = DVEBMGS00

    The default host for this instance is saprac1 and the failover hosts for this instance are saprac2 and saprac3.

    Enqueue and replicated enqueue servers:

    The default hosts for standalone enqueue and replication servers are saprac2 and saprac3 and they might failover to the remaining hosts. They cannot be run together on one node.

    Enqueue server instance = ASCS03 Replicator server instance = ERS03

    2

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Any other SAP application server (AS) instance:

    This is a productive SAP application instance running outside of the cluster and in this example it usually connects to database services provided by instance EDU002.

    Let us assume the host name of this machine is anyhost:

    Instance = D04 Host = anyhost DB Instance = EDU002 (predefined provider of database service if not failed over)

    SQL*Net setup in 10g RAC on CRS and SAP

    The affected files are listener.ora, tnsnames.ora and sqlnet.ora under $ORACLE_HOME/network/admin. Be careful when executing programs like netca and sapinst because they sometimes replace the existing files with their own versions. If the TNS_ADMIN environment variable is set, double-check the versions of the files in all locations for correctness and consistency using the environment of users ora and adm. It is good practice to use TNS_ADMIN system-wide to share one set of SQL*Net configuration files. The directory /sapmnt//profile/oracle can be accessed by all RAC and SAP server hosts inside the cluster if this directory is on a shared cluster file system.

    sqlnet.ora

    In these examples it is assumed that sqlnet.ora contains the following entry: NAMES.DEFAULT_DOMAIN = WORLD

    All TNS aliases defined in the tnsnames.ora below must be extended by the SQL*Net domain WORLD defined above.

    3

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    listener.ora

    For every instance, a separate listener definition is provided in the shared file listener.ora through the use of different listener names. All listeners listen on the Oracle VIPs only, so no connection can be set up using physical host names. Additionally all RAC database instances are defined statically for each local listener. This is for BR*Tools use only even if the database instances will never run on nodes other than their home nodes. So each of the 3 listeners requires the following entries:

    LISTENER__ = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ) (PORT = )(IP = FIRST) ) ) ) SID_LIST_LISTENER__ = (SID_LIST = (SID_DESC = (SID_NAME = ) (ORACLE_HOME = ) ) (SID_DESC = (SID_NAME = ) (ORACLE_HOME = ) ) ... (SID_DESC = (SID_NAME = ) (ORACLE_HOME = ) )

    )

    Example: LISTENER_EDU_SAPRAC1 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = saprac1-vip.de.oracle.com) (PORT = 1527)(IP = FIRST) ) ) ) LISTENER_EDU_SAPRAC2 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = saprac2-vip.de.oracle.com) (PORT = 1527)(IP = FIRST) )

    4

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    ) ) LISTENER_EDU_SAPRAC3 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = saprac3-vip.de.oracle.com) (PORT = 1527)(IP = FIRST) ) ) ) SID_LIST_LISTENER_EDU_SAPRAC1 = (SID_LIST = (SID_DESC = (SID_NAME = EDU001) (ORACLE_HOME = /oracle/EDU/102_64) ) (SID_DESC = (SID_NAME = EDU002) (ORACLE_HOME = /oracle/EDU/102_64) ) (SID_DESC = (SID_NAME = EDU003) (ORACLE_HOME = /oracle/EDU/102_64) ) ) SID_LIST_LISTENER_EDU_SAPRAC2 = (SID_LIST = (SID_DESC = (SID_NAME = EDU001) (ORACLE_HOME = /oracle/EDU/102_64) ) (SID_DESC = (SID_NAME = EDU002) (ORACLE_HOME = /oracle/EDU/102_64) ) (SID_DESC = (SID_NAME = EDU003) (ORACLE_HOME = /oracle/EDU/102_64) ) ) SID_LIST_LISTENER_EDU_SAPRAC3 = (SID_LIST = (SID_DESC = (SID_NAME = EDU001) (ORACLE_HOME = /oracle/EDU/102_64) ) (SID_DESC = (SID_NAME = EDU002) (ORACLE_HOME = /oracle/EDU/102_64) ) (SID_DESC = (SID_NAME = EDU003) (ORACLE_HOME = /oracle/EDU/102_64) ) )

    5

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    tnsnames.ora

    The tnsnames.ora can be subdivided into 3 logical sections: One section for connections to dedicated database instances and for random connections to any instance, one section for connections between the database instance and listener for listener registration, and the last section is used for connections between the SAP instance and database instance and services.

    Section 1: Connections to dedicated database instances and general service

    These entries are most commonly used for administration purposes, for tools such as BR*Tools, SQL*Plus etc. This section is mandatory in SAP environments.

    One entry is needed for each RAC instance:

    .WORLD = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS= (PROTOCOL=TCP) (HOST=) (PORT=) ) ) (CONNECT_DATA = (SID = ) ) )

    Note:

    Even in RAC, we use SID here instead of SERVICE_NAME in the connect description. This type of connect string is used by BR*Tools.

    This general database service name is provided by all database instances so a connect attempt to this database service may be randomly made to any instance. This makes a successful connection to the database possible if at least one database instance is up and running:

    .WORLD = (DESCRIPTION = (LOAD_BALANCE = OFF) (FAILOVER = ON) (ADDRESS_LIST = (ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT = 1527)) (ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT = 1527)) ...

    6

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    (ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT = 1527)) ) (CONNECT_DATA = (SERVICE_NAME = .WORLD) (GLOBAL_NAME = .WORLD) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) ) ) )

    Note:

    This type of connect string is used by R3trans or startsap and is defined in the environment variable dbs_ora_tnsname.

    Section 2: Connections between database instances and listeners

    This section is needed to enable the database instances to register with the local and remote listeners.. This section is mandatory in SAP environments.

    Two entries are needed for each RAC database instance:

    LISTENER__.WORLD = (ADDRESS_LIST = (ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=)) ) REMOTE_LISTENER__.WORLD = (ADDRESS_LIST = (ADDRESS= (PROTOCOL=TCP)(HOST=

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Section 3: Connections from SAP instances

    The SAP instances connect to their database service using TNS entries of the following type. Each SAP instance has its own connect string, specifying a dedicated database service. To allow for clear assignment of TNS entries to SAP application server instances, the name of the SAP instance is part of the TNS entry. This naming convention is very helpful as it provides the mapping pattern between SAP instances and Oracle database services. Unlike in single instances, in RAC environments database service names are used in connect string definitions to ensure proper mapping between SAP instances and Oracle database instances. This section is mandatory in SAP environments.

    __.WORLD = (DESCRIPTION = (LOAD_BALANCE = OFF) (FAILOVER = ON) (ADDRESS_LIST = (ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT = 1527)) (ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT = 1527)) ... (ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT = 1527)) ) (CONNECT_DATA = (SERVICE_NAME = _.WORLD) (GLOBAL_NAME = .WORLD) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) ) ) )

    Note:

    The DEFAULT-HOST is the IP name of the machine hosting the service / instance by default.

    Example of tnsnames.ora

    # SECTION 1 # connectionts to dedicated instances and general service EDU001.WORLD= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS=(PROTOCOL=TCP)(HOST=saprac1-vip)(PORT=1527)) ) (CONNECT_DATA = (SID = EDU001)) ) EDU002.WORLD= (DESCRIPTION = (ADDRESS_LIST =

    8

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    (ADDRESS=(PROTOCOL=TCP)(HOST=saprac2-vip)(PORT=1527)) ) (CONNECT_DATA = (SID = EDU002)) ) EDU003.WORLD= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS=(PROTOCOL=TCP)(HOST=saprac3-vip)(PORT=1527)) ) (CONNECT_DATA = (SID = EDU003)) ) EDU.WORLD = (DESCRIPTION = (LOAD_BALANCE = OFF) (FAILOVER = ON) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = saprac1-vip)(PORT = 1527)) (ADDRESS = (PROTOCOL = TCP)(HOST = saprac2-vip)(PORT = 1527)) (ADDRESS = (PROTOCOL = TCP)(HOST = saprac3-vip)(PORT = 1527)) ) (CONNECT_DATA = (SERVICE_NAME = EDU.WORLD) (GLOBAL_NAME = EDU.WORLD) (FAILOVER_MODE = (TYPE = SELECT)(METHOD = BASIC)) ) ) # SECTION 2 # database listener connections LISTENER_EDU_SAPRAC1.WORLD = (ADDRESS_LIST = (ADDRESS=(PROTOCOL=TCP)(HOST=saprac1-vip)(PORT=1527)) ) LISTENER_EDU_SAPRAC2.WORLD = (ADDRESS_LIST = (ADDRESS=(PROTOCOL=TCP)(HOST=saprac2-vip)(PORT=1527)) ) LISTENER_EDU_SAPRAC3.WORLD = (ADDRESS_LIST = (ADDRESS=(PROTOCOL=TCP)(HOST=saprac3-vip)(PORT=1527)) ) REMOTE_LISTENER_EDU_SAPRAC1.WORLD = (ADDRESS_LIST = (ADDRESS=(PROTOCOL=TCP)(HOST=saprac2-vip)(PORT=1527)) (ADDRESS=(PROTOCOL=TCP)(HOST=saprac3-vip)(PORT=1527)) ) REMOTE_LISTENER_EDU_SAPRAC2.WORLD = (ADDRESS_LIST = (ADDRESS=(PROTOCOL=TCP)(HOST=saprac1-vip)(PORT=1527)) (ADDRESS=(PROTOCOL=TCP)(HOST=saprac3-vip)(PORT=1527)) ) REMOTE_LISTENER_EDU_SAPRAC3.WORLD = (ADDRESS_LIST = (ADDRESS=(PROTOCOL=TCP)(HOST=saprac1-vip)(PORT=1527))

    9

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    (ADDRESS=(PROTOCOL=TCP)(HOST=saprac2-vip)(PORT=1527)) ) # SECTION 3 # used for SAP connections EDU_DVEBMGS00_SAPRAC1.WORLD = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = saprac1-vip)(PORT = 1527)) (ADDRESS = (PROTOCOL = TCP)(HOST = saprac2-vip)(PORT = 1527)) (ADDRESS = (PROTOCOL = TCP)(HOST = saprac3-vip)(PORT = 1527)) ) (CONNECT_DATA = (SERVICE_NAME = DVEBMGS00_saprac1.WORLD) (GLOBAL_NAME = EDU.WORLD) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) ) ) ) EDU_D04_anyhost.WORLD = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = saprac1-vip)(PORT = 1527)) (ADDRESS = (PROTOCOL = TCP)(HOST = saprac2-vip)(PORT = 1527)) (ADDRESS = (PROTOCOL = TCP)(HOST = saprac3-vip)(PORT = 1527)) ) (CONNECT_DATA = (SERVICE_NAME = D04_anyhost.WORLD) (GLOBAL_NAME = EDU.WORLD) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) ) ) )

    Database parameters

    The db_domain database parameter should be set to the value 'WORLD' to make the

    example consistent.

    db_domain = 'WORLD'

    Additionally, the following database parameters must be defined for each instance:

    .local_listener = 'LISTENER__.WORLD' .remote_listener = 'REMOTE_LISTENER__.WORLD' .service_names = '', ''

    10

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Note:

    The service_names parameter does not have a '.WORLD' domain.

    Example:

    EDU001.local_listener='LISTENER_EDU_SAPRAC1.WORLD' EDU003.local_listener='LISTENER_EDU_SAPRAC3.WORLD' EDU002.local_listener='LISTENER_EDU_SAPRAC2.WORLD' EDU001.remote_listener='REMOTE_LISTENER_EDU_SAPRAC1.WORLD' EDU002.remote_listener='REMOTE_LISTENER_EDU_SAPRAC2.WORLD' EDU003.remote_listener='REMOTE_LISTENER_EDU_SAPRAC3.WORLD' EDU001.service_names='EDU','EDU001' EDU002.service_names='EDU','EDU002' EDU003.service_names='EDU','EDU003'

    For details of how to set and maintain database parameters, please refer to the standard Oracle documentation, SAP installation guides and SAP OSS notes.

    11

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    SAP instance setup

    The SAP instance and start profiles as well as the SAP environment must reflect the SQL*Net settings above.

    Using this setup, each SAP instance is given its own TNS connect string or alias and uses its own Oracle database service. Additionally command line tools use TNS aliases with a common defined value and are able to run on all nodes.

    ADM environment

    This chapter only describes the environment variables of relevance to SQL*Net ORACLE_SID, dbs_ora_tnsname and TNS_ADMIN.

    TNS_ADMIN

    This variable points to a folder containing the SQL*Net configuration files. We would recommend sharing one set of configuration files across all RAC nodes and possibly all application servers. There is absolutely no difference between single instance and RAC installations with respect to this parameter. One option is to use /sapmnt//profile/oracle which can be accessed by all SAP hosts. For a high-availability solution this directory must be located in a storage area with high availability.

    ORACLE_SID

    The default SAP-recommended setting is and usually has the same value as SAPSYSTEMNAME. In an RAC environment there is no database instance called , but only node-dependent instance called 00n where n is the RAC thread or instance number (example EDU001). In fact ORACLE_SID is only used for non-SAP connections started manually such as sqlplus which should be used by ora user. Oracle SAPCC recommends keeping the ORACLE_SID setting as for adm environments even if SAP OSS note 602843 recommends 00n. This recommendation is made for the following reasons:

    12

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    sqlplus should be started manually by ora and not by adm In RAC BR*Tools connect via TNS alias, so ORACLE_SID is not needed SAP tools and application servers use dbs_ora_tnsname If there are any SAP application parts still using ORACLE_SID, connections will fail.

    To simplify the process of identifying this bug, it has to be changed by SAP.

    Less change effort

    dbs_ora_tnsname

    The environment variable dbs_ora_tnsname is mainly used by R3trans (and thus by sapstart) to check if the database instance (at least one) is up and running. It defines the default TNS connect string for connecting to the database instance and is found in the file dbenv.sh or dbenv.csh. To enable the tools to connect to all instances from every node, the general connect can be used.

    Environment variables:

    ORACLE_SID= TNS_ADMIN= dbs_ora_tnsname=.WORLD

    Example:

    ORACLE_SID = EDU TNS_ADMIN=/sapmnt/EDU/profile/oracle dbs_ora_tnsname = EDU.WORLD

    SAP instance profile

    The TNS connect string for a running SAP instance is defined in the SAP instance profile by the parameter dbs/ora/tnsname. If the environment variable dbs_ora_tnsname is defined, it overwrites the profile variable dbs/ora/tnsname. As the dbs_ora_tnsname should be always defined in RAC systems, the instance profile parameter dbs/ora/tnsname would never be used. Nevertheless it is good practice and we would highly recommend defining this parameter in the profile for documentation.

    File: __

    dbs/ora/tnsname=__.WORLD

    13

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Note:

    The part of the file name is dependent on the host currently running the SAP instance. The in the TNS connect string is the default host for running this SAP instance.

    Note:

    Standalone and replicated enqueue server instances do not require database access, so their profiles do not contain dbs/ora/tnsname.

    Example:

    For old central instance DVEBMGS00 on host saprac1:

    Filename: EDU_DVEBMGS00_saprac1

    dbs/ora/tnsname = EDU_DVEBMGS00_saprac1.WORLD

    For D04 instance, which is running on host "anyhost":

    Filename: EDU_D04_anyhost

    dbs/ora/tnsname = EDU_D04_anyhost.WORLD

    SAP instance START profile

    During SAP instance startup, the SAP processes connect to the database using the connect string defined in the instance profile. Because the environment variable dbs_ora_tnsname is defined, the instance-specific profile parameter is overwritten by the common environment variable. For this reason the SAP start profile contains an SAP instance-dependent definition of dbs_ora_tnsname, which overwrites the environment and the entry in the instance profile.

    File: START__

    SETENV_03 = dbs_ora_tnsname=__.WORLD

    Standalone and replicated enqueue server instances do not require database access, so their profiles do not need this profile parameter.

    14

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Example:

    For old central instance DVEBMGS00 on host saprac1:

    Filename: START_DVEBMGS00_saprac1

    SETENV_03 = dbs_ora_tnsname=EDU_DVEBMGS00_saprac1.WORLD

    For D04 instance on host "anyhost":

    Filename: START_D04_anyhost

    SETENV_03 = dbs_ora_tnsname=EDU_D04_anyhost.WORLD

    Oracle Instant Client for local or SAP application server use

    When starting Oracle 10g, SAP installs the Oracle Instant Client together with SAP software linked to Oracle client library version 10g. In RAC environments, nothing extra is required compared with single instance configurations. If the environment variable TNS_ADMIN is used, double-check that it points to the same set of files or the consistency of the files across all RAC and application servers in general. Serious problems may arise if different files are used in one system at the same time. Please see SAP OSS note 819829 for details.

    CRS service definition

    Each SAP instance defined in the SAP system is given its own TNS connect string which uses its own database service. The following command is used to create these services:

    srvctl add service d -s -r -a

    Note:

    -r and -a take database instance names, not TNS connect strings

    -s refers to the CRS service name and does not need a domain (.WORLD)

    15

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Note:

    These CRS services must be defined for SAP application (AS) instances only. The CRS service for an old central instance (CI) is defined by creating the setup for sapctl automatically.

    Example:

    For D04 instance on host "anyhost":

    srvctl add service d edu s D04_anyhost r EDU002 a EDU003,EDU001

    BR*Tools setup

    To complete the SQL*Net related setup, there are two SQL*Net related SAP parameters in the init.sap file. The BR*Tools are used to start and stop instances in the event of backup or restore operations and they need to know the defined database instances. In the background, SQL*Plus is called by BR*Tools for instance management and the connection uses SQL*Net TNS aliases.

    Because all instances have different SIDs, symbolic links must be created for every instance pointing to a shared init.sap file, which must have the parallel_instances parameter set.

    File: $ORACLE_HOME/dbs/init.sap

    parallel_instances = | () # - [,...] # - :@ # - Oracle system id for parallel instance # - Oracle home for parallel instance # - Oracle connection name to parallel BR*Tools 7.00 now also support the use of database services starting with patch 24. The executables BR*Tools and brbackup are able to handle CRS services, e.g. in the event of an offline backup, services will be restarted on the nodes where they were previously running.

    For this, BR*Tools have a new parameter in the init.sap file:

    db_services = yes

    16

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    If this is set to yes, BR*Tools handle the defined database services and return them to their original state at end of BR*Tools operation. If db_services is set to no, BR*Tools do not handle the services and if any instance was shut down, its database service will not be restarted after completion of the BR*Tools operation as a result of which the service will remain in offline status. Cluster manager CRS will not automatically start the database service after a BR*Tools operation because SQL*Plus is called by BR*Tools for starting and shutting down instances. In the event of an instance shutdown, SQL*Plus automatically tells CRS that the target state of the connected service should become offline. In the event of an instance start there is no handshake between SQL*Plus and CRS so the service remains offline. Please see SAP OSS note 1033126 for details.

    Example:

    Directory $ORACLE_HOME/dbs (/oracle/EDU/102_64/dbs) features 3 symbolic links (initEDU001.sap, initEDU002.sap, initEDU001.sap) pointing to one common file initEDU.sap

    File: /oracle/EDU/102_64/dbs/initEDU.sap

    parallel_instances = ( EDU001:/oracle/EDU/102_64@EDU001, EDU002:/oracle/EDU/102_64@EDU002, EDU003:/oracle/EDU/102_64@EDU003)

    db_services = yes

    17

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Example output

    If the system is configured following the above rules, the different tools will show the SQL*Net and service relevant output as follows:

    Check configured database services

    oraedu> srvctl config service -d EDU DVEBMGS00_saprac1 PREF: EDU001 AVAIL: EDU002 EDU003 D04_anyhost PREF: EDU002 AVAIL: EDU001 EDU003

    Check status of configured database services

    oraedu> srvctl status service -d EDU Service DVEBMGS00_saprac1 is running on instance(s) EDU001 Service D04_anyhost is running on instance(s) EDU002

    Check status of configured CRS resources oraedu> crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora....002.srv application ONLINE ONLINE saprac2 ora....rac2.cs application ONLINE ONLINE saprac2 ora....01.inst application ONLINE ONLINE saprac1 ora....02.inst application ONLINE ONLINE saprac2 ora....03.inst application ONLINE ONLINE saprac3 ora....001.srv application ONLINE ONLINE saprac1 ora....rac1.cs application ONLINE ONLINE saprac1 ora.EDU.db application ONLINE ONLINE saprac3 ora....C1.lsnr application ONLINE ONLINE saprac1 ora....ac1.gsd application ONLINE ONLINE saprac1 ora....ac1.ons application ONLINE ONLINE saprac1 ora....ac1.vip application ONLINE ONLINE saprac1 ora....C2.lsnr application ONLINE ONLINE saprac2 ora....ac2.gsd application ONLINE ONLINE saprac2 ora....ac2.ons application ONLINE ONLINE saprac2 ora....ac2.vip application ONLINE ONLINE saprac2 ora....C3.lsnr application ONLINE ONLINE saprac3 ora....ac3.gsd application ONLINE ONLINE saprac3 ora....ac3.ons application ONLINE ONLINE saprac3 ora....ac3.vip application ONLINE ONLINE saprac3 ora....001.srv application ONLINE ONLINE saprac1 ora....rac1.cs application ONLINE ONLINE saprac1 ora....002.srv application ONLINE ONLINE saprac2 ora....host.cs application ONLINE ONLINE saprac2 sap....bap.enq application ONLINE ONLINE saprac1 sap....bap.rep application ONLINE ONLINE saprac2 sap....bap.vip application ONLINE ONLINE saprac1 sap....00.inst application ONLINE ONLINE saprac1 sap....nst.vip application ONLINE ONLINE saprac1

    18

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Check configuration of CRS resources protecting SAP instances saprac1:eduadm 1> sapctl config all -sapsid EDU Production Copyright 2005, 2006, 2007, 2008 Oracle. All rights reserved CRS_HOME=/oracle/CRS/102_64 Resource SAP ABAP Enqueue service = sap.EDU.ASCS03.abap.enq Location of CRS SAP scripts = /usr/sap/EDU/SYS/exe/run Resource SAP ABAP VIP = sap.EDU.abap.vip Hosting Members = saprac1 saprac2 saprac3 Interface = eth0 Netmask = 255.255.255.0 IP Address = 10.165.111.85 Resource SAP ABAP Replication service = sap.EDU.ERS03.0.abap.rep Location of CRS SAP scripts = /usr/sap/NW4/SYS/exe/run Instance SAP instance DVEBMGS00 = sap.EDU.DVEBMGS00.inst Location of CRS SAP scripts = /usr/sap/EDU/SYS/exe/run Resource SAP instance VIP for DVEBMGS00 = sap.EDU.DVEBMGS00.inst.vip Hosting Members = saprac1 saprac2 saprac3 Interface = eth0 Netmask = 255.255.255.0 IP Address = 10.165.111.89

    Check status of SAP-related CRS resources saprac1:eduadm 2> sapctl status all -sapsid EDU Production Copyright 2005, 2006, 2007, 2008 Oracle. All rights reserved SAP ABAP VIP is ONLINE on saprac1 SAP ABAP Enqueue service is ONLINE on saprac1 SAP ABAP Replication service is ONLINE on saprac2 SAP instance VIP for DVEBMGS00 is ONLINE on saprac1 SAP instance DVEBMGS00 is ONLINE on saprac1

    Show service names currently bound to database instances using sqlplus SQL> col value format a30 SQL> select inst_id,ordinal,value from gv$parameter2 where name='service_names' order by 1,2; INST_ID ORDINAL VALUE ---------- ---------- ------------------------------ 1 1 DVEBMGS00_saprac1 1 2 EDU001 1 3 EDU 2 1 D04_anyhost 2 2 EDU002 2 3 EDU 3 1 EDU 3 2 EDU003 8 rows selected.

    19

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Check status of RAC listener (node saprac1)

    oraedu> lsnrctl status LISTENER_EDU_SAPRAC1 LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 15-JAN-2009 11:42:41 Copyright (c) 1991, 2007, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=saprac1-vip)(PORT=1527)(IP=FIRST))) STATUS of the LISTENER ------------------------ Alias listener_edu_saprac1 Version TNSLSNR for Linux: Version 10.2.0.4.0 - Production Start Date 14-JAN-2009 17:01:48 Uptime 0 days 18 hr. 40 min. 52 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /oracle/EDU/102_64/network/admin/listener.ora Listener Log File /oracle/EDU/102_64/network/log/listener_edu_saprac1.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.165.111.95)(PORT=1527))) Services Summary... Service "EDU.WORLD" has 3 instance(s). Instance "EDU001", status READY, has 1 handler(s) for this service... Instance "EDU002", status READY, has 1 handler(s) for this service... Instance "EDU003", status READY, has 1 handler(s) for this service... Service "EDU001" has 1 instance(s). Instance "EDU001", status UNKNOWN, has 1 handler(s) for this service... Service "EDU001.WORLD" has 1 instance(s). Instance "EDU001", status READY, has 1 handler(s) for this service... Service "EDU002" has 1 instance(s). Instance "EDU002", status UNKNOWN, has 1 handler(s) for this service... Service "EDU002.WORLD" has 1 instance(s). Instance "EDU002", status READY, has 1 handler(s) for this service... Service "EDU003" has 1 instance(s). Instance "EDU003", status UNKNOWN, has 1 handler(s) for this service... Service "EDU003.WORLD" has 1 instance(s). Instance "EDU003", status READY, has 1 handler(s) for this service... Service "D04_anyhost.WORLD" has 1 instance(s). Instance "EDU002", status READY, has 1 handler(s) for this service... Service "DVEBMGS00_saprac1.WORLD" has 1 instance(s). Instance "EDU001", status READY, has 1 handler(s) for this service... The command completed successfully oraedu>

    20

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Check services known currently by RAC listener (node saprac1)

    oraedu> lsnrctl service LISTENER_EDU_SAPRAC1 LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 15-JAN-2009 13:34:17 Copyright (c) 1991, 2007, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=saprac1-vip)(PORT=1527)(IP=FIRST))) Services Summary... Service "D04_saprac2.WORLD" has 1 instance(s). Instance "EDU002", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=saprac2-vip)(PORT=1527)) Service "EDU.WORLD" has 3 instance(s). Instance "EDU001", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready LOCAL SERVER Instance "EDU002", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=saprac2-vip)(PORT=1527)) Instance "EDU003", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=saprac3-vip)(PORT=1527)) Service "EDU001" has 1 instance(s). Instance "EDU001", status UNKNOWN, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 LOCAL SERVER Service "EDU001.WORLD" has 1 instance(s). Instance "EDU001", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready LOCAL SERVER Service "EDU002" has 1 instance(s). Instance "EDU002", status UNKNOWN, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 LOCAL SERVER Service "EDU002.WORLD" has 1 instance(s). Instance "EDU002", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=saprac2-vip)(PORT=1527)) Service "EDU003" has 1 instance(s). Instance "EDU003", status UNKNOWN, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 LOCAL SERVER Service "EDU003.WORLD" has 1 instance(s). Instance "EDU003", status READY, has 1 handler(s) for this service...

    21

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Handler(s): "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=saprac3-vip)(PORT=1527)) Service "DVEBMGS00_saprac1.WORLD" has 1 instance(s). Instance "EDU001", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready LOCAL SERVER The command completed successfully oraedu>

    Annex: TNS name resolution and domain names

    Although not directly related to RAC, this topic should be included as it forms part of the Oracle basics. How is a TNS entry resolved and what are the connections between the different domain names?

    Take this TNS name as an example entry (this example differs from the settings above to demonstrate the different components):

    SQL*Net domain

    A connection request is issued by using a combination of user name, password and connect string or TNS alias in the following format:

    /@, e.g.

    SQL> connect sapr3/sap@EDU001

    22

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    This connect string here uses a TNS alias 'EDU001'. It will be looked up in the tnsnames.ora file, but before starting to look in the file, the SQL*Net default domain will be added to the TNS alias. The SQL*Net default domain name is defined in the sqlnet.ora file by the following parameter:

    NAMES.DEFAULT_DOMAIN = DE.ORACLE.COM

    Using 'rac001' in the connect string and the SQL*Net domain shown here, the entry rac001.de.oracle.com would be searched for in the tnsnames.ora file. If the default SQL*Net domain is set to a different value than that in the TNS alias in tnsnames.ora, it must be specified explicitly as follows:

    SQL> connect sapr3/[email protected]

    If the TNS alias in the connect string cannot be resolved, an ORA-12154 error is output. SQL> connect sapr3/[email protected] ERROR: ORA-12154: TNS:could not resolve service name

    IP or DNS domain

    Every TNS entry using a TCP/IP network protocol must specify a host by IP address or IP name. A domain name, which is related to DNS, may be added to IP names. If specified incorrectly, the IP name cannot be resolved and the following message appears:

    SQL> connect sapr3/sap@EDU001 ERROR: ORA-12545: Connect failed because target host or object does not exist

    This is a wrong network address or unknown host / IP name.

    23

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Service name

    The service name specifies a database service which is offered by one or multiple database instances. This is an arbitrary string which can be defined at database and instance level.

    This service name is sent from the database instance to the listener so the listener is aware of the instance offering this service. An instance can offer one or multiple services which are defined by database parameter service_names. Here is an example of the setting of a database instance together with the information given to the listener: SQL> show parameter service_names NAME TYPE VALUE ------------------------------------ ----------- --------------------- service_names string EDU, EDU001 SQL> LSNRCTL> services Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=saprac1-vip)(PORT=1527)(IP=FIRST))) Services Summary... Service "EDU" has 3 instance(s). Instance "EDU001", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:5 refused:0 state:ready LOCAL SERVER Instance "EDU002", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:10 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=saprac2-vip)(PORT=1527)) Instance "EDU003", status READY, has 1 handler(s) for this

    service... Handler(s): "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=saprac3-vip)(PORT=1527)) Service "EDU001" has 2 instance(s). Instance "EDU001", status UNKNOWN, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 LOCAL SERVER Instance "EDU001", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:5 refused:0 state:ready LOCAL SERVER The command completed successfully LSNRCTL>

    The service name cannot be defined in the listener.ora file; it always comes from the database. In an RAC environment the service name is essential for using any failover, reconnect or load balance feature offered by Oracle.

    24

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Database domain

    Next to the service name the database can have a database domain defined using the database parameter db_domain. The value of this parameter is added to the end of the service name, separated by a dot. The database domain just extends the service name; it has no additional functionality.

    SQL> show parameter db_domain NAME TYPE VALUE ------------------------------------ ----------- --------------------- db_domain string world SQL> LSNRCTL> services Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hpqcc16.wdf.sap-ag.de)(PORT=1521))) Services Summary... Service "RAC.world" has 1 instance(s). Instance "RAC001", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:1 refused:0 state:ready LOCAL SERVER Service "RAC001.world" has 1 instance(s). Instance "RAC001", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:1 refused:0 state:ready LOCAL SERVER The command completed successfully LSNRCTL>

    Annex: Some Relevant SAP OSS notes

    905359 - Using BR*Tools for Oracle RAC databases

    562403 - FAQ: Oracle Net

    602843 - Environment settings for R/3/Oracle on UNIX

    830578 - Oracle database 10g: Unix environment variable

    1033126 - BR*Tools support for Oracle 10g RAC

    819829 - Oracle Database 10g: Instant Client 10.x on Unix

    25

  • Oracle White PaperSQL*Net configuration for SAP taking RAC as an example

    Conclusion

    This paper has shown how to configure Oracle SQL*Net together with Oracle Clusterware and Oracle RAC database to enable SAP application instances to communicate with a CRS protected database, SAP enqueue and replication services and the old SAP central instance.

    More information about Oracle Clusterware can be found at: http://www.oracle.com/technology/products/database/clustering

    And as a reminder - for details about configuring SAP with Oracle RAC refer to the white papers 'Configuration of SAP NetWeaver for Oracle Database 10g Real Application Clusters' and 'Providing High Availability for SAP Resources' in the media library on the SAP marketplace website at: http://service.sap.com/dbaora .

    26

  • SQL*Net configuration for SAP taking RAC as an example February 2009 Author: Dirk Hering Contributing Authors: Hanno Bresch, Kurt Broeg, Jrgen Kirschner Oracle Corporation World Headquarters 500 Oracle Parkway Redwood Shores, CA 94065 U.S.A. Worldwide Inquiries: Phone: +1.650.506.7000 Fax: +1.650.506.7200 oracle.com

    Copyright 2009, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our prior written permission.

    Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

    0209