Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle database link

I'm currently using Windows Authentication with 2 Oracle servers - SP3DSMP1 & SP3DSMP4. I created a database link on SMP1 to connect to SMP4 as:

SQL> create public database link LINK_SMP4 2 connect to CURRENT_USER 3 using 'SP3DSMP4';

Database link created.

However when I try to do a query, I get the error:

ERROR at line 1: ORA-01017: invalid username/password; logon denied

Any ideas what might be wrong here?

like image 569
Sunit Avatar asked Dec 27 '10 22:12

Sunit


People also ask

What is a database link in Oracle?

A database link is a pointer that defines a one-way communication path from an Oracle Database server to another database server. The link pointer is actually defined as an entry in a data dictionary table. To access the link, you must be connected to the local database that contains the data dictionary entry.

How do I find Oracle Database link?

Any user can query USER_DB_LINKS to determine which database links are available to that user. Only those with additional privileges can use the ALL_DB_LINKS or DBA_DB_LINKS view.

How do I create a shared database link in Oracle?

To create a shared database link, use the keyword SHARED in the CREATE DATABASE LINK statement: CREATE SHARED DATABASE LINK dblink_name [CONNECT TO username IDENTIFIED BY password]|[CONNECT TO CURRENT_USER] AUTHENTICATED BY schema_name IDENTIFIED BY password [USING 'service_name'];


1 Answers

Credentials are not passed over the dblink connection.

When creating a CURRENT_USER dblink, a trust should be established between the databases. This requires setting up an enterprise domain, adding the databases to it, setting an SSL link between the databases and making the link CURRENT_USER enabled.

See here: http://download.oracle.com/docs/cd/B12037_01/network.101/b10772/asoeuscf.htm

like image 113
Quassnoi Avatar answered Oct 08 '22 07:10

Quassnoi