国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
通過對象權(quán)限和dblink給用戶授權(quán) ? 半瓶

通過對象權(quán)限和dblink給用戶授權(quán)

有時候外包工程師需要查詢一些表,而生產(chǎn)環(huán)境數(shù)據(jù)庫可能是他們沒法直接訪問的,這時候可以用dblink加對象權(quán)限的辦法來實現(xiàn)。結(jié)合同義詞還能簡化查詢操作。

首先在生產(chǎn)環(huán)境建立新的外包用戶,并把要查詢的表的select權(quán)限賦給該用戶:

ERPDB1@/home/oracle>sqlplus " / as sysdba"

SQL*Plus: Release 10.2.0.3.0 - Production on Mon Nov 2 09:25:43 2009

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bitProduction
With the Partitioning, Real Application Clusters, OLAP and Data Miningoptions

SQL> create user waibao identified by queryonly default tablespaceERP temporary tablespace TEMP2 profile DEFAULT;

User created.

SQL>
SQL> grant connect to waibao;

Grant succeeded.

SQL> grant select on erpuser.overdue to waibao;

Grant succeeded.

然后在外包工程師的開發(fā)環(huán)境建立dblink:

[oracle@erpdevdb ~]$ export ORACLE_SID=devdb
[oracle@erpdevdb ~]$ sqlplus "erpuser/banping"

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Nov 2 09:33:45 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bitProduction
With the Partitioning, OLAP and Data Mining options

SQL>

create public database link db100 connect to waibao identified byqueryonly using'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.0.1)(PORT=1521))(CONNECT_DATA=(SID=ERPDB1)))';

此時可以通過dblink查詢,而不能進(jìn)行DML操作:

SQL> select count(*) from erpuser.overdue@db100;

COUNT(*)
----------
75930

建立別名,簡化訪問方式:

SQL> create synonym overdue100 forerpuser.overdue@db100;

Synonym created.

SQL> select count(*) from overdue100;

COUNT(*)
----------
75930

Oracle文檔里說dblink和對象權(quán)限沒關(guān)系,不過我看這里卻是可以的:

Some schema objects, such as clusters, indexes, triggers,and database links, do not have associated object privileges. Their useis controlled with system privileges. For example, to alter a cluster, auser must own the cluster or have the ALTER ANY CLUSTER systemprivilege.

鏈接如下:

http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/authoriz.htm#DBSEG124

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
創(chuàng)建與oracle 9i的數(shù)據(jù)庫鏈接
打開關(guān)閉ORACLE
oracle新手入門指導(dǎo)之八—數(shù)據(jù)庫遠(yuǎn)程訪問小知識[天源迪科論壇]
分布式數(shù)據(jù)庫組件——Database Link
Oracle不同數(shù)據(jù)庫訪問DBLink
oracle通過透明網(wǎng)關(guān),創(chuàng)建dblink,訪問ms sql server和其他數(shù)據(jù)庫 -...
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服