標籤:oracle admin option
許可權的分配:
1、grant用於將角色、系統許可權、對象許可權賦予使用者、角色。
2、賦權的前提條件:
系統許可權:有"grant any privilege"的系統許可權、被授予該系統許可權時使用了 "admin option"
角色許可權:1)授予角色角色許可權時帶有"admin option";2)被授予了"grant any role"的系統許可權;3)是角色的建立者。
對象許可權:1)是對象的擁有者;2)被授予對象許可權時帶有"grant option";3)被授予了"grant any object privilege"許可權;
3、文法:
grant [grant_system_privileges|grant_object_privileges];
grant_system_privileges:
{ system_privilege| role| ALL PRIVILEGES}
[, { system_privilege| role| ALL PRIVILEGES}]...
TO grantee_clause [ WITH ADMIN OPTION ];
grantee_clause:
{ user [ IDENTIFIED BY password ]| role| PUBLIC}
[, { user [ IDENTIFIED BY password ]| role| PUBLIC}]...
grant_object_privileges:
{ object_privilege | ALL [ PRIVILEGES ] }
[ (column [, column ]...) ]
[, { object_privilege | ALL [ PRIVILEGES ] }[ (column [, column ]...) ]]...
on_object_clause TO grantee_clause [ WITH HIERARCHY OPTION ][ WITH GRANT OPTION ]
on_object_clause:
ON { [ schema. ] object
| DIRECTORY directory_name
| EDITION edition_name
| MINING MODEL [schema.] mining_model_name
| JAVA { SOURCE | RESOURCE } [ schema. ] object
}
要記住"grant 許可權 to 使用者".
---------------------------------------------------------------------------------------
許可權的回收:
1、文法
REVOKE { revoke_system_privileges| revoke_object_privileges} ;
revoke_system_privileges:
{ system_privilege| role| ALL PRIVILEGES}
[, { system_privilege
| role
| ALL PRIVILEGES
}
]...
FROM grantee_clause
revoke_object_privileges:
{ object_privilege | ALL [ PRIVILEGES ] }
[, { object_privilege | ALL [ PRIVILEGES ] } ]...
on_object_clause
FROM grantee_clause
[ CASCADE CONSTRAINTS | FORCE ]
grantee_clause:
{ user [ IDENTIFIED BY password ]
| role
| PUBLIC
}
[, { user [ IDENTIFIED BY password ]
| role
| PUBLIC
}
]...
on_object_clause:
ON { [ schema. ] object
| DIRECTORY directory_name
| EDITION edition_name
| MINING MODEL [schema.] mining_model_name
| JAVA { SOURCE | RESOURCE } [ schema. ] object
}
記住"revoke 許可權 from 使用者"
-------------------------------------------------------------------------------
系統許可權不能級聯回收,對象許可權可以級聯回收。
-------------------------------------------------------------------------------------
本文出自 “三國冷笑話” 部落格,請務必保留此出處http://myhwj.blog.51cto.com/9763975/1888225
oracle許可權的分配與回收