Oracle 同义词的创建

前端之家收集整理的这篇文章主要介绍了Oracle 同义词的创建前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。



创建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

猜你在找的Oracle相关文章