Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Please Help (Grovel, Grovel) about linknames
David Steele wrote:
>
> Hello all those out there in computer world
>
> I only have only a small query, but I would be eternally grateful if one
> of you extremely kind people could clarify a term
>
> When creating a DATABASE LINK using
>
> CREATE PUBLIC DATABASE LINK linkname
>
> How is the linkname made up so I can connect to my remote database
Assuming you're in a TCP/IP environment....
CREATE PUBLIC DATABASE LINK "theSID.myComp.com" CONNECT TO myUserName IDENTIFIED BY myPasswd USING 'T:100.20.1.10:theSID';
This would create a public dblink to the database whose SID is "theSID" which resides on the machine at IP address 100.20.1.10. The user via whom the connection will be made is "myUserName". Note that the name of the dblink has to be in the form of the SID and the domain name (with some exceptions).
If you don't name the link right, Oracle returns an error and will not create the link. Then, when querying across the link....
SELECT count(*)
FROM myTable_at_theSID.myComp.com;