Solved

Public dblink working in one user not working for other user of the same DB.

Posted on 2011-09-20
10
654 Views
Last Modified: 2012-05-12
I have a public DB link, which is working in one user and not working in another user,
am getting invalid username/password logon denied.
What could be the reason?
0
Comment
Question by:sakthikumar
  • 2
  • 2
  • 2
  • +3
10 Comments
 
LVL 7

Expert Comment

by:Jacobfw
ID: 36566242
Does the DBLINK contain the credentials to validate on the remote database?

If not, the local user must be validate on both databases, but the second user may not have an account on the second database and/or different crentials between them.
0
 
LVL 5

Accepted Solution

by:
manzoor_dba earned 333 total points
ID: 36566448
Hi Sathikumar,
Pls check the below points:-
  1. Is the User exists in the remote database.
  2. If the user exists then check whether the user is using the same password in both the current   and the remote database, if the password is different between both the db then its not possible.. you need to connect using a connect to using clause..
Thanks..
 

 

0
 
LVL 73

Expert Comment

by:sdstuber
ID: 36566467
does the other user also have a private link of the same name?  If so, the private link will be used instead of the public link
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 36566470
Is there a local dblink for the user that isn't working?

The local one should take precedence over the public one if it exists.

select * from user_db_links;
0
 

Author Comment

by:sakthikumar
ID: 36566866
There is only one dblink, and that is public,
the user which can access is present in the remote DB and having the same pwd.
the user which cannot access is not present in the remote DB.

Now, what is the solution?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 7

Expert Comment

by:Jacobfw
ID: 36566912
The solution depends on your application and the purpose of the DBLINK.
If you wish both local users to access the same schema on the remote database, you will need to include the credentials in the DBLINK or query to logon credentials.
If you want them to access different schemas, you will need to create a second user on the remote database to match the second user on the local database.
0
 
LVL 5

Assisted Solution

by:manzoor_dba
manzoor_dba earned 333 total points
ID: 36567992
Hi Sakthikumar,

As you said , if you want to use the current dblink you need to create a user with same password in the remote database and then you can grant the privileges to the user on the remote db.

Eg.

You have schema A and schea B in local db, where A is able to access db link and B is not able to access then create the schema b in the Remote db and grant privileges of other schema (here A)  to the Schema B then you can query as below

select * from A.tablename@dblink

0
 
LVL 15

Expert Comment

by:Devinder Singh Virdi
ID: 36568118
>>There is only one dblink, and that is public,
>>the user which can access is present in the remote DB and having the same pwd.
>>the user which cannot access is not present in the remote DB.

Is this correct:-
1. Database DB1 has public dblink say DB_LINK, pointing to database DB2 for user USER_1.
2. Database DB1 has two users say USER_1, USER_2
3. USER_1 can access DB_LINK and is not getting any error.
4. USER_2 is getting an error?

Also check
select object_name, object_type from all_objects where object_name in ('YOUR_TABLE', 'DB_LINK_NAME');
0
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 167 total points
ID: 36568176
I believe the issue here is there wasn't a username or password provided when the link was created:

create public database link mylink using 'remotedb';

This will try to connect to the remote database as the username currently logged in.

Since that user doesn't exists in the remote database you get the error.

The solution is either create the user in the remote databsae or identify the username to connect with when you created the link:


create public database link mylink connect to username identified by password using 'remotedb';
0
 

Author Closing Comment

by:sakthikumar
ID: 36571349
I really like the response, Thanks, problem resolved.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
oracle query help 36 66
Oracle 12c patching 1 32
Error executing command from server 6 26
Oracle Next Available Number 2 15
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now