|
|
我想給某用戶只授予SELECT權限,不知應該授予他什麼權限?
|
|
我想給某用戶只授予SELECT權限,不允許DELETE或INSERT,應該授予他什麼權限?
|
|
|
Re: 我想給某用戶只授予SELECT權限,不知應該授予他什麼權限?
|
|
you can grant connect priviledge to user , then grant select on *** to user .
if there is many user, you can grant select to a role
then grant a role to a user.
|
|
|
Re: 我想給某用戶只授予SELECT權限,不知應該授予他什麼權限?
|
|
CONNECT role中有CREATE SESSION權限,我對某用戶授予CREATE SESSION權限後,該用戶能DELETE FROM TABLE,我不想這樣,可是不知道原因。
|
|
|
Re: 我想給某用戶只授予SELECT權限,不知應該授予他什麼權限?
|
|
不能的。
SQL> select * from dba_sys_privs where grantee='CONNECT';
GRANTEE PRIVILEGE
------------------------------------------------------------ --------------------------------
CONNECT ALTER SESSION
CONNECT CREATE CLUSTER
CONNECT CREATE DATABASE LINK
CONNECT CREATE SEQUENCE
CONNECT CREATE SESSION
CONNECT CREATE SYNONYM
CONNECT CREATE TABLE
CONNECT CREATE VIEW
這個用戶有個connect role之後,只能有再自己的schema裡邊操作的權限,不能操作別人的表。
除非這張表在它自己的模式裡邊。你新建一個用戶,然後吧你的 步驟貼出來。
-----------------------
vivian,雨聲......
|
|
|
Re: 我想給某用戶只授予SELECT權限,不知應該授予他什麼權限?
|
|
如果TEST用戶有CREATE SESSION權限,那他就能對自己所建對像具有所有操作權限,對吧?
那我新建另一個用戶TEST2,應授予TEST2什麼權限才能對TEST SCHEMA僅具有SELECT權限?
|
|
|
Re: 我想給某用戶只授予SELECT權限,不知應該授予他什麼權限?
|
|
user with CREATE SESSION privilege can only connect to database, he can't create any objects.
so if you want user TEST1 can only SELECT TEST's table, then
as DBA: create user TEST1 identified by TEST1;
grant create session to TEST1;
as TEST: grant select on table_name to TEST;
|
|
|
Re: 我想給某用戶只授予SELECT權限,不知應該授予他什麼權限?
|
|
可是我想讓TEST1能夠SELECT TEST用戶是所有表?
|
|
|
Re: 我想給某用戶只授予SELECT權限,不知應該授予他什麼權限?
|
|
這個好像沒有更好的辦法了。
一個人有兩個我,一個在黑暗中醒著,一個
在光明中睡著。
|
|
|
Re: 我想給某用戶只授予SELECT權限,不知應該授予他什麼權限?
|
|
SQL>show user;
USER IS "SYS"
SQL>GRANT SELECT ANY TABLE TO TEST1;
你想看什麼表都行.
----------
天下傷心處,勞勞送客亭。
春風知別苦,不遣柳條青。
|
|
|
Re: 我想給某用戶只授予SELECT權限,不知應該授予他什麼權限?
|
|
TEST has to grant SELECT ON table1 to TEST1; then on table2 to TEST1, then ...
there is no simple way to do it like GRANT SELECT all tables on TEST1.
|
|
|
Re: 我想給某用戶只授予SELECT權限,不知應該授予他什麼權限?
|
|
我已經解決了問題。謝謝大家!在此貼出解決過程,請指教!
1.在TEST用戶下
spool c:\gg.txt
select 'grant select on '||tname||' to test1;' from tab;
spool over
spool c:\cc.txt
select 'create synonym '||tname||' for test.'||tname||';' from tab;
spool over
2.在TEST用戶下
@ c:\gg.txt
3.在TEST1用戶下
@ c:\cc.txt
|
|
|
Re: 我想給某用戶只授予SELECT權限,不知應該授予他什麼權限?
|
|
我已經解決了問題。謝謝大家!在此貼出解決過程,請指教!
1.在SYSTEM用戶下
create user test1 identified by ***;
grant create session to test1;
grant create synonym to test1;
2.在TEST用戶下
spool c:\gg.txt
select 'grant select on '||tname||' to test1;' from tab;
spool over
spool c:\cc.txt
select 'create synonym '||tname||' for test.'||tname||';' from tab;
spool over
3.在TEST用戶下
@ c:\gg.txt
4.在TEST1用戶下
@ c:\cc.txt
|
|
|
Re: 我想給某用戶只授予SELECT權限,不知應該授予他什麼權限?
|
|
差不多了, 但有點不穩妥:
select 'grant select on '||tname||' to test1;' from tab where
tabtype='TABLE';
select 'create synonym '||tname||' for test.'||tname||';' from tab
where tabtype='TABLE';
----------
天下傷心處,勞勞送客亭。
春風知別苦,不遣柳條青。
|
|
|
Re: 我想給某用戶只授予SELECT權限,不知應該授予他什麼權限?
|
|
這麼仔細,大俠,I 服了YOU !
|