說明:一下是未配置本地服務的dblink。數據庫
前提: 受權> grant create public database link,create database link to myAccount; ide
1.建立dblink配置
SQL> create database link demob connect to dblink identified by dblink using '(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 10.100.25.14)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orcl)))';object
Database link created.select
參數說明> 密碼
demob --link_name數據
dblink -- 遠程數據庫的用戶帳號與密碼demo
(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 10.100.25.14)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orcl))) -- 遠程數據庫的tnsnames.oradb
------------------------------------------------------------------------------------------------------------------------------tab
2.使用dblink
SQL> select * from dblink.dblink@demob;
ID
----------
1
2
參數說明
@demob --dblink_name
___________________________________________________________________________________________________
3.查看dblink
select owner,object_name from dba_objects where object_type='DATABASE LINK';
或者
select * from dba_db_links;
—————————————————————————————————————————————————————————————————
4.刪除db_link
DROP PUBLIC DATABASE LINK linkfwq; 或者 DROP DATABASE LINK linkfwq