- --创建一个链接到其他数据库的链接
- --USING 'BitOrcl' 中的 BitOrcl 为 tnsnames.ora 中配置
-
- CREATE SHARED PUBLIC DATABASE LINK BitOrcl
- AUTHENTICATED BY SYS IDENTIFIED BY his
- USING 'BitOrcl' ;
-
- --使用方法,在表格后面加上需要链接数据库的DBLink名:
-
- SELECT * FROM 人员表@BitOral ;
-
- --删除DBLink
- DROP PUBLIC DATABASE LINK BitOral ;
-
- --创建一个连接到电子病历服务器的链接
- CREATE SHARED PUBLIC DATABASE LINK EmrOrcl
- AUTHENTICATED BY SYS IDENTIFIED BY his
- USING '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.71.103)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = emrorcl)))' ;
-
- --删除DBLink
- DROP PUBLIC DATABASE LINK EmrOrcl ;
-
- --创建一个连接到测试服务器的链接
- CREATE PUBLIC DATABASE LINK BitTest
- CONNECT TO SYS IDENTIFIED BY his
- USING '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.71.115)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = orcl)))' ;
-
- CREATE PUBLIC DATABASE LINK Hisinterface
- CONNECT TO ZLHIS IDENTIFIED BY HIS
- USING '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.168.110)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = orcl)))' ;
-
- --删除DBLink
- DROP PUBLIC DATABASE LINK BitTest ;
--创建一个简易的dblink
create public database link HisInterface connect to zlhis identified by his using '192.168.168.110:1521/orcl';
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28878983/viewspace-2133926/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/28878983/viewspace-2133926/