查詢系統關鍵資訊
set linesize 300
set pagesize 0
set trims on
set term off
spool off
spool dba_tables.log
select owner||','||table_name||','||PCT_FREE||','||INITIAL_EXTENT||','||NUM_ROWS||','||BLOCKS||','||AVG_ROW_LEN||','||trim(DEGREE)||','||to_char(LAST_ANALYZED,'YYYY-MM-DD')||','||PARTITIONED||','||BUFFER_POOL||','||TEMPORARY||','||USER_STATS||','||STATUS
from dba_tables
where owner in('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_indexes.log
select owner||','||index_name||','||table_owner||','||table_name||','||PCT_FREE||','||INITIAL_EXTENT||','||blevel||','||NUM_ROWS||','||LEAF_BLOCKS||','||DISTINCT_KEYS||','||CLUSTERING_FACTOR||','||trim(DEGREE)||','||to_char(LAST_ANALYZED,'YYYY-MM-DD')||','||PARTITIONED||','||BUFFER_POOL||','||USER_STATS||','||STATUS
from dba_indexes
where table_owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_ind_columns.log
select index_owner||','||index_name||','||table_name||','||COLUMN_NAME||','||COLUMN_POSITION||','||DESCEND
from dba_ind_columns
where table_owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_tab_partitions.log
select table_owner||','||table_name||','||COMPOSITE||','||PARTITION_NAME||','||PARTITION_POSITION||','||PCT_FREE||','||INITIAL_EXTENT||','||NUM_ROWS||','||BLOCKS||','||AVG_ROW_LEN||','||to_char(LAST_ANALYZED,'YYYY-MM-DD')||','||BUFFER_POOL||','||USER_STATS
from dba_tab_partitions
where table_owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_ind_partitions.log
select index_owner||','||index_name||','||COMPOSITE||','||PARTITION_NAME||','||PARTITION_POSITION||','||PCT_FREE||','||INITIAL_EXTENT||','||blevel||','||NUM_ROWS||','||LEAF_BLOCKS||','||DISTINCT_KEYS||','||CLUSTERING_FACTOR||','||to_char(LAST_ANALYZED,'YYYY-MM-DD')||','||BUFFER_POOL||','||USER_STATS||','||STATUS
from dba_ind_partitions
where index_owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_part_tables.log
select owner||','||table_name||','||PARTITIONING_TYPE||','||SUBPARTITIONING_TYPE||','||PARTITIONING_KEY_COUNT||','||SUBPARTITIONING_KEY_COUNT||','||PARTITION_COUNT
from dba_part_tables
where owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_part_indexes.log
select owner||','||index_name||','||table_name||','||PARTITIONING_TYPE||','||SUBPARTITIONING_TYPE||','||PARTITIONING_KEY_COUNT||','||SUBPARTITIONING_KEY_COUNT||','||PARTITION_COUNT||','||LOCALITY||','||ALIGNMENT
from dba_part_indexes
where owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_part_key_columns.log
select owner||','||name||','||object_type||','||COLUMN_NAME||','||COLUMN_POSITION
from dba_part_key_columns
where owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_subpart_key_columns.log
select owner||','||name||','||object_type||','||COLUMN_NAME||','||COLUMN_POSITION
from dba_subpart_key_columns
where owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_tab_subpartitions.log
select table_owner||','||table_name||','||PARTITION_NAME||','||SUBPARTITION_NAME||','||SUBPARTITION_POSITION||','||PCT_FREE||','||INITIAL_EXTENT||','||NUM_ROWS||','||BLOCKS||','||AVG_ROW_LEN||','||to_char(LAST_ANALYZED,'YYYY-MM-DD')||','||BUFFER_POOL||','||USER_STATS
from dba_tab_subpartitions
where table_owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_ind_subpartitions.log
select index_owner||','||index_name||','||PARTITION_NAME||','||SUBPARTITION_NAME||','||SUBPARTITION_POSITION||','||PCT_FREE||','||INITIAL_EXTENT||','||blevel||','||NUM_ROWS||','||LEAF_BLOCKS||','||DISTINCT_KEYS||','||CLUSTERING_FACTOR||','||to_char(LAST_ANALYZED,'YYYY-MM-DD')||','||BUFFER_POOL||','||USER_STATS||','||STATUS
from dba_ind_subpartitions
where index_owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_segments.log
select owner||','||segment_name||','||PARTITION_NAME||','||SEGMENT_TYPE||','||BYTES||','||BLOCKS||','||INITIAL_EXTENT||','||NEXT_EXTENT||','||PCT_INCREASE||','||TABLESPACE_NAME||','||BUFFER_POOL
from dba_segments
where owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
/
set pagesize 0
set trims on
set term off
spool off
spool dba_tables.log
select owner||','||table_name||','||PCT_FREE||','||INITIAL_EXTENT||','||NUM_ROWS||','||BLOCKS||','||AVG_ROW_LEN||','||trim(DEGREE)||','||to_char(LAST_ANALYZED,'YYYY-MM-DD')||','||PARTITIONED||','||BUFFER_POOL||','||TEMPORARY||','||USER_STATS||','||STATUS
from dba_tables
where owner in('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_indexes.log
select owner||','||index_name||','||table_owner||','||table_name||','||PCT_FREE||','||INITIAL_EXTENT||','||blevel||','||NUM_ROWS||','||LEAF_BLOCKS||','||DISTINCT_KEYS||','||CLUSTERING_FACTOR||','||trim(DEGREE)||','||to_char(LAST_ANALYZED,'YYYY-MM-DD')||','||PARTITIONED||','||BUFFER_POOL||','||USER_STATS||','||STATUS
from dba_indexes
where table_owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_ind_columns.log
select index_owner||','||index_name||','||table_name||','||COLUMN_NAME||','||COLUMN_POSITION||','||DESCEND
from dba_ind_columns
where table_owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_tab_partitions.log
select table_owner||','||table_name||','||COMPOSITE||','||PARTITION_NAME||','||PARTITION_POSITION||','||PCT_FREE||','||INITIAL_EXTENT||','||NUM_ROWS||','||BLOCKS||','||AVG_ROW_LEN||','||to_char(LAST_ANALYZED,'YYYY-MM-DD')||','||BUFFER_POOL||','||USER_STATS
from dba_tab_partitions
where table_owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_ind_partitions.log
select index_owner||','||index_name||','||COMPOSITE||','||PARTITION_NAME||','||PARTITION_POSITION||','||PCT_FREE||','||INITIAL_EXTENT||','||blevel||','||NUM_ROWS||','||LEAF_BLOCKS||','||DISTINCT_KEYS||','||CLUSTERING_FACTOR||','||to_char(LAST_ANALYZED,'YYYY-MM-DD')||','||BUFFER_POOL||','||USER_STATS||','||STATUS
from dba_ind_partitions
where index_owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_part_tables.log
select owner||','||table_name||','||PARTITIONING_TYPE||','||SUBPARTITIONING_TYPE||','||PARTITIONING_KEY_COUNT||','||SUBPARTITIONING_KEY_COUNT||','||PARTITION_COUNT
from dba_part_tables
where owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_part_indexes.log
select owner||','||index_name||','||table_name||','||PARTITIONING_TYPE||','||SUBPARTITIONING_TYPE||','||PARTITIONING_KEY_COUNT||','||SUBPARTITIONING_KEY_COUNT||','||PARTITION_COUNT||','||LOCALITY||','||ALIGNMENT
from dba_part_indexes
where owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_part_key_columns.log
select owner||','||name||','||object_type||','||COLUMN_NAME||','||COLUMN_POSITION
from dba_part_key_columns
where owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_subpart_key_columns.log
select owner||','||name||','||object_type||','||COLUMN_NAME||','||COLUMN_POSITION
from dba_subpart_key_columns
where owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_tab_subpartitions.log
select table_owner||','||table_name||','||PARTITION_NAME||','||SUBPARTITION_NAME||','||SUBPARTITION_POSITION||','||PCT_FREE||','||INITIAL_EXTENT||','||NUM_ROWS||','||BLOCKS||','||AVG_ROW_LEN||','||to_char(LAST_ANALYZED,'YYYY-MM-DD')||','||BUFFER_POOL||','||USER_STATS
from dba_tab_subpartitions
where table_owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_ind_subpartitions.log
select index_owner||','||index_name||','||PARTITION_NAME||','||SUBPARTITION_NAME||','||SUBPARTITION_POSITION||','||PCT_FREE||','||INITIAL_EXTENT||','||blevel||','||NUM_ROWS||','||LEAF_BLOCKS||','||DISTINCT_KEYS||','||CLUSTERING_FACTOR||','||to_char(LAST_ANALYZED,'YYYY-MM-DD')||','||BUFFER_POOL||','||USER_STATS||','||STATUS
from dba_ind_subpartitions
where index_owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
spool dba_segments.log
select owner||','||segment_name||','||PARTITION_NAME||','||SEGMENT_TYPE||','||BYTES||','||BLOCKS||','||INITIAL_EXTENT||','||NEXT_EXTENT||','||PCT_INCREASE||','||TABLESPACE_NAME||','||BUFFER_POOL
from dba_segments
where owner in ('SYSTEM','SYS','MGMT_VIEW','SYSMAN','DBSNMP','OLAPSYS','SI_INFORMTN_SCHEMA','ORDPLUGINS','XDB','WMSYS','DMSYS','OUTLN','EXFSYS','ANONYMOUS','CTXSYS','ORDSYS','MDSYS','TSMSYS','ORACLE_OCM','DIP','MDDATA','SCOTT');
spool off
/
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27500440/viewspace-1130208/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 根據關鍵字查詢車輛資訊
- 綜合資訊查詢系統IISS
- GaussDB 200系統資訊查詢
- 幾個查詢系統資訊的命令!
- 資訊集--資訊系統分析設計關鍵
- UNIX系統備份關鍵的資訊
- linux 常用的系統資訊查詢命令Linux
- 關於外來鍵約束和對應主鍵資訊的查詢指令碼指令碼
- mysql帶IN關鍵字的查詢MySql
- 鎖表的相關資訊查詢
- 統計資訊的查詢方法
- 資訊系統建設的核心與關鍵
- 如何一鍵查詢淘寶訂單物流資訊
- C/C++ 運用VMI介面查詢系統資訊C++
- 將查詢的關鍵字返紅
- BIEB:關於CRM系統查詢效能問題
- oracle查詢表資訊(索引,外來鍵,列等)Oracle索引
- 統計資訊查詢檢視|全方位認識 sys 系統庫
- 拼多多按關鍵詞查詢商品APIAPI
- Media Queries媒體查詢常用關鍵詞
- Dapper 中使用sql in 關鍵字查詢APPSQL
- 在資料庫中查詢關鍵字資料庫
- ORACLE 查詢條件出現關鍵字:&Oracle
- oracle系統表查詢Oracle
- linux查詢作業系統資訊(CPU、記憶體、硬碟)Linux作業系統記憶體硬碟
- 查詢表資訊
- HGDB怎麼獲取資料庫中關鍵系統資訊資料庫
- mysql新建表和多表查詢,關鍵字joinMySql
- mysql帶AND關鍵字的多條件查詢MySql
- SQL聯合查詢中的關鍵語法SQL
- Oracle查詢表的外來鍵引用關係Oracle
- SQL“多欄位模糊匹配關鍵字查詢”SQL
- 學習 XQuery:XML資料查詢的關鍵XML
- 政策查詢系統(安卓)7安卓
- 政策查詢系統(安卓)6安卓
- SQL Server 2005:查詢統計資訊SQLServer
- goland 查詢快捷鍵GoLand
- 海關資料查詢系統「查詢平臺分類」