Why does DBA_TAB_MODIFICATIONS sometimes have no values [ID 762738.1](一)

2014-11-24 16:43:31 · 作者: · 浏览: 0
Why does DBA_TAB_MODIFICATIONS sometimes have no values [ID 762738.1]
Why does DBA_TAB_MODIFICATIONS sometimes have no values [ID 762738.1]
--------------------------------------------------------------------------------
Modified 18-MAR-2009 Type HOWTO Status MODERATED
In this Document
Goal
Solution
References
--------------------------------------------------------------------------------
This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process, and therefore has not been subject to an independent technical review.
Applies to:
Oracle Server - Enterprise Edition - Version: 10.2.0.3
Information in this document applies to any platform.
Oracle Server Enterprise Edition - Version: 10.2.0.3
Goal
The goal is to explain why the view DBA_TAB_MODIFICATIONS does sometimes have no values
even when the parameter STATISTICS_LEVEL is set to TYPICAL and the specific schema has been analyzed successful using the package DBMS_STATS.GATHER_SCHEMA_STATS.
In addition all the tables in that schema shows MONITORING=YES in the view dba_tables.
Solution
The updates to the table *_tab_modifications are related to the volumne of updates for a table.
There is a need of approximatly 10% of datavolumn changes. Just only on single update of the row for example might not lead to fill the *_tab_modifications .
See example below:
STEP1: *** create a table crc.gs , analyze it and then fill test_gs.gs with 100 rows and perform some DML
-------------------------------------------------------------------------------------
create user crc identified by crc
default tablespace users temporary tablespace temp;
grant connect,resource to crc;
connect crc/crc
alter session set nls_language = american;
alter session set nls_date_format= 'DD-MM-YY HH24:MI:SS';
create table crc.gs (i number);
begin
dbms_stats.gather_schema_stats(
ownname =>'CRC',
estimate_percent => dbms_stats.auto_sample_size,
method_opt =>'FOR ALL COLUMNS SIZE AUTO',
degree => 1,
granularity => 'ALL',
cascade => true,
options => 'GATHER'
);
end;
/
begin
for i in 1..100 loop
insert into CRC.gs values(i);
end loop;
commit;
end;
/
delete from CRC.gs where i between 40 and 60;
commit;
update CRC.gs set i=i+1000 where i between 80 and 100;
commit;
STEP2: *** select and use the procedure DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO
-------------------------------------------------------------------------------------------
Note: The procedure DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO flushes in-memory monitoring information for all tables in the dictionary.
Corresponding entries in the *_TAB_MODIFICATIONS, *_TAB_STATISTICS and *_IND_STATISTICS
views are updated immediately, without waiting for the Oracle database to flush them periodically (per default every 3 hours). This procedure is useful when you need up-to-date information in those views.
SQL> select TABLE_OWNER, TABLE_NAME, INSERTS , UPDATES, DELETES, TIMESTAMP from
2 sys.dba_tab_modifications where TABLE_OWNER='CRC';