一、查看當前用戶信息:
查看用戶的詳細信息:select * from user_users;(本用戶,類似有dba_users、all_users,詳細如下)
總結:ORACLE中數據字典視圖分爲3大類,用前綴區別,分別爲:USER,ALL 和 DBA,
許多數據字典視圖包含相似的信息。
USER_*:user所擁有的對象信息,即用戶自己創建的對象信息。
ALL_*:所有可以訪問的對象的信息,即用戶自己創建的對象的信息加上其他用戶創建的對象但該用戶有權訪問的信息。
DBA_*:有關整個數據庫中對象的信息。
可使用查看錶結構:desc 表名 後對各項進行查詢
e.g.
1.查看當前用戶的表
select table_name from user_tables;
2.查看所有可訪問表名(其中包括系統表)
select table_name from all_tables;
3.查看所有的表:
select * from dba_tables;
其中使用 desc user_users 等可看到default_tablespace、temporary_tablespace等,可看到默認表空間、臨時表空間等基本信息
需要查詢用戶權限時,對應使用的視圖爲_privs
e.g.:
查看用戶系統權限:select * from dba_sys_privs;
select * from all_sys_privs;
select * from user_sys_privs;
二、用戶創建設置
create user fd identified by fd default tablespace example temporary tablespace temp profile default quota 100 on example;
-- ↑密碼 ↑默認表空間 ↑用於限制用戶數據庫資源 ↑表空間使用空間上限
grant dba to fd;--分配權限
reference:
http://blog.sina.com.cn/s/blog_713978a50100y627.html
http://blog.chinaunix.net/uid-26896647-id-3400875.html