0% found this document useful (0 votes)
115 views

1261329 - DBA Cockpit - Oracle as a remote database

Uploaded by

Esmeralda Cano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views

1261329 - DBA Cockpit - Oracle as a remote database

Uploaded by

Esmeralda Cano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

2019-10-21 1261329

1261329 - DBA Cockpit: Oracle as a remote database


Version 19 Type SAP Note
Language English Master Language German
Priority Recommendations / Additional Info Category Consulting
Release Status Released for Customer Released On 03.09.2019
Component BC-DB-ORA-CCM ( (CCMS) Database Monitors )

Please find the original document at https://launchpad.support.sap.com/#/notes/ 1261329

Symptom

Overview
This SAP Note provides information about the connection of an Oracle remote
database to the DBA Cockpit.

Other Terms

DBACOCKPIT, DBCON, Oracle, Windows, Linux, Unix, Solution Manager

Reason and Prerequisites

You want to connect an Oracle remote database to the DBA Cockpit.


You do not have all of the information that is required to perform all of the
required steps.
This SAP Note only describes how to set up a database connection. Further steps
to be performed are described in Note 1028624.
If the SAP system (in which the DBA Cockpit is used) is operated using an Oracle database, you can
ignore steps 3 and 4 that are described below.

Solution

Step by step

Proceed as follows to correct the problem:

1. Check the technical requirements.


2. Connect the user.
3. Obtain the required software.
4. Installation of the software
5. Set up the database connection.
6. Test and any troubleshooting that may be required.

1. Technical requirements

To ensure that the connection to an Oracle database is successful, you must


fulfill some technical prerequisites.

a) Technical requirements in DBA Cockpit system

In the operating system, you can access the application server of the DBA
Cockpit system as the operating system user <sapsid>adm.

b) Technical requirements for Oracle database

The server on which the Oracle database to be connected runs can be accessed
from the application server using a network connection. You can check this using

© 2019 SAP SE or an SAP affiliate company. All rights reserved 1 of 12


2019-10-21 1261329

the "ping" operating system command.


All Oracle databases as of Release 9.2 can be connected as an external database.

2. Connect the user.

The database user who is to be entered for the database connection can be the
relevant schema owner, in other words, SAPR3, SAP<SID>, SAPSR3, or SAPDB<SID>.
In MCOD systems, you must select the database user who is the owner of tables
SDBAH and SDBAD and to which the public synonyms SAP_SDBAH and SAP_SDBAD point.

If the use of the SAP schema user is not possible, you can also
use a different user. The SAPDBA role (see SAP Note 134592) must have been
assigned to this different user.

Alternatively, the required GRANTS can also be assigned to the user explicitly
or implicitly using roles. For this, you must also have implemented the
correction from SAP Note 1866011.
The following GRANTS are required:

grant select_catalog_role to <user>;


grant create session to <user>;
grant alter session to <user>;

grant SELECT on <sapschema>.SDBAH to <user>;


grant SELECT on <sapschema>.SDBAD to <user>;
grant SELECT, UPDATE, DELETE on <sapschema>.DBCHECKORA to <user>;
grant SELECT, UPDATE, DELETE on <sapschema>.DBMSGORA to <user>;

(<sap schema> is the schema owner, that is SAPSR3, SAP<SID>, SAPR3 or SAPSR3DB;
for non-SAP databases, this is the schema user SAPSR3 in accordance with SAP
Note 320457.)

If the remote database is of the type that is operated in combination with an


SAP NetWeaver ABAP system, the following GRANTS are also required:

grant SELECT on <sapschema>.DBABD to <user>;


grant SELECT on <sapschema>.SVERS to <user>;
grant SELECT on <sapschema>.CVERS to <user>;

