Wednesday, January 18, 2012

Creating a Database Link in Oracle

CREATE DATABASE LINK "TESTLINK"
   CONNECT TO "schema_name" IDENTIFIED BY VALUES 'schema_password'
   USING '(DESCRIPTION =
       (ADDRESS_LIST =
         (ADDRESS = (PROTOCOL = TCP)(HOST = 101.102.103.104)(PORT = 1521))
       )
       (CONNECT_DATA =
         (SID = XE)
       )
     )';
 
1) Replace the schema_name, schema_password, Host and port with your setup.
 
2) Login to your schema, and run the query above.
  
Test it by querying "Select * from dual@TESTLINK".

No comments:

Post a Comment