您好,登录后才能下订单哦!
密码登录
登录注册
点击 登录注册 即表示同意《亿速云用户服务条款》
创建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
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。