However, if you use a user that is not a schema user, some functions can no
longer be used in the DBA Cockpit:
System Event History (Performance -> Wait Event Analysis)
Performance Database (Performance -> Statistical Information)
Undo Statistics (Performance -> Statistical Information)
Oracle Net (Performance -> Additional Functions)
Explain (Diagnostics -> Explain)
In addition, the following functions are no longer available in the explain
display:
"Explain with hint"
"Analyse"
"Alter Session"

As of SAP_BASIS 7.02 SP13 or 7.31 SP7, the optional connection parameter "Schema"
is available. Here, you can enter the schema that you want to be monitored. If
you use another user than the schema user as the connect user and the
authorization SELECT ANY TABLE has been assigned to this user (grant select any
table to <user>;), the function "Explain" (Diagnostics -> Explain) is displayed
again and the functions "Explain with hint" and "Alter Session" are also
possible in the explain display.

3. Obtain the required software.

© 2019 SAP SE or an SAP affiliate company. All rights reserved 2 of 12


2019-10-21 1261329

To create a connection from the SAP Solution Manager to a database, you require
the SAP Basis software ("kernel") and two other database system-specific
software components. These are the database shared library (DBSL) from SAP and
the database client library from the relevant manufacturer of the database
system. You can download both of these components from SAP Service Marketplace.

As of SAP_BASIS 7.50 or SAP Kernel > 7.45, Oracle Database Client Version 12.1
or above is required.

a) Download of DBSL

On SAP Service Marketplace, go to the Software Distribution Center. To do this,


use the quick link http://service.sap.com/swdc and follow the menu path
"Downloads" -> "SAP Support Packages".
In the navigation area, choose "Support Package and Patches - Entry by
Application Group", and then in the main window, choose "SAP NetWeaver" -> "SAP
NETWEAVER" -> "<SAP NETWEAVER release>" -> "Entry by Component" -> "Application
Server ABAP" -> "SAP KERNEL <release> <64|32> BIT {UNICODE}". Depending on your
existing installation, choose 32 bit or 64 bit here and, if required, UNICODE.
Then choose "<operating system> on <architecture><64|32> bit" in accordance with
your installation and then choose "ORACLE". If Oracle DB Client v12.x or above
is used, the 64-bit architecture is required.
In the area "Download objects", select the file "lib_dbsl_<patch_level>-
<nnnnnnnn>.sar". It is best to select the file with the highest patch level.
Save this in a temporary folder and use the program SAPCAR to unpack the
archive:

SAPCAR -xvf lib_dbsl_<patch_level>-<nnnnnnnn>.sar

After you successfully unpack the archive, you no longer require the file
lib_dbsl_<patchlevel>-<nnnnnnnn>.sar and you can delete it.

b) Download of Oracle client software

On SAP Service Marketplace, go to the Software Distribution Center. To do this,


use the quick link http://service.sap.com/swdc and follow the menu path
"Software Downloads" -> "SAP Software Download Center" -> "Database and Database
Patches" -> "Oracle". For Oracle Database Client 11, then choose -> "Oracle 11.x
Software (xx-bit)" -> Installation -> <operating system> -> "ORACLE Database".
For Oracle Database Client 12, choose -> "Oracle 12.x Software" -> Installation
-> <operating system> -> "ORACLE Database". If access to the specified download
area is not possible, please proceed as described in SAP Note 2831190 - "Oracle
Client Software not downloadable".

Here, download the Oracle client file <most recent version> (zip file) into a
temporary directory and unpack the file. The unpacked zip file contains the
Oracle client OCL<nnnn>.SAR in the subfolders OCL_<operating system>. Copy the
file "OCL<nnnn>.SAR" into a temporary folder on the application server and use
the program SAPCAR to unpack the archive:

SAPCAR -xvf OCL<nnnn>.SAR

After you successfully unpack the archive, you no longer require the file
OCL<nnnn>.SAR and you can delete it.

4. Installation of the software

After you download and unpack the required software, the two components DBSL and
Oracle client software are installed in the ABAP central instance and all of the
ABAP application servers of your SAP Solution Manager. This section describes
this for Windows or UNIX/Linux-based systems.

