0

I am new to SQL and I created some views when testing something on a database at work.

Then I realized that I should remove them but I'm not sure that I dropped them all.

Where can I find a list of all(still existing) views created in the last week?

Thanks!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
lazy traveller
  • 105
  • 1
  • 8

1 Answers1

0

Search the USER_OBJECTS to find the view created within specified duration like this:

SELECT *
FROM user_objects
WHERE object_type = 'VIEW'
AND created BETWEEN sysdate - 7 AND sysdate;

If the current user is not the owner of the view, you'll have to use ALL_OBJECTS or DBA_OBJECTS like this:

SELECT *
FROM ALL_OBJECTS 
WHERE object_type = 'VIEW'
AND OWNER = 'SOMEUSER'
AND created BETWEEN sysdate - 7 AND sysdate;
Gurwinder Singh
  • 38,557
  • 6
  • 51
  • 76