2026-05-01 07:25:46
This commit is contained in:
+11
-11
@@ -1,20 +1,20 @@
|
||||
/* Statistics details for table partitions/subpartitios
|
||||
|
||||
|
||||
Usage: @tspstat <owner> <table> <partition>
|
||||
|
||||
vplesnila 2024-01-29: creation
|
||||
*/
|
||||
|
||||
col owner for a20 head "Owner"
|
||||
col table_name for a25 head "Table name"
|
||||
col PARTITION_POSITION for 999 heading "P#"
|
||||
col owner for a20 head "Owner"
|
||||
col table_name for a25 head "Table name"
|
||||
col PARTITION_POSITION for 999 heading "P#"
|
||||
col PARTITION_NAME for a25 head "Partition name"
|
||||
col SUBPARTITION_NAME for a25 head "Subpartition name"
|
||||
col last_DML for a20 head "Last DML"
|
||||
col last_analyzed for a20 head "Last Analyzed"
|
||||
col STALE_STATS for a7 head "Stale"
|
||||
col NUM_ROWS head "#Rows"
|
||||
col INSERTS head "Table|INS"
|
||||
col NUM_ROWS head "#Rows"
|
||||
col INSERTS head "Table|INS"
|
||||
col UPDATES head "Table|UPD"
|
||||
col DELETES head "Table|DEL"
|
||||
col TRUNCATED head "Table|TRUN"
|
||||
@@ -24,10 +24,10 @@ compute sum of INSERTS on report
|
||||
compute sum of UPDATES on report
|
||||
compute sum of DELETES on report
|
||||
|
||||
select
|
||||
select
|
||||
tabstat.OWNER
|
||||
,tabstat.TABLE_NAME
|
||||
,tabstat.PARTITION_POSITION
|
||||
,tabstat.PARTITION_POSITION
|
||||
,tabstat.PARTITION_NAME
|
||||
,tabstat.SUBPARTITION_NAME
|
||||
,tabstat.NUM_ROWS
|
||||
@@ -38,14 +38,14 @@ select
|
||||
,tabmod.DELETES
|
||||
,tabmod.TRUNCATED
|
||||
,tabmod.TIMESTAMP last_DML
|
||||
from
|
||||
from
|
||||
dba_tab_statistics tabstat
|
||||
,dba_tab_modifications tabmod
|
||||
WHERE
|
||||
tabstat.owner = '&&1'
|
||||
AND tabstat.table_name = '&&2'
|
||||
AND (tabstat.partition_name like '%&&3%' or tabstat.partition_name is NULL)
|
||||
AND (tabstat.subpartition_name like '%&&4%' or tabstat.subpartition_name is NULL)
|
||||
AND (tabstat.partition_name like '%&&3%' or tabstat.partition_name is NULL)
|
||||
AND (tabstat.subpartition_name like '%&&4%' or tabstat.subpartition_name is NULL)
|
||||
AND tabstat.owner = tabmod.table_owner(+)
|
||||
AND tabstat.table_name = tabmod.table_name(+)
|
||||
AND tabstat.partition_name = tabmod.partition_name(+)
|
||||
|
||||
Reference in New Issue
Block a user