Thursday, April 19, 2012

Can't create Database Link to remote DB in Oracle-DB

We have a CRM system in our company, which uses an Oracle 11g database. It is developed by a third party vendor.



We do not have access to the server which runs the CRM system. But nevertheless, we have working DBA login data available to us (SYS user). It consists of:




  • server IP: 172.1.2.3

  • port: 1521

  • SID: abc

  • user: sys

  • password: *



We can use this to access the DB with Oracle SQL Developer 3.1 (Connections >> Properties)



Now parts of the data must be copied out of the CRM-database into an other Oracle database, which resides on another server.



To my understanding, I'd need to create a database link in my target database. I tried something like this:



CREATE PUBLIC DATABASE LINK xxx CONNECT TO sys IDENTIFIED BY ***** USING 'MYTNSENTRY'


My tnsnames.ora is as follows:



MYTNSENTRY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.1.2.3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = abc)
)
)


.... and my listener.ora look like this:



MYLISTENER=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=172.1.2.3)(PORT=1521))
))
SID_LIST_MYLISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=MYTNSENTRY)
(ORACLE_HOME=C:\somepath) # path to Oracle home of target DB
(PROGRAM=extproc)))


Is PROGRAM=extproc the right choice? There are a couple of other programs to pick. I couldn't even start the listener with lsnrctl because it could not "verify the user" or something. Ironically, the listener-setup and database link to a MS SQL server work smoothly.



Now despite lacking some vital information about the CRM DB system, one can still connect to the DB in SQL Developer. Shouldn't it also be possible to make a connection between two Oracle DBs? Please help me with the setup and the creation of the database link.





No comments:

Post a Comment