[BASIS] – Create DB Link from SAP to External Oracle Database

25 08 2011

BASIS STEPS

Insert TNSNames Alias into file TNSNames.ora under Oracle Directory (C:\oracle\<SID>\102\network\admin\ tnsnames.ora)

CE7.WORLD =

(DESCRIPTION =

(ADDRESS =

(COMMUNITY = TCP.WORLD)

(PROTOCOL = TCP)

(HOST = sykapsrv12.replynet.prv)

(PORT = 1527)

)

(CONNECT_DATA =

(SID = CE7)

(GLOBAL_NAME = CE7.WORLD)

)

)

Insert the same TNSNames Alias into file TNSNames.ora under Sap Profile Directory (C:\usr\sap\<SID>\SYS\profile\oracle\tnsnames.ora )

ADMINISTRATION STEPS

DBACOCKPIT Transaction -> DB Connections Tab -> Add

SAMPLE CODE FOR CONNECTION TO EXTERNAL DB

DATA: lv_dbs_connection      TYPE dbcon-con_name VALUE 'BDXXX',
lv_current_connection  TYPE dbcon-con_name.

DATA dbtype TYPE dbcon_dbms.

SELECT SINGLE dbms
FROM dbcon
INTO dbtype
WHERE con_name = lv_dbs_connection.

IF dbtype = 'ORA'.
TRY.

EXEC SQL.
CONNECT TO :lv_dbs_connection
ENDEXEC.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE cx_sy_native_sql_error.
ENDIF.
EXEC SQL.
SET CONNECTION :lv_dbs_connection
ENDEXEC.

EXEC SQL.
DISCONNECT :lv_current_connection
ENDEXEC.
ENDTRY.
ENDIF.

Annunci

Azioni

Information

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...




%d blogger hanno fatto clic su Mi Piace per questo: