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;