您好,登錄后才能下訂單哦!
創建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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。