Oracle同义词的创建
创建public dblink 。
成都创新互联公司是一家专业的成都网站建设公司,我们专注成都网站设计、成都网站建设、网络营销、企业网站建设,友情链接,1元广告为企业客户提供一站式建站解决方案,能带给客户新的互联网理念。从网站结构的规划UI设计到用户体验提高,创新互联力求做到尽善尽美。
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
网页标题:Oracle同义词的创建
文章链接:http://scyanting.com/article/pioiss.html