CREATE DATABASELINK

A database link (DBlink) is a definition of how to establish a connection from one Oracle database to another.
The following link types are supported:
  • Private database link - belongs to a specific schema of a database. Only the owner of a private database link can use it.
  • Public database link - all users in the database can use it.
  • Global database link - defined in an OID or Oracle Names Server. Anyone on the network can use it. 
  •  
  • SQL> CONNECT test/test
    Connected.
    TEST> CREATE DATABASE LINK VINAY@ROHINI CONNECT TO test IDENTIFIED BY test USING 'mika';
    
    Database link created.
    
    TEST> CONNECT michel/michel
    Connected. 
    MICHEL> ALTER USER test GRANT CONNECT THROUGH michel ;
    
    User altered.
    
    MICHEL> -- Connect to TEST through MICHEL account and so with MICHEL's password
    MICHEL> CONNECT michel[test]/michel
    Connected.
    TEST> SHOW USER
    USER is "TEST" 
    TEST> DROP DATABASE LINK mika@loop;
    
    Database link dropped.
    
    TEST> CONNECT michel/michel
    Connected. 
    MICHEL> ALTER USER test REVOKE CONNECT THROUGH michel ;
    
    User altered.
     
Tags

Post a Comment

1 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.