權(quán)限的分配:
創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供金溪網(wǎng)站建設(shè)、金溪做網(wǎng)站、金溪網(wǎng)站設(shè)計(jì)、金溪網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)與制作、金溪企業(yè)網(wǎng)站模板建站服務(wù),10余年金溪做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。
1、grant用于將角色、系統(tǒng)權(quán)限、對(duì)象權(quán)限賦予用戶、角色。
2、賦權(quán)的前提條件:
系統(tǒng)權(quán)限:有"grant any privilege"的系統(tǒng)權(quán)限、被授予該系統(tǒng)權(quán)限時(shí)使用了 "admin option"
角色權(quán)限:1)授予角色角色權(quán)限時(shí)帶有"admin option";2)被授予了"grant any role"的系統(tǒng)權(quán)限;3)是角色的創(chuàng)建者。
對(duì)象權(quán)限:1)是對(duì)象的擁有者;2)被授予對(duì)象權(quán)限時(shí)帶有"grant option";3)被授予了"grant any object privilege"權(quán)限;
3、語(yǔ)法:
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 權(quán)限 to 用戶".
---------------------------------------------------------------------------------------
權(quán)限的回收:
1、語(yǔ)法
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 權(quán)限 from 用戶"
-------------------------------------------------------------------------------
系統(tǒng)權(quán)限不能級(jí)聯(lián)回收,對(duì)象權(quán)限可以級(jí)聯(lián)回收。
-------------------------------------------------------------------------------------