Problem in creating database link [message #230106] |
Tue, 10 April 2007 22:51 |
grk28
Messages: 38 Registered: June 2006
|
Member |
|
|
Hi frnds,
I have a database which has following users:
user1 ,user2
user1 will be refreshed daily.As i need to access tables in user1 from user2 i m trying to create a datbase link in user2 to access the tables in user1 instead of granting objects to user2 from user1.I am getting the following error when trying to create a datbaselink in user2
Link : "LNK_DEL_CKNG"
Error : ORA-12154: TNS:could not resolve the connect identifier specified
I am wondering why this is happening though the users are in same machine.When i am trying to create a db link from a user which is my local it is successful ..
Please let me know what could be the issue.
Immediate help would be appreciated.
Thanks.
|
|
|
Re: Problem in creating database link [message #230108 is a reply to message #230106] |
Tue, 10 April 2007 22:55 |
Mohammad Taj
Messages: 2412 Registered: September 2006 Location: Dubai, UAE
|
Senior Member |
|
|
HI,
What is your service_name/SID ?
create database link db_link_name
connect to <username> identified by <pwd>
using 'SERVICE_NAME';
NOte : service_name is target database service_name /SID.
Sorry too fast .. i didn't read complete question.
@OP>Purpose
Use the CREATE DATABASE LINK statement to create a database link. A database link is a schema object in one database that enables you to access objects on another database.
follow "anacedent" suggestion.
Regards
Taj
[Updated on: Tue, 10 April 2007 23:00] Report message to a moderator
|
|
|
|
|
|
Re: Problem in creating database link [message #230113 is a reply to message #230108] |
Tue, 10 April 2007 23:11 |
grk28
Messages: 38 Registered: June 2006
|
Member |
|
|
Hi ,
Thanks for the immediate response.
Well i am able to create the public database link as follows;
SQL> CREATE PUBLIC DATABASE LINK "lnk_user2_user1" CONNECT TO user1 IDENTIFIED BY "user1" USING 'start';
Database link created.
but when i am tring to access table from user1 from user2
as follows
SQL>select * from @lnk_user2_user1;
ERROR at line 1:
ORA-12154: TNS:could not resolve the connect identifier specified
Any help on this plz.
Thanks in advance
|
|
|
|
Re: Problem in creating database link [message #230141 is a reply to message #230106] |
Wed, 11 April 2007 00:59 |
grk28
Messages: 38 Registered: June 2006
|
Member |
|
|
Hi,
Here is my tnsnames.ora file
START.ORACLE.COM =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = tcp)(HOST = stora01)(PORT = 1521))
(CONNECT DATA =
(SID = START)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
Thanks in Advance
|
|
|
|
Re: Problem in creating database link [message #230148 is a reply to message #230106] |
Wed, 11 April 2007 01:22 |
grk28
Messages: 38 Registered: June 2006
|
Member |
|
|
Hi,
That can be a problem.But when the users are in the same database and when i m trying to create the link the same machine ,the link is getting created bt not working .Am i missing something ?
Thanks
|
|
|
|
|
|
|
|
Re: Problem in creating database link [message #230351 is a reply to message #230106] |
Wed, 11 April 2007 11:30 |
grk28
Messages: 38 Registered: June 2006
|
Member |
|
|
Hi frnds,
I do agree with you Taj,the only concerns i have is if i grant select,update on some objects to the user2 and if the user1 is reloaded will the user2 will be able to still access the objects.I was trying to do that but couldn't.I may be doing it in wrong way..So please give me the right direction.
I am asking you this question because we have a nightly job which will referesh the user1.
Thanks to anacedent,harshad for the replies.
Thanks in advance
|
|
|
|
Re: Problem in creating database link [message #230354 is a reply to message #230351] |
Wed, 11 April 2007 11:39 |
harshad.gohil
Messages: 157 Registered: April 2007 Location: USA
|
Senior Member |
|
|
Hi ,
AFAIK it should be fine, it would not make any issue, I hope reloading user is not changes tables with different name everyday, if it's same then it is perfect. You can grant respective privileges.
Regards,
Harsh
|
|
|
Re: Problem in creating database link [message #231912 is a reply to message #230106] |
Wed, 18 April 2007 17:39 |
grk28
Messages: 38 Registered: June 2006
|
Member |
|
|
Hi ,
Sorry for replying back so lately.
Reloading user doesnt change the tablenames but how about the grants.They will be over written right ?It means that we need to grant them every day the user is reloaded.
moreover a nightly job is scheduled for this import process so it will be difficult to monitor such things right.
Can you give throw some light on this as well.
Thanks in Advance
|
|
|
Re: Problem in creating database link [message #232311 is a reply to message #231912] |
Fri, 20 April 2007 01:58 |
Dipali Vithalani
Messages: 278 Registered: March 2007 Location: India
|
Senior Member |
|
|
hi,
Are you reloading the user at each night?
Why do you need to do so? Just for the 'import' ?
If yes, then why don't you create the special user for that import procedure,if it is so important to you that you need to repeat the process of reloading them daily..
Exactly, what's your problem..?
|
|
|