Lorik Berisha
Lorik Berisha

Reputation: 273

Does TOAD for oracle generate logs of executed SQL?

I cannot seem to find a view which I created in one of my schemas within TOAD. Lets assume I don't know the exact schema in which I've created it, is there any way where I can find all the create statements which have been executed within a period of time, lets say the last days.

Thank you in advance.

Upvotes: 0

Views: 3946

Answers (2)

Gary_W
Gary_W

Reputation: 10360

You might be looking for a feature called "SQL Recall" in Toad. Press F8 or View/SQL Recall. It will show you the last 500 (by default) queries you ran.

Upvotes: 0

thatjeffsmith
thatjeffsmith

Reputation: 22457

If you created the view, just query ALL the views, and order by the date in which it was created.

select * from dba_objects
where object_type = 'VIEW'
order by created desc, last_ddl_time desc

We're hitting DBA_ views to make sure we look at EVERYTHING, not just the things you have PRIVS for. Switch to ALL_ views in case you lack access, and hope you didn't create the view in a schema in which your current logon can't see.

The other way to go is query the views themselves and key in on the table you think you included in the SQL behind the view.

SELECT *
  FROM dba_views
 WHERE UPPER (text_vc) LIKE '%EMPLOYEES%';

Upvotes: 1

Related Questions