ITPub博客

首页 > 数据库 > Oracle > DBA_TAB_MODIFICATIONS数据字典的变化

DBA_TAB_MODIFICATIONS数据字典的变化

原创 Oracle 作者:Rman2017 时间:2017-05-19 10:28:19 0 删除 编辑

SQL> create user liushiming1234 identified by liushiming1234

default tablespace users;   


User created.


SQL> grant connect,resource to liushiming1234 ;


Grant succeeded.


SQL> create table liushiming1234.test1234 (i number);


Table created.


SQL> begin

dbms_stats.gather_schema_stats(

ownname =>'LIUSHIMING1234',

estimate_percent => dbms_stats.auto_sample_size,

method_opt =>'FOR ALL COLUMNS SIZE AUTO',

degree => 1,

granularity => 'ALL',

cascade => true,

options => 'GATHER'

);

end; 

 /


PL/SQL procedure successfully completed.


SQL> begin

for i in 1..100 loop

insert into liushiming1234.test1234 values(i);

end loop;

commit;

end; 

/


PL/SQL procedure successfully completed.


SQL> delete from liushiming1234.test1234 where i between 40 and 60;

21 rows deleted.



SQL> commit;


Commit complete.


SQL> update liushiming1234.test1234 set i=i+1000 where i between 80 and 100;


21 rows updated.


SQL> commit;


Commit complete.


SQL> execute DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO;


PL/SQL procedure successfully completed.



SQL> select TABLE_OWNER, TABLE_NAME, INSERTS , UPDATES, DELETES, TIMESTAMP from sys.dba_tab_modifications where TABLE_OWNER='LIUSHIMING1234';


TABLE_OWNER                    TABLE_NAME                        INSERTS

------------------------------ ------------------------------ ----------

   UPDATES    DELETES TIMESTAMP

---------- ---------- ------------

LIUSHIMING1234                 TEST1234                              100

        21         21 19-MAY-14



SQL> begin

dbms_stats.gather_schema_stats(

ownname =>'LIUSHIMING1234',

estimate_percent => dbms_stats.auto_sample_size,

method_opt =>'FOR ALL COLUMNS SIZE AUTO',

degree => 1,

granularity => 'ALL',

cascade => true,

options => 'GATHER'

);

end; 

/


PL/SQL procedure successfully completed.


SQL> select TABLE_OWNER, TABLE_NAME, INSERTS , UPDATES, DELETES, TIMESTAMP from sys.dba_tab_modifications where TABLE_OWNER='LIUSHIMING1234';


no rows selected


SQL> update LIUSHIMING1234.TEST1234 set i=i+100 where i=30;


1 row updated.


SQL> commit;


Commit complete.


SQL> execute DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO;


PL/SQL procedure successfully completed.


SQL> select TABLE_OWNER, TABLE_NAME, INSERTS , UPDATES, DELETES, TIMESTAMP from sys.dba_tab_modifications where TABLE_OWNER='LIUSHIMING1234';


TABLE_OWNER                    TABLE_NAME                        INSERTS

------------------------------ ------------------------------ ----------

   UPDATES    DELETES TIMESTAMP

---------- ---------- ------------

LIUSHIMING1234                 TEST1234                                0

         1          0 19-MAY-14



来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31448824/viewspace-2139375/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 劫持脚本
请登录后发表评论 登录
全部评论

注册时间:2017-03-30

  • 博文量
    352
  • 访问量
    132749