日期:2014-05-16  浏览次数:20562 次

常用笔记--Oracle--dblink

?

贵州IMS实例:

企业门户用户

服务器:10.229.9.8

oracle实例:ODSAPP

用户名:ENTERPRISE_PORTAL

密码:gzdxep123

select * from odsoutput.i_out_area_info

?

测试连接:

sqlplus ENTERPRISE_PORTAL/gzdxep123@10.229.9.8:1521/ODSAPP

?

?

创建:

create public? database link? odslink connect? to ENTERPRISE_PORTAL identified by gzdxep123? using

'(DESCRIPTION =

??? (ADDRESS_LIST =

????? (ADDRESS = (PROTOCOL = TCP)(HOST = 10.229.9.8)(PORT = 1521))

??? )

??? (CONNECT_DATA =

????? (SERVICE_NAME = ODSAPP)

??? )

)'

?

删除

drop public database link ODSLINK;

?

查询:

select * from odsoutput.i_out_area_info@odslink

?

设置link用户中的表的权限为只读

create or replace view ims_vt_ods_system as

select s.system_code as SysId,