DBA_TAB_MODIFICATIONS 视图学习
发表于:2025-02-01 作者:千家信息网编辑
千家信息网最后更新 2025年02月01日,通过测试来学习DBA_TAB_MODIFICATIONS视图的作用DBA_TAB_MODIFICATIONS describes modifications to all tables in the
千家信息网最后更新 2025年02月01日DBA_TAB_MODIFICATIONS 视图学习
通过测试来学习DBA_TAB_MODIFICATIONS视图的作用
DBA_TAB_MODIFICATIONS describes modifications to all tables in the database that have been modified since the last time statistics were gathered on the tables. Its columns are the same as those in "ALL_TAB_MODIFICATIONS".DBA_TAB_MODIFICATIONS描述的是收集完统计信息之后的数据库中所有表的DML操作。
Note:This view is populated only for tables with the MONITORING attribute. It is intended for statistics collection over a long period of time. For performance reasons, the Oracle Database does not populate this view immediately when the actual modifications occur. Run the FLUSH_DATABASE_MONITORING_INFO procedure in the DBMS_STATS PL/SQL package to populate this view with the latest information. The ANALYZE_ANY system privilege is required to run this procedure.
SQL> desc dba_tab_modifications; Name Null? Type ----------------------------------------- -------- ---------------------------- TABLE_OWNER VARCHAR2(128) TABLE_NAME VARCHAR2(128) PARTITION_NAME VARCHAR2(128) SUBPARTITION_NAME VARCHAR2(128) INSERTS NUMBER ##插入 UPDATES NUMBER ##更新 DELETES NUMBER ##删除 TIMESTAMP DATE TRUNCATED VARCHAR2(3) ##截断 DROP_SEGMENTS NUMBERSQL>
SQL> select * from v$version where rownum=1;BANNER-------------------------------------------------------------------------------- CON_ID----------Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production 0
SQL> create table t1 as select * from dba_objects;Table created.
SQL> select table_owner,table_name,inserts,UPDATES,deletes,timestamp,truncated,drop_segments from sys.dba_tab_modifications where table_name='T1';no rows selectedSQL> update t1 set object_id=1 where object_id=30;1 row updated.SQL> select table_owner,table_name,inserts,UPDATES,deletes,timestamp,truncated,drop_segments from sys.dba_tab_modifications where table_name='T1';no rows selectedSQL> exec dbms_stats.flush_database_monitoring_info;PL/SQL procedure successfully completed.SQL> select table_owner,table_name,inserts,UPDATES,deletes,timestamp,truncated,drop_segments from sys.dba_tab_modifications where table_name='T1';TABLE_OWNER--------------------------------------------------------------------------------TABLE_NAME-------------------------------------------------------------------------------- INSERTS UPDATES DELETES TIMESTAMP TRU DROP_SEGMENTS---------- ---------- ---------- ----------------------- --- -------------SYST1 0 1 0 19-FEB-2018 06:59:33 NO 0SQL> exec dbms_stats.flush_database_monitoring_info;PL/SQL procedure successfully completed.SQL> select table_owner,table_name,inserts,UPDATES,deletes,timestamp,truncated,drop_segments from sys.dba_tab_modifications where table_name='T1';TABLE_OWNER--------------------------------------------------------------------------------TABLE_NAME-------------------------------------------------------------------------------- INSERTS UPDATES DELETES TIMESTAMP TRU DROP_SEGMENTS---------- ---------- ---------- ----------------------- --- -------------SYST1 0 1 0 19-FEB-2018 06:59:33 NO 0SQL> exec dbms_stats.gather_table_stats('SYS','T1');PL/SQL procedure successfully completed.SQL> select table_owner,table_name,inserts,UPDATES,deletes,timestamp,truncated,drop_segments from sys.dba_tab_modifications where table_name='T1';no rows selectedSQL>
小结:
1、dml操作不提交,也会记录到视图中。
2、考虑到性能问题,我们需要手动flush,视图中才会有记录。
3、收集完统计信息,视图中相关表记录置空,与官方文档描述一样
测试二:
SQL> alter system set "_dml_monitoring_enabled"=false scope=memory;System altered.SQL> delete from t1;90974 rows deleted.SQL> select table_owner,table_name,inserts,UPDATES,deletes,timestamp,truncated,drop_segments from sys.dba_tab_modifications where table_name='T1';no rows selectedSQL> exec dbms_stats.flush_database_monitoring_info;PL/SQL procedure successfully completed.SQL> select table_owner,table_name,inserts,UPDATES,deletes,timestamp,truncated,drop_segments from sys.dba_tab_modifications where table_name='T1';no rows selectedSQL>
小结:
关闭监视器以后,不管我们做任何操作,此视图都不会记录dml的相关操作。
视图
信息
小结
测试
统计
学习
作用
官方
性能
手动
数据
数据库
文档
监视器
问题
更新
监视
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
明日之后黑珍珠区几号开的服务器
sql数据库文件有哪两个
维基百科的服务器
传感器网络安全协议栈有哪些
科技企业 转型 互联网
本溪会员报单软件开发多少钱
湖南专业电商进销存软件开发
康平软件开发商靠谱吗
数据库应用能力分析
数据库安全是如何实现的
通证互联网科技有限公司
安宁gpu云服务器价格
装甲联队如何返回原服务器
青少年如何预防网络安全
星外服务器
服务器如何快速找钻石
网络安全自我检讨
网络安全博客在哪里
西宁网络技术哪家好
计件软件开发用什么设计
北京小型软件开发需求
网络安全实验文件安全传输
辽宁苹果软件开发
数据库增啥改查
成都农行软件开发待遇
数据库创建设备表
电网技术中心 网络安全项目
ibm服务器代码6F
三十多学网络安全工程师
谷歌服务器古