sys(管理員)身份登錄,創建用戶名zsta_new
create user zsta_new
identified by 密碼
default tablespace ZSTA_DATA_TBS
temporary tablespace TEMP
profile DEFAULT;
給zsta_new用戶授權(允許創建存儲過程等):
grant connect to zsta_new;
grant resource to zsta_new;
grant create any procedure to zsta_new;
grant create any view to zsta_new;
grant unlimited tablespace to zsta_new;
grant create database link to zsta_new;
grant debug any procedure, debug connect session to zsta_new;
假設zsta_new用戶創建了一個存儲過程up_xx_gzmx ,並允許smxxpt用戶調用
那麼以zsta_new用戶登錄,執行以下語句:
grant execute on up_xx_gzmx to smxxpt
參考:
衆所周知,grant是給別的用戶賦權限。他不只能夠給表,視圖賦權限,而且對存儲過程,方法,以及包都可以,具體語法參考如下:
1.grant給表賦權限:
grant select/update on table to user;
grant 權限 on 表 to 用戶。
2.grant 給存儲過程賦權限:
grant execute on package/function/procedure to user;
grant execute on 過程、包、方法 to user