创建public dblink 。
create public database link test_link connect to csservicedb identified by huawei123 using ' (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.119)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = orcl) ) )' ; Database link created.
sql> desc cs_user; ERROR: ORA-04043: object cs_user does not exist sql> desc cs_user@test_link; Name Null? Type ----------------------------------------- -------- ---------------------------- PK_BUR_USERID NOT NULL VARCHAR2(18) BUR_USER_FLAG NOT NULL VARCHAR2(32)
select * from dba_objects where object_type='DATABASE LINK'; select owner, db_link from dba_db_links; -- 查看dblink的owner及link名字
删除dblink 。
sql> DROP PUBLIC DATABASE LINK csmain; Database link dropped. sql> DROP PUBLIC DATABASE LINK csserver; Database link dropped. sql>
如果语句中不加public,则创建的owner就是现连接的用户 。
sql> create database link CSMAIN connect to csmaindb identified by huawei123 using ' (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.119)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = orcl) ) )' ; sql> select owner, db_link from dba_db_links; OWNER DB_LINK ------------------------------ --------------- CS_AUX CSMAIN CS_AUX CSSERVER
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。