Many times we need to interact with different databases at same time. I assume many of you, like me has faced this situation. There is an easy way to do so. DB Links are really useful. I mostly use them while data comparison and validation, but they can be used for much more. Here is a way you can easily create and use a DB Link.
CREATE DATABASE LINK "Link_Name"
CONNECT TO Schema Name
IDENTIFIED BY Password
USING 'DB Alias';
CONNECT TO Schema Name
IDENTIFIED BY Password
USING 'DB Alias';
This code will create the DB Link and then you can use it in following manner:
Select * from TableName@Link_Name
You can execute this script in other database connections.
No comments:
Post a Comment