grant create database link to esspa;
CREATE [SHARED] [PUBLIC] DATABASE LINK <link_name>
CONNECT TO CURRENT_USER
USING '<service_name>';
CREATE [PUBLIC] DATABASE LINK <link_name>
CONNECT TO <user_name>
IDENTIFIED BY <password>
USING '<service_name>';
CREATE SHARED DATABASE LINK shared
CONNECT TO scott IDENTIFIED BY tiger
AUTHENTICATED BY uwclass IDENTIFIED BY uwclass
USING 'conn_link';
CREATE PUBLIC DATABASE LINK publink
USING 'conn_link';
CREATE [ SHARED ] [ PUBLIC ] DATABASE LINK dblink
[ CONNECT TO
{ CURRENT_USER
| USER IDENTIFIED BY password
[ dblink_authentication ]
}
| dblink_authentication
]
[ USING 'connect_string' ] ;
conn_link =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = my_host_name)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = name_of_database)
)
)
SELECT * FROM user_db_links;
SELECT db_link, username, password, host, created
FROM user_db_links;
SELECT * FROM all_db_links;
select * from user_db_links
select * from all_db_links