Forum Stats

  • 3,783,352 Users
  • 2,254,762 Discussions
  • 7,880,372 Comments

Discussions

Determine an procedure's/function's last execution timestamp?

Nuerni
Nuerni Member Posts: 97
edited Nov 12, 2008 6:40AM in SQL & PL/SQL
Hi,

Is it possible to get the last timestamp (absolute date and time) of an procedure's/function's (in packages) execution?

Answers

  • Karthick2003
    Karthick2003 Member Posts: 13,711 Bronze Badge
    You can try using v$sql. But data is not persistent there.
    SQL> create or replace procedure my_test_proc
      2  as
      3     l dual.dummy%type;
      4  begin
      5     select dummy into l from dual;
      6  end;
      7  /
    
    Procedure created.
    
    SQL> exec my_test_proc
    
    PL/SQL procedure successfully completed.
    
    
    SQL> select first_load_time,last_load_time,sql_text from v$sql where lower(sql_text) like '%my_test_proc%
      2  /
    
    FIRST_LOAD_TIME     LAST_LOAD_TIME
    ------------------- -------------------
    SQL_TEXT
    ---------------------------------------------------------------------------------------------------------
    ----------------------------------------------------------------------------------------------------
    2008-11-12/17:04:06 2008-11-12/17:04:06
    BEGIN my_test_proc; END;
  • Boneist
    Boneist Member Posts: 4,983 Gold Trophy
    Not unless you're recording it somewhere, or perhaps there's some auditing going on.
This discussion has been closed.