標籤:
一、查看目前使用者資訊:
1、查看目前使用者擁有的角色許可權資訊:select * from role_sys_privs;
2、查看目前使用者的詳細資料:select * from user_users;
3、查看目前使用者的角色資訊:select * from user_role_privs;
總結:ORACLE中資料字典視圖分為3大類,用首碼區別,分別為:USER,ALL 和 DBA,
許多資料字典視圖包含相似的資訊。
USER_*:有關使用者所擁有的對象資訊,即使用者自己建立的對象資訊。
ALL_*:有關使用者可以訪問的對象的資訊,即使用者自己建立的對象的資訊加上其他使用者建立的對象但該使用者有權訪問的資訊。
DBA_*:有關整個資料庫中對象的資訊。
其他:
查看使用者和預設資料表空間的關係。
select username,default_tablespace from dba_users;
1.查看錶結構:desc表名
2.查看目前使用者的表:
- select table_name from user_tables;
3.查看所有使用者的表名:
- select table_name from all_tables;
4.查看所有表名(其中包括系統資料表)
- select table_name from all_tables;
5.查看所有的表:
- select * from tab/dba_tables/dba_objects/cat;
下面介紹Oracle查詢使用者資料表空間
◆Oracle查詢使用者資料表空間:select * from user_all_tables
◆Oracle查詢所有函數和儲存過程:select * from user_source
◆Oracle查詢所有使用者:select * from all_users.select * from dba_users
◆Oracle查看目前使用者串連:select * from v$Session
◆Oracle查看目前使用者許可權:select * from session_privs
◆Oracle查看使用者資料表空間使用方式:
- select a.file_id "FileNo",a.tablespace_name
- "Tablespace_name",
- a.bytes "Bytes",a.bytes-sum(nvl(b.bytes,0)) "Used",
- sum(nvl(b.bytes,0)) "Free",
- sum(nvl(b.bytes,0))/a.bytes*100 "%free"
- from dba_data_files a, dba_free_space b
- where a.file_id = b .file_id(+)
- group by a.tablespace_name ,
- a.file_id,a.bytes order by a.tablespace_name;
1.查看所有使用者:
select * from dba_user;
select * from all_users;
select * from user_users;
2.查看使用者系統許可權:
select * from dba_sys_privs;
select * from all_sys_privs;
select * from user_sys_privs;
3.查看使用者物件許可權:
select * from dba_tab_privs;
select * from all_tab_privs;
select * from user_tab_privs;
4.查看所有角色:
select * from dba_roles;
5.查看使用者所擁有的角色:
select * from dba_role_privs;
select * from user_role_privs;
6.查看角色所擁有的許可權:
select * from role_sys_privs;
select * from role_tab_privs;
7.查看所有系統許可權
select * from system_privilege_map;
8.查看所有對象許可權
select * from table_privilege_map;
以上是在Oracle中查看使用者權限 ,
在DB2中為:
select * from syscat.dbauth
或者
get authorizations
查看sid
select * from v$instance
oracle查看目前使用者資訊