PLSQL连接其它数据库的方法 dblink

2010-03-15  王丽 

CREATE PUBLIC DATABASE LINK sxst03(连接名称) CONNECT TO sxdznydfd(用户名) IDENTIFIED BY sxdznydfd (密码)USING
        '(DESCRIPTION =
            (ADDRESS_LIST =
              (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.3(数据库所在机子的名称或IP))(PORT = 1521))
            )
            (CONNECT_DATA =
        (SERVICE_NAME = sxst(要连接数据库的SID))
            )
          )'
      下面是查询时的写法,在表名后增加 @sxst03  (@加上上面建立的连接名称)
          
          select * from  sde.Table_Registry@sxst03 where table_name='N2007E2003140411000B00XJLYD'
475°/4752 人阅读/0 条评论 发表评论

登录 后发表评论