Wednesday, April 28, 2010

DataBase Links

A database link is a pointer in the local database that allows you to access the data on a remote database.
For example: If we want to access the database of a different server other than the one we are working on. we cannot access that database directly if we don’t have access.In such cases we use Database links to access the remote database.
There is no special syntax fort using these Dblinks.we should just add that link after the table name as shown below.

Select * from emp where emp_id=’1111111’;

This is the actual query.using this query we should access the remote database to which we don’t have access.In this case you can access that remote database if it has a DBlink available to connect to our database.

For Example if GOAT is the Dblink used to access the database of Goat,then the above query should be given in this way

Select * from emp@GOAT where emp_id=’1111111’

In this way by using DBlinks we can access remote databases.

No comments:

Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory