tabstat.sql
■例
SQL> @tabstat job
OWNER TABLE_NAME NUM_ROWS BLOCKS AVG_ROW_LEN LAST_ANALYZED
-------------------- ------------------------------ ---------- ---------- ----------- --------------------------------
HR JOBS 19 5 33 2022/01/29 00:05
HR JOB_HISTORY 10 5 31 2022/01/29 00:05
code:SQL
--@tabstat <TBLNM-前方一致>
define TBLNM=&1
set verify off
set timing off
set pages 1000
@column_format
col BLOCKS for 999,999,990 heading 'BLOCKS'
set lines 200
select OWNER,TABLE_NAME,NUM_ROWS,BLOCKS,AVG_ROW_LEN,to_char(LAST_ANALYZED,'yyyy/mm/dd hh24:mi') LAST_ANALYZED
from ALL_TABLES
where TABLE_NAME like upper('&TBLNM%')
and OWNER = sys_context('userenv','current_schema')
and LAST_ANALYZED is not null
order by OWNER,TABLE_NAME
;
@default_settings