Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

See List of Recently Ran Scripts

Status
Not open for further replies.

cglinn

Programmer
Sep 3, 2003
44
US
Is there a way to retrieve, via SQL,a list of recently ran scripts by name?
 
CG,

Unfortunately, no. The most you can hope for is to see recently executed SQL statements:
Code:
select sql_text from v$sqlarea;
Since the amount of output can be rather sizable, you probably will want to limit the output using some type of WHERE clause:
Code:
select sql_text from v$sqlarea
where rownum <= 3;
Let us know if this alternative provides you with any satisfaction.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)

Do you use Oracle and live or work in Utah, USA?
Then click here to join Utah Oracle Users Group on Tek-Tips.
 
Thank you SantaMufasa. Your information was valuable. However, it doesn't seem like it is showing all the sql statements. I ran a script that contained several statements and only one of them appeared after running this query. The weird thing is, it wasn't the first or the last statement in the script...rather, it was somewhere in the middle.
 
The thing is, it was a script I had just ran 2 minutes prior and there SQL statements that had been ran days ago.
 
CG,

SQL Statements that are in the SQL cache from days ago are ones that are "popular" and have been re-run by subsequent requests. I'm sorry that I have no additional rationale for your recently run SQL not appearing in the cache. If you wish to "see" your SQL in the cache, I suggest you have one window ready to execute the query against V$SQLAREA and another window running the script. Then, the moment you run the script, cause the other window to run the query.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)

Do you use Oracle and live or work in Utah, USA?
Then click here to join Utah Oracle Users Group on Tek-Tips.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top