您好,登錄后才能下訂單哦!
權限的分配:
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 用戶"
-------------------------------------------------------------------------------
系統權限不能級聯回收,對象權限可以級聯回收。
-------------------------------------------------------------------------------------
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。