How to connect to other databases from SAP

Source: Internet
Author: User
1. Work Environment requirements A. environment. B. TheR3tableDBCONmustbemaintained. C. Thecorrectdatabaselibrarydboraslib. extmustexistinthekerneldirectory. Connectt

1. work environment requirements. the operating system user sidadm must be able to log on to the secondary database. b. the R/3 table DBCON must be maintained. c. the correct database library 'dboraslib. ext 'must exist in the kernel directory. connectt

1. Work Environment requirements

A. The operating system user Adm must be able to log on to the secondary database.

B. The R/3 table DBCON must be maintained.

C. The correct database library 'dboraslib. 'Must exist in the kernel directory.
Connect to SQL Server database Prerequisite: At least one Windows application server must be available on the R/3 system and the DBSL dynamic library (DLL) dbmssslib. dll must be installed on this server. this dll can be downloaded from the SAP Service Marketplace.

Dbmssslib. dll

2. Configure connection information

Configure TCODE: dbco

Any configuration information is stored in the DBCON table.

Configuration example:

A. Configuration example for accessing MSSQL (see SAP Notes 178949)

CON_NAME:
DBMS: MSS
USER_NAME:
PASSWORD:
CON_ENV: MSSQL_SERVER = MSSQL_DBNAME =

Db_user cocould be sapr3 for example if the server is running R/3. the password field may be blocked from view by asterisks in sm30. USER_NAME can be left blank in order to use integrated security (4.6d kernel and later ). in that case make sure that the OS User running R/3 has the required privilege on the remote server. A dummy password must be entered in sm30, it will not be used when the user name is blank.

  • Specifying the server name

The server name is simply the name of the SQL Server or named instance I. e. the hostname (for a default instance), or /
Starting with release 6.40 however there are some special considerations that shoshould be taken into account. when running with kernel release 6.40 or later, the R/3 system will prepend a protocol specifier to the server name. example:
1. For a server running on the same server:
Np:
2. For a remote server:
Tcp:
This forces the connection to be made with a named pipes and TCP/IP protocols respectively.
When specifying the server name you can override this by setting your own protocol (tcp: or np :), or you can make R/3 avoid setting any prefix by using simply: -A colon in front of the server name.

B. Configuration example for accessing ORACLE ()

Connection name logical name of the connection

DBMS ORA

User name Oracle users

DB password for the above-mentioned Oracle user

Conn.info TNS alias

Permanent Usually shocould not be set for a secondary connection.

3. How to Use

Routine 1
Report zdbcon.
Data: dbn (128 ).
Exec SQL.
Connect to 'dan1'
ENDEXEC.
Exec SQL.
Set connection 'dan1'
ENDEXEC.
Exec SQL.
SELECT db_name () INTO: DBN FROM SVERS
ENDEXEC.
Write:/'current database name', dbn.
Configure DAN1 in the dbcon table
Con name DAN1
DBMS MSS
User name iis_log
PASSWORD CON ENV
MSSQL_SERVER = tcp: ############### MSSQL_DBNAME = iislog


Example 2
Here is an example for how to connect to another server with CON_NAME = BSK. The example assumes BSK is running R/3:

Exec SQL.
Connect to 'bsk'
ENDEXEC.
Exec SQL.
Set connection 'bsk'
ENDEXEC.
Exec SQL.
SELECT db_name () INTO: DBN FROM SVERS
ENDEXEC.
WRITE:/'current database name', DBN.
Exec SQL.
SET CONNECTION DEFAULT
ENDEXEC.
Exec SQL.
SELECT db_name () INTO: DBN FROM SVERS
ENDEXEC.
WRITE:/'current database name', DBN.

Notes:Https://websmp130.sap-ag.de/sap (bD1lbiZjPTAwMQ =)/bc/bsp/SPNs/sapnotes/index2.htm? Numm = 178949 & nlang = EN & smpsrv = https % 3a % 2f % 2fwebsmp103% 2esap-ag % 2ede

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.