Data changes on Oracle checklist

Source: Internet
Author: User

This knowledge point applies only to versions of Oracle 9i or more.

To view data changes in a table, use the SQL statement: SELECT * from User_tab_modifications;

The fields of the User_tab_modifications table are as follows, and from this table it is easy to find the changes made in the table, delete, increase the record of the situation

Note and how to use:

1, but this table is not updated in real time, the default is 15 minutes update, so you update a table, may not be immediately reflected in the user_tab_modifications.

2. There is a way to do this in real time, which is to perform EXEC dbms_stats before executing select * from User_tab_modifications. Flush_database_monitoring_info; The purpose of this stored procedure is to immediately refresh the dynamic information

3, when executing the above stored procedure error, the error is as follows:

ERROR at line 1:

Ora-20000:insufficient Privileges

Ora-06512:at "SYS. Dbms_stats ", Line 2148

Ora-06512:at "SYS. Dbms_stats ", Line 14135

Ora-06512:at Line 1

Haha error is obvious, no authority, then the right to raise!

4, for the user right, first with the Administrator account login, grant an account execution dbms_stats. The permissions of the Flush_database_monitoring_info.

Grant Analyze any to EPPLM (here is your user name)

5, OK to mention the right to succeed, then return to the original account (EPPLM), and then execute the exec dbms_stats. Flush_database_monitoring_info,ok, no problem.

6. When you execute SELECT * from User_tab_modifications, the record appears.

7. After the flush_database_monitoring_info stored procedure, all previous operations will be submitted!

8, for Oracle10i and the above version, DML operation, can be found in the table, because this feature is turned on by default, if not open, can be opened by this method: ALTER TABLE t monitoring;

Stored procedures:

createor replace procedurePro_Analyze_And_TableModify is

2 begin
3    dbms_output.put_line(‘开始执行,过程很长,请等待‘);
4    DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO;--立刻刷新
5    insertinto TableModifications select fromuser_tab_modifications;--两个表结构一样
6    Pro_AnalyzeTables;--执行分析表(调用上一篇的存储过程)
7    dbms_output.put_line(‘执行成功‘);
8 endPro_Analyze_And_TableModify;

Data changes on Oracle checklist

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.