1、用戶
查看當前用戶的缺省表空間
SQL>select username,default_tablespace from user_users;
查看當前用戶的角色
SQL>select * from user_role_privs;
查看當前用戶的系統(tǒng)權限和表級權限
SQL>select * from user_sys_privs;
SQL>select * from user_tab_privs;
2、表
查看用戶下所有的表
SQL>select * from user_tables;
查看名稱包含log字符的表
SQL>select object_name,object_id from user_objects
where instr(object_name,'LOG')>0;
查看某表的創(chuàng)建時間
SQL>select object_name,created from user_objects where object_name=upper('&table_name');
查看某表的大小
SQL>select sum(bytes)/(1024*1024) as "size(M)" from user_segments
where segment_name=upper('&table_name');
查看放在ORACLE的內(nèi)存區(qū)里的表
SQL>select table_name,cache from user_tables where instr(cache,'Y')>0;
3、索引
查看索引個數(shù)和類別
SQL>select index_name,index_type,table_name from user_indexes order by table_name;
查看索引被索引的字段
SQL>select * from user_ind_columns where index_name=upper('&index_name');
查看索引的大小
SQL>select sum(bytes)/(1024*1024) as "size(M)" from user_segments
where segment_name=upper('&index_name');
4、序列號
查看序列號,last_number是當前值