In Oracle, is there a way to find out when a particular table was created?
Similarly, is there a way to find out when a particular row was inserted/last updated?
This question is related to
oracle
oracle11g
database-metadata
Try this query:
SELECT sysdate FROM schema_name.table_name;
This should display the timestamp that you might need.
You can query the data dictionary/catalog views to find out when an object was created as well as the time of last DDL involving the object (example: alter table)
select *
from all_objects
where owner = '<name of schema owner>'
and object_name = '<name of table>'
The column "CREATED" tells you when the object was created. The column "LAST_DDL_TIME" tells you when the last DDL was performed against the object.
As for when a particular row was inserted/updated, you can use audit columns like an "insert_timestamp" column or use a trigger and populate an audit table
You copy and paste the following code. It will display all the tables with Name and Created Date
SELECT object_name,created FROM user_objects
WHERE object_name LIKE '%table_name%'
AND object_type = 'TABLE';
Note: Replace '%table_name%' with the table name you are looking for.
SELECT CREATED FROM USER_OBJECTS WHERE OBJECT_NAME='<<YOUR TABLE NAME>>'
Source: Stackoverflow.com