Oracle給予用戶權限與查看當前用戶所有的表(持續更新中)

PS:如果你用的是圖形化界面,只需要隨便打開一個sql窗口直接把代碼寫進去運行即可,看情況吧,權限夠用就可以(學習使用).

說明:普通用戶是無法創建其他用戶並且給予權限的,需要sys用戶進行下一步操作:

#創建普通用戶
create user 用戶名 identified by 密碼;
create user Ryan identified by root;

#授予用戶登錄數據庫的權限
grant create session to 用戶名;
grant create session to Ryan;

#授予用戶操作表空間的權限:
grant 權限 tablespace to 用戶名;
grant unlimited tablespace to Ryan;
grant create tablespace to Ryan;
grant alter tablespace to Ryan;
grant drop tablespace to Ryan;
grant manage tablespace to Ryan;

#授予用戶操作表的權限:
grant create table to 用戶名;
grant create table to Ryan;

#授予用戶操作視圖的權限:
grant create view to 用戶名;
grant create view to Ryan;

#授予用戶操作觸發器的權限:
grant create trigger to 用戶名;
grant create trigger to Ryan;

#授予用戶操作存儲過程的權限:
grant create procedure to 用戶名;
grant create procedure to Ryan;

#授予序列操作儲存過程的權限
grant create sequence to 用戶名;
grant create sequence to Ryan;

#授予用戶調試權限
grant debug connect session to 用戶名
grant debug connect session to study;

查看當前用戶所有的表:

select * from user_tables;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章