Simple question on DB LINKS
I created a db link like this.
create public database link my_link connect to home_office identified by home using 'j2ee';
Link is created successfully. and i was able to connect to the database. Now when i remove my tnsnames entry for that DB on my work station, the Link doesn't work.
So my question is
1) do we need to have tnsnames entry to the database for which i created the link ?. is so, then what is the point in creating a link, i can as well type
i just dont understand this thing. can anyone shed some light on where iam getting it wrong. really appreciate it.
Not unless the host database is on your machine.
Only the machine hosting the database with a db_link needs connection information to the target database.
What Ken said is right.
If you don't want to use tnsnames.ora file then you can create the dblink as follows
Create public database link my_link
connect to 'paste the entire tnsnames entry here in quotes'
This will not use the tnsnames.ora file.
DB Links enable one database to get/process data on another database. They are not intended to replace database connections.
You would use them such as Select * from emp@home
simplifying sharing information.
Joseph R.P. Maloney, CSP,CDP,CCP
'The answer is 42'
I completely agree with Joseph.
A database link is a great way to combine data from different hardware and memory structures that wouldn't normally live together. A single database connection can bring back data from a number of databases, even a SQL Server database (via a gateway).
Joins across a db_link will not perform well if the joining tables have many rows so I use them sparingly. And then there's the overhead of making the connection to consider also.
Click Here to Expand Forum to Full Width