Solved

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

Posted on 2011-09-20
10
707 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 74

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 77

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
 
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 77

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Create file system directory from Oracle 10g 4 46
Need SQL Query to Find Foreign-keys Without Indexed Columns 4 41
Password_rules_securitty.. 12 46
Oracle Date add 9 34
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…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

751 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