Here I am giving an example to fetch recently created tables in oracle database.
Query 1: All tables accessible to the current user in Oracle database that were created within the last 30 days.
SELECT owner AS schema_name,
object_name AS table_name,
created
FROM sys.all_objects
WHERE object_type = 'TABLE'
-- excluding some Oracle maintained schemas
AND owner NOT IN ('ANONYMOUS','CTXSYS','DBSNMP','EXFSYS', 'LBACSYS',
'MDSYS', 'MGMT_VIEW','OLAPSYS','OWBSYS','ORDPLUGINS',
'ORDSYS','OUTLN', 'SI_INFORMTN_SCHEMA','SYS','SYSMAN',
'SYSTEM', 'TSMSYS','WK_TEST','WKSYS', 'WKPROXY','WMSYS',
'XDB','APEX_040000', 'APEX_PUBLIC_USER','DIP', 'FLOWS_30000',
'FLOWS_FILES','MDDATA', 'ORACLE_OCM', 'XS$NULL',
'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', 'PUBLIC')
AND created > SYSDATE - 30
ORDER BY created DESC,
owner,
object_name;
Query 2: All tables in Oracle database that were created within the last 30 days. (If you have privilege on dba_objects)
SELECT owner AS schema_name,
object_name AS table_name,
created
FROM sys.dba_objects
WHERE object_type = 'TABLE'
-- excluding some Oracle maintained schemas
AND owner NOT IN ('ANONYMOUS','CTXSYS','DBSNMP','EXFSYS',
'LBACSYS', 'MDSYS', 'MGMT_VIEW','OLAPSYS',
'OWBSYS','ORDPLUGINS', 'ORDSYS','OUTLN',
'SI_INFORMTN_SCHEMA','SYS','SYSMAN','SYSTEM',
'TSMSYS','WK_TEST','WKSYS', 'WKPROXY','WMSYS',
'XDB','APEX_040000', 'APEX_PUBLIC_USER','DIP',
'FLOWS_30000','FLOWS_FILES','MDDATA', 'ORACLE_OCM',
'XS$NULL', 'SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR',
'PUBLIC')
AND created > SYSDATE - 30
ORDER BY created DESC,
owner,
object_name;
Output:
Happy APEXing!!!...
Comments
Post a Comment