© 2019 SAP SE or an SAP affiliate company. All rights reserved 3 of 12


2019-10-21 1261329

a) Installation of database shared library (DBSL)

For Windows-based systems:

Move the files that you obtained in step 3.a) ("Download the DBSL") to the
directory

<drive>:\usr\sap\<SAPSID>\SYS\exe

of the application server of the DBA Cockpit system.


For UNIX-based or Linux-based systems:

Move the files that you obtained in step 3.a) ("Download of DBSL") to the
directory

/usr/sap/<SAPSID>/SYS/exe/run

and

/sapmnt/<SID>/exe/uc/<operating system><architecture> (for example, linuxx86_64)

of your DBA Cockpit system.

b) Installation of Oracle client software

For Windows-based systems:

Move the files that you obtained in step 3.b) ("Download the Oracle client
software") to a directory on the application server of the DBA Cockpit system.
For example:

<drive>:\oracle\client\instantclient

Add this directory to the environment variable PATH: To do this, choose Start ->
Settings -> Control Panel -> System -> Advanced -> Environment Variables ->
System variables -> "Path" -> Edit and attach the above directory to the
available entry. Separate this using a semicolon (;).
Create another directory:

<drive>:\usr\sap\<SAPSID>\SYS\profile\oracle

Enter this directory into another system environment variable with the name
TNS_ADMIN.
To ensure that the changed environment is available for the application server,
you must restart the system.

For UNIX-based or Linux-based systems:

Move the files that you obtained in step 3.2 ("Download the Oracle client
software") to a directory on the application server.

Note: SAP recommends the following naming convention, which differs in the
Oracle Database Client Version 11 and Version 12: As of Version 12, the part
with the bit width ("_<64|32>") of the architecture is completely omitted in the
following paths.

/oracle/client/11x_<64|32>/instantclient_<version>

For Oracle Database Client v12:

/oracle/client/12x/instantclient_<version> (for example,


/oracle/client/12x/instantclient_12102)

© 2019 SAP SE or an SAP affiliate company. All rights reserved 4 of 12


2019-10-21 1261329

Where <version> of the component <nnnn> corresponds to the downloaded file OCL
<nnnn>.SAP. To facilitate a later upgrade of the Oracle client software, create
a link to instantclient_<version> in /oracle/client/11x_<64|32> (Oracle Client
v12 in /oracle/client/12x):

ln -s instantclient_<version> instantclient

Enter the path /oracle/client/11x_<64|32>/instantclient (Oracle Client v12


/oracle/client/12x/instantclient) in the environment of the user <sapsid>adm in
the library search path. This environment variable has a different name for
various UNIX variants:

• LIBPATH for AIX

• LD_LIBRARY_PATH for Linux, Solaris, and HP-UX

In this case, SHLIB_PATH is also possible for HP-UX. The variable then has the
following contents, for example:

/usr/sap/C11/SYS/exe/run:/oracle/client/11x_64/instantclient

For Oracle Database Client v12:

/usr/sap/C11/SYS/exe/run:/oracle/client/12x/instantclient

Create another directory:

/usr/sap/<SAPSID>/SYS/profile/oracle

Enter this directory into another system environment variable with the name
TNS_ADMIN.

In addition, you must set the environment variable NLS_LANG in the environment
of the user <sid>adm:

Unicode Solution Manager System: NLS_LANG=AMERICAN_AMERICA.UTF8

Non-Unicode Solution Manager System: NLS_LANG=AMERICAN_AMERICA.WE8DEC

For Windows, you must set the variable in the registry under "HKEY_LOCAL_MACHINE
-> Software -> SAP -> <sid> -> Environment".
For more detailed information, see Note 556232.

To ensure that the changed environment is available for the application server,
you must restart the system.

If the SAP application server of the DBA Cockpit system has one of the following
Basis Support Package levels, you must implement the corrections that are
contained in Note 1409472:

SAP_BASIS 701 Support Package 03 to Support Package 05


SAP_BASIS 702 Support Package 02
SAP_BASIS 711 Support Package 03 to Support Package 04
SAP_BASIS 720 Support Package 01 to Support Package 02

a) Creation of control data for Oracle client software

In the directory whose name is in the environment variable TNS_ADMIN


(/usr/sap/<SAPSID>/SYS/profile/oracle or

© 2019 SAP SE or an SAP affiliate company. All rights reserved 5 of 12


2019-10-21 1261329

<Drive>:\usr\sap\<SAPSID>\SYS\profile\oracle), create three text files


sqlnet.ora, protocol.ora, and tnsnames.ora with the content described below. If
you use the EZCONNECT mechanism (systems with SAP NetWeaver as of 7.02 Support
Package 4, SAP Solution Manager 7.1), the text file tnsnames.ora is not
required.

• sqlnet.ora:

NAMES.DIRECTORY_PATH = (EZCONNECT,TNSNAMES)

• protocol.ora:

This file can be left empty.

• tnsnames.ora (optional):

The entries in the file "tnsnames.ora" are described in point 4.

5. Set up the database connection.

When you use the EZCONNECT mechanism, you can continue with setup step a) "Set
the DBCON parameter". However, if you use the TNS connect mechanism, in the file
tnsnames.ora that is in the directory on the application server and points to
the environment variable TNS_ADMIN, you must add an entry like the one that
follows for each Oracle remote database:

