刪除數(shù)據(jù)庫(kù)鏈接:drop database link linkname;
創(chuàng)建數(shù)據(jù)庫(kù)鏈接:
create database link linkname
connect to username
identified by password
using 'connection string';
如果想建立全局鏈接,則需要使用關(guān)鍵字:public-
create public database link linkname
connect to username
identified by password
using 'connection string';
connection string可以有兩種形式:
1,在文件tnsnames.ora配置的名稱:
如:
CDRDL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.147.129.29)(PORT = 2521))
)
(CONNECT_DATA =
(SERVICE_NAME = cdrdb)
)
)
此時(shí)可以寫(xiě)成:
create database link linkname
connect to username
identified by password
using 'CDRDL';
2,也可以直接使用‘=’號(hào)后面的字符串,
如:
create database link linkname
connect to username
identified by password
using '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.147.129.29)(PORT=2521)))(CONNECT_DATA=(SERVICE_NAME=cdrdb)))';
本文出自:億恩科技【1tcdy.com】
服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|