Oracle checklist data changes

Source: Internet
Author: User

This knowledge point is only applicable to Oracle 9i and later versions.

To view table data changes, use the SQL statement: Select * From user_tab_modifications;

The fields in the user_tab_modifications table are as follows:Modify, delete, and add recordsStatus

Note and usage:

1. But this table is not updated in real time. It is updated every 15 minutes by default. Therefore, updating a table may not be immediately reflected in user_tab_modifications.

2. If you want to view the changes in real time, execute exec dbms_stats.flush_database_monitoring_info before executing select * From user_tab_modifications.

3. When an error occurs while executing the above stored procedure, 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 the error is obvious. If you do not have the permission, raise the permission!

4. grant permissions to the user. First, log in with the Administrator account and grant the dbms_stats.flush_database_monitoring_info permission to an account.
Grant analyze any to epplm (here is your user name)

5. If the permission is successfully raised, return to the original account (epplm) and execute exec dbms_stats.flush_database_monitoring_info. OK is OK.

6. 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 later versions, DML operations can be found in this table, because this function is enabled by default. If it is not enabled, you can enable it using this method: alter table t monitoring;

Stored Procedure:

Create or replace procedure into isbegin dbms_output.put_line; -- execute the analysis table (call the stored procedure in the previous article) dbms_output.put_line ('execution successfully'); End pro_analyze_and_tablemodify;

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.