Академический Документы
Профессиональный Документы
Культура Документы
February 2009
Document version 1.0
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
<SID>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
Overview
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.
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.
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.
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_<sapsid>_<host> =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)(HOST = <RAC VIP for this host>)
(PORT = <TCP port>)(IP = FIRST)
)
)
)
SID_LIST_LISTENER_<sapsid>_<host> =
(SID_LIST =
(SID_DESC =
(SID_NAME = <ORA_SID on node_1>)
(ORACLE_HOME = <Path to $ORACLE_HOME>)
)
(SID_DESC =
(SID_NAME = <ORA_SID on node_2>)
(ORACLE_HOME = <Path to $ORACLE_HOME>)
)
...
(SID_DESC =
(SID_NAME = <ORA_SID on node_n>)
(ORACLE_HOME = <Path to $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)
)
)
)
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)
)
)
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.
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:
<SID>.WORLD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS=
(PROTOCOL=TCP)
(HOST=<RAC VIP for this host>)
(PORT=<tcp port>)
)
)
(CONNECT_DATA =
(SID = <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 <SAPSID> 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:
<SAPSID>.WORLD =
(DESCRIPTION =
(LOAD_BALANCE = OFF)
(FAILOVER = ON)
(ADDRESS_LIST =
(ADDRESS=(PROTOCOL=TCP)(HOST=<RAC VIP for host_1>)(PORT = 1527))
(ADDRESS=(PROTOCOL=TCP)(HOST=<RAC VIP for host_2>)(PORT = 1527))
...
Note:
This type of connect string is used by R3trans or startsap and is defined in the environment
variable dbs_ora_tnsname.
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_<sapsid>_<host>.WORLD =
(ADDRESS_LIST =
(ADDRESS=(PROTOCOL=TCP)(HOST=<RAC VIP of instance>)(PORT=<port>))
)
REMOTE_LISTENER_<sapsid>_<host>.WORLD =
(ADDRESS_LIST =
(ADDRESS=
(PROTOCOL=TCP)(HOST=<RAC VIP of other instance)(PORT=<port>)
)
(ADDRESS=
(PROTOCOL=TCP)(HOST=<RAC VIP of other instance)(PORT=<port>)
)
...
)
The first entry defines the connect data for the database instance to communicate with the local
listener running on the same host. The remote_listener entry contains the connect data to enable
the local database instance to reach the listeners running on ALL OTHER hosts.
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.
<SAPSID>_<SAP-INSTANCE>_<DEFAULT-HOST>.WORLD =
(DESCRIPTION =
(LOAD_BALANCE = OFF)
(FAILOVER = ON)
(ADDRESS_LIST =
(ADDRESS=(PROTOCOL=TCP)(HOST=<RAC VIP for host_1>)(PORT = 1527))
(ADDRESS=(PROTOCOL=TCP)(HOST=<RAC VIP for host_2>)(PORT = 1527))
...
(ADDRESS=(PROTOCOL=TCP)(HOST=<RAC VIP for host_n>)(PORT = 1527))
)
(CONNECT_DATA =
(SERVICE_NAME = <SAP-INSTANCE>_<DEFAULT-HOST>.WORLD)
(GLOBAL_NAME = <SAPSID>.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 =
(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))
(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:
<SID>.local_listener = 'LISTENER_<sapsid>_<host>.WORLD'
<SID>.remote_listener = 'REMOTE_LISTENER_<sapsid>_<host>.WORLD'
<SID>.service_names = '<sapsid>', '<sid>'
10
Note:
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
<SID>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/<SAPSYSTEMNAME>/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 <SID> and usually has the same value as
SAPSYSTEMNAME. In an RAC environment there is no database instance called <SID>, but
only node-dependent instance called <SID>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<SID> user. Oracle SAPCC recommends
keeping the ORACLE_SID setting as <SID> for <SID>adm environments even if SAP OSS
note 602843 recommends <SID>00n. This recommendation is made for the following reasons:
12
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=<SID>
TNS_ADMIN=<path>
dbs_ora_tnsname=<SAPSYSTEMNAME>.WORLD
Example:
ORACLE_SID = EDU
TNS_ADMIN=/sapmnt/EDU/profile/oracle
dbs_ora_tnsname = EDU.WORLD
File: <SAPSYSTEMNAME>_<SAP-instance>_<host>
dbs/ora/tnsname=<SIS>_<SAP-instance>_<default_host>.WORLD
13
Note:
The <host> part of the file name is dependent on the host currently running the SAP
instance. The <default_host> 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:
File: START_<SAP-instance>_<host>
SETENV_03 = dbs_ora_tnsname=<SID>_<SAP-instance>_<host>.WORLD
Standalone and replicated enqueue server instances do not require database access, so their
profiles do not need this profile parameter.
14
Example:
Note:
15
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:
BR*Tools setup
To complete the SQL*Net related setup, there are two SQL*Net related SAP parameters in the
init<SID>.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<SAPSID>.sap file, which must have the parallel_instances parameter
set.
File: $ORACLE_HOME/dbs/init<SAPSID>.sap
parallel_instances = <inst_desc> | (<inst_desc_list>)
# <inst_desc_list>
- <inst_desc>[,<inst_desc>...]
# <inst_desc>
- <Oracle_sid>:<Oracle_home>@<conn_name>
# <Oracle_sid>
# <Oracle_home>
# <conn_name>
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<SAPSID>.sap file:
db_services = yes
16
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:
parallel_instances = ( EDU001:/oracle/EDU/102_64@EDU001,
EDU002:/oracle/EDU/102_64@EDU002, EDU003:/oracle/EDU/102_64@EDU003)
db_services = yes
17
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:
18
19
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=saprac1vip)(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
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=saprac1vip)(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
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>
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:
<username>/<password>@<TNS alias>, e.g.
SQL> connect sapr3/sap@EDU001
22
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:
If the TNS alias in the connect string cannot be resolved, an ORA-12154 error is output.
SQL> connect sapr3/sap@EDU001.sap.com
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:
23
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=saprac1vip)(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
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.sapag.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>
25
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
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.
Worldwide Inquiries:
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective
Phone: +1.650.506.7000
owners.
Fax: +1.650.506.7200
oracle.com
0209