<SID> =
(DESCRIPTION =
(SDU = 32768)
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = TCP)
(PROTOCOL = TCP)
(HOST = <database_host>)
(PORT = <port>)
)
)
(CONNECT_DATA =
(SID = <DB_ID>)
)
)

This means that

• <SID> = the ID that you want to use to access this database ("TNS Name")

• <database_host> = host name of the database server

• <port> = TCP port of the database listener

• <DB_ID> = database ID of the database that is to be connected

Usually, you can copy the entry in the file tnsnames.ora from the relevant file
of the remote system. To obtain the contents of tnsnames.ora in the remote
system, log on to the remote system as the database user ora<sid> (UNIX or
Linux) or as the database user <sid>adm (Windows) on operating system level.
There, you call the following command from the command line.

© 2019 SAP SE or an SAP affiliate company. All rights reserved 6 of 12


2019-10-21 1261329

tnsping <SID>

The output specifies the connection parameters and the path to the file
sqlnet.ora. The directory in which this file is stored, also includes the file
tnsnames.ora.

a) Setting of DBCON parameter

To ensure that the SAP Solution Manager system can use and query the remote
database, you must define the access data. This is saved in encrypted form in
the table DBCON. There are several options for setting the DBCON entries: You
can either use the DBA Cockpit or you can use transaction DBCO to do it
directly. In addition, you can use transaction SOLMAN_SETUP to create the DBCON
entries.
DBA Cockpit

Call transaction DBACOCKPIT. Choose System Configuration -> Add and enter the
following values:

• System = the name that you want to use to manage the remote database in the
DBA Cockpit.

Choose Remote Database -> Database Connection -> Create (button to the right
beside the input field for the database connection).
Enter the following values:

• Connection name = name of the database connection


Recommendation = system name

• Database system = Oracle

• Connections maximum/optimal = Number of simultaneous database connections.


This is used to limit the load on the remote database.

• Constant connection: If this checkbox is selected, the system sets up a


permanent connection to the remote database. Recommendation: Do not select
this.

• User name = database user on remote database

• Password/confirm = password of the above user

• When you use the EZCONNECT mechanism (systems with SAP NetWeaver as of 7.02
Support Package 4, SAP Solution Manager 7.1), enter the following
parameters:

• Database Host = The host name of the database server.


Note the following: If Oracle RAC is in use, you must specify the
virtual host name of the Oracle SCAN listener (as of Oracle 11).

• Service Name = The name of the Oracle database.

• Port = The listener port of the database.

• When you use the TNS connect mechanism, you must specify the following
parameter:

• TNS Name = The value for SID from the file tnsnames.ora.
Note the following: You can maintain the field in addition to the
fields of the EZCONNECT mechanism. If this is the case, using the TNS
connect mechanism is preferred to using the EZCONNECT mechanism.
However, the prerequisite for this is a relevant entry in the file
tnsnames.ora.

© 2019 SAP SE or an SAP affiliate company. All rights reserved 7 of 12


2019-10-21 1261329

• As of SAP_BASIS 7.02 SP13 or 7.31 SP7, the optional connection parameter


"Schema" is displayed. Here, you can enter the schema that you want to be
monitored. However, an entry makes sense only if you use another user than
the schema user as the connect user and you assigned the authorization
SELECT ANY TABLE to this user. ( grant select any table to <user>; see
section 2. Connect User).

Choose Save twice - once for the database connection and once for the system
configuration entry.
The database entry is then immediately available for use in the DBA Cockpit.

Transaction SOLMAN_SETUP

As of SAP Solution Manager Support Package 18, call transaction SOLMAN_SETUP in


your SAP Solution Manager system.

On the left-hand side, choose "Managed System Configuration" and, if required,


choose the "Databases" tab. In the table, choose a system that you want to
integrate.

Choose the button for configuring the system.


Subsequently, a wizard is displayed that guides you through the steps that must
be performed to connect a system to the SAP Solution Manager for monitoring.
Step 2 for the manual configuration includes an additional step for the DBA
Cockpit configuration that starts the database connection wizard.

For SAP Solution Manager 7.0 systems prior to Support Package 18, you can call
the same wizard from the diagnostics setup of the SAP Solution Manager:
http://<server name>:<http_port>/smd -> "Diagnostics Setup" -> "Managed Systems"
-> "Database Monitoring".

• In the Wizard, choose the system for which you want to set up the DBA
Cockpit (if required). The field for the DB host name and the DB name should
already be populated.

• You can leave the entry for the database schema empty (if it exists).

• Choose the option to continue processing ("Next").

• On the screen that is displayed now, enter the parameters for the database
host, the TNS name (if required; this is optional), the username, and the
password.

• Database name = name of the database connection.

• Database host

• User name = database user in the remote database

• DB password = password of the user mentioned above

• If you use the EZCONNECT mechanism (systems with SAP NetWeaver as of 7.02
SP4, SAP Solution Manager 7.1), enter the following parameters:

• Database Host = host name of database server


Note: If Oracle RAC is in use, you must specify the virtual host name
of the Oracle SCAN listener (as of Oracle 11).

• Service Name = name of Oracle database

• Port = listener port of database

© 2019 SAP SE or an SAP affiliate company. All rights reserved 8 of 12


2019-10-21 1261329

• When you use the TNS connect mechanism, specify the following parameter:

• TNS name = value for SID from the file tnsnames.ora (TNS name)
Note the following: You can maintain the field in addition to the
fields of the EZCONNECT mechanism. If this is the case, using the TNS
connect mechanism is preferred to using the EZCONNECT mechanism.
However, the prerequisite for this is a relevant entry in the file
tnsnames.ora.

• As of SAP_BASIS 7.02 SP13 or 7.31 SP7, the optional connection parameter


"Schema" is displayed. Here, you can enter the schema that you want to be
monitored. However, an entry makes sense only if you use another user than
the schema user as the connect user and you assigned the authorization
SELECT ANY TABLE to this user. ( grant select any table to <user>; see
section 2. Connect User).

Transaction DBCO

Call transaction DBCO. Choose Display/Change -> New Entries. Enter the following
values:

• DB connection = name of the database connection

• DBMS = "ORA"

• User name = database user on remote database

• DB password = the password of the above user. You must enter this twice.

• When using the TNS connect mechanism:

• Conn. info = the value for SID from the file tnsnames.ora ("TNS name")

• When using the EZCONNECT mechanism (systems with SAP NetWeaver as of 7.02
Support Package 4, SAP Solution Manager 7.1):

• Conn.Info = The character string "[Database Host]:[Port]/[Service


Name]", which consists of:

• Database Host = host name of database server


Note: If Oracle RAC is in use, you must specify the virtual host name
of the Oracle SCAN listener (as of Oracle 11).

• Port = listener port of database

• Service Name = name of Oracle database

• Permanent = unchecked

• Connection limit, connection optimum = Connections maximum/optimal as above.

Choose Save.

6. Test and troubleshooting

If problems occur when you test the database connection, check whether the
problems are caused by one of the following errors.

a) Possible causes of errors

Common errors are:

© 2019 SAP SE or an SAP affiliate company. All rights reserved 9 of 12


2019-10-21 1261329

• Oracle client software is not found


Check the environment variable PATH (Windows), or LD_LIBRARY_PATH or LIBPATH
for UNIX/Linux.

• Control files are not found


Check the environment variable TNS_ADMIN

• Syntactic error in the file tnsnames.ora


Check this file, particularly the bracket nesting and the upper or lower
case of the parameter values.

• Different upper or lower case of parameter values in the SAP Solution


Manager and in control files of the Oracle client software.

• You can use the following small ABAP program to test the database
connection. If this is unsuccessful, the developer trace (dev_w*) of the
work process contains precise error messages that can be used to solve the
relevant problem.

a) ABAP test program

To test the function of the database connection outside of the DBA Cockpit, use
the ABAP program ADBC_TEST_CONNECTION.

Software Components

Software Component Release

ST 400 - 400

SAP_BASIS 700 - 702

SAP_BASIS 710 - 730

SAP_BASIS 731 - 731

Other Components

Component Description

BC-CCM-MON-ORA Database Monitors for Oracle

BC-DB-SDB-CCM CCMS/Database Monitors

BC-DB-DB6-CCM CCMS/Database Monitors

BC-DB-MSS-CCM CCMS/Database Monitors for SQL Server

BC-DB-ORA Oracle

© 2019 SAP SE or an SAP affiliate company. All rights reserved 10 of 12


2019-10-21 1261329

Support Package

Software Component Release Support Package

SAP_BASIS 720 SAPKB72002

This document refers to

SAP Note/KBA Title

819829 Oracle Instant Client Installation and Configuration on Unix or Linux

1738351 Connecting Oracle RAC to Solution Manager 7.1/7.2

1540222 DBA Cockpit: Monitoring non-ABAP/Java Oracle databases

1265134 DBA Cockpit: Connection of a remote database

1256322 Establishing a remote database connection in DBACOCKPIT

1028624 Overview of DBA Cockpit for Oracle

1027146 Database administration and monitoring using the DBA Cockpit

This document is referenced by

SAP Note/KBA Title

2850410 DBSL is missing during remote database connection to Oracle

819829 Oracle Instant Client Installation and Configuration on Unix or Linux

1257308 FAQ: Using EarlyWatch Alert

1738351 Connecting Oracle RAC to Solution Manager 7.1/7.2

1265134 DBA Cockpit: Connection of a remote database

1540222 DBA Cockpit: Monitoring non-ABAP/Java Oracle databases

1028624 Overview of DBA Cockpit for Oracle

1027146 Database administration and monitoring using the DBA Cockpit

© 2019 SAP SE or an SAP affiliate company. All rights reserved 11 of 12


2019-10-21 1261329
1256322 Establishing a remote database connection in DBACOCKPIT

© 2019 SAP SE or an SAP affiliate company. All rights reserved 12 of 12

You might also like