实现两个数据库的操作dblink

创建一个dblink
     create database link [LINKNAME] connect to [USERNAME(没有引号)]
          identified by [PASSWORD(没有引号)] using 
          'TNS'

     sample:
     create database link linkexam connect to APPS
          identified by APPS_DEV using
          '(DESCRIPTION = (ADDRESS = ( PROTOCOL = TCP) (HOST = 114.251.247.78)(PROT = 11101))
          (CONNECT_DATA = (SID = DEV)))'
     删除一个dblink
     drop database link [LINKNAME]
     sample:
     drop database link linkexam
     使用一个dblink
          select * from [TABLENAME]@[LINKNAME]
          sample:
          select * from hr_user@linkexam
     查看所有dblink
          select * from all_db_links

你可能感兴趣的:(数据库,tcp,user,database)