创建public dblink 。
createpublicdatabaselinktest_link connecttocsservicedbidentifiedbyhuawei123 using'(DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.119)(PORT=1521)) ) (CONNECT_DATA= (SERVICE_NAME=orcl) ) )'; Databaselinkcreated.
sql>desccs_user; ERROR: ORA-04043:objectcs_userdoesnotexist sql>desccs_user@test_link; Name Null?Type ----------------------------------------------------------------------------- PK_BUR_USERID NOTNULLVARCHAR2(18) BUR_USER_FLAG NOTNULLVARCHAR2(32)
select*fromdba_objectswhereobject_type='DATABASELINK'; selectowner,db_linkfromdba_db_links;--查看dblink的owner及link名字
删除dblink 。
sql>DROPPUBLICDATABASELINKcsmain; Databaselinkdropped. sql>DROPPUBLICDATABASELINKcsserver; Databaselinkdropped. sql>
如果语句中不加public,则创建的owner就是现连接的用户 。
sql>createdatabaselinkCSMAIN connecttocsmaindbidentifiedbyhuawei123 using'(DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.119)(PORT=1521)) ) (CONNECT_DATA= (SERVICE_NAME=orcl) ) )'; sql>selectowner,db_linkfromdba_db_links; OWNERDB_LINK --------------------------------------------- CS_AUXCSMAIN CS_AUXCSSERVER原文链接:https://www.f2er.com/oracle/208616.html