How to find out the table was last modified in Oracle?

In my previous article i have given idea about the how to find out backup of table? and questions like that. In this article i would like to give answer of one of the interview question asked to DBA – How to find out the table was last modified in Oracle? There are so many times the developers or DBA need to check who has updated or modified the table.Modification meaning here is nothing but insert,update and delete.We require to use the dictionary table in oracle named dba_tab_modifications.

How to find out the table was last modified in oracle? – Real life Scenario

Step 1 : Insert the data in customer table.

Insert into Customer

values(1,’Amit);

Commit;

Step 2 : We require to check the information in dba_tab_modifications

The following query will give you information about the

select INSERTS,UPDATES,DELETES,TRUNCATED,TIMESTAMP from dba_tab_modifications where TABLE_NAME=’Customer’ and TABLE_OWNER=’Amit’;

Output :

no rows found

If you can see the output the rows are not found. The next step is you require to flush the information and update that information in dba_tab_modification table.

Step 3 : Flush the information and Monitor it

3.Flush the monitoring Information

In this step we require to execute the flush statement of oracle.

exec DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO; 

PL/SQL procedure successfully

select INSERTS,UPDATES,DELETES,TRUNCATED,TIMESTAMP from dba_tab_modifications where TABLE_NAME=’Customer’ and TABLE_OWNER=’Amit’;

Output :

INSERTS    UPDATES    DELETES TRU TIMESTAMP

———- ———- ———- — ————————————

1           0           0 NO  15-AUG-20 

You can see that there is one insert done on customer table. You can also see the timings by which time the insert or update has happened or not.

  select owner,object_name,object_type,status,last_ddl_time from dba_objects where object_name=’Amit’ and object_type=’TABLE’;

Hope you can use these queries to get information about update,insert or delete time or modification time for that table.

Amit S

Oracle Consultant with vast experience in Oracle BI and PL/SQL Development. Amiet is the admin head of this website who contributes by preparing tutorials and articles related to database technologies. He is responsible to manage the content and front-end of the website.

Recent Posts

What is mean by SLA ( Service Level Agreement) with Examples?

In my previous articles i have given the hierarchy of production support in real company…

10 hours ago

What is Production support Hierarchy in organization?

In this article i would like to provide information about production support organization structure or…

11 hours ago

What are roles and responsibilities for L3 Support Engineer?

In my previous article I have given roles for L1 and L2 support engineer with…

12 hours ago

What are roles and responsibilities of L2 Engineer?

I have started this new series of how to become application support engineer. This article…

14 hours ago

What are Roles and Responsibilities of L1 Support Engineer with real industry examples?

In this series we are starting with Roles and responsibilities of L1 support engineer .…

15 hours ago

The Essential Guide to Cryptocurrency Exchange Platform Development for Beginners and Beyond

Introduction Cryptocurrencies took the world by storm, setting up a new financial system and breaking…

12 months ago