Procedure

Tuning de Banco, Tuning de SQL, Ferramentas de tuning
Post Reply
danielpbarros
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 67
Joined: Sun, 15 Jan 2012 9:34 pm
Contact:
Daniel Barros

Good afternoon,

I could get a command to know how many times a procedure x was executed?

Hugs.
ruibarros
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 93
Joined: Thu, 29 Jan 2009 11:44 am
Location: Cuiabá
Rui Barros
OCP - Oracle Certified Professional

Hello Daniel,
Until where I know, can not ... The ideal was you create a log table, and at the beginning of the procedure put an insert or something to go by making a sum, or an accountant.

Maybe a trigger also helps ... It depends on each case ...

Embrace.
leandromiranda87
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 43
Joined: Tue, 20 Mar 2012 11:37 am
Location: Campinas
Leandro L. Miranda

The idea of ??Daniel is muito good, but I do not think Trigger is a good. Since it is a procedure, the code with the update of the log table could be at the end of the procedure ..: D
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Brother,

Take a look at these links below, perhaps helps you in the question:
[[0] http://asktom.oracle.com/pls/asktom/f?p ... 0346667213 Any questions, send there to people.
User avatar
heraldoaraujo
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 41
Joined: Sun, 19 Feb 2012 12:10 pm

Creates an Oracle audit.
Audit execute procedure on schema.procedure by Access Whenever Successful

I think that's it.
User avatar
fbifabio
Moderador
Moderador
Posts: 199
Joined: Tue, 22 Feb 2011 1:51 pm
Location: São Paulo - SP
Contact:
Fábio Prado
www.fabioprado.net

Danielpbaros,

It is possible to know easily qtas sometimes a procedure was performed, if the procedure is still in oracle memory (sgg).

follows a query that you can run to see this eq I explain in detail in my Tuning SQL training:

Select all

select        a.sql_id, 
                      u.username, 
                      sc.username as schemaname,                       
                      a.executions,                        
                      a.cpu_time/(1000000) "cpu_time (s)", 
                      a.disk_reads, 
                      a.elapsed_time/(1000000) "elapsed_time (s)", 
                      (a.sharable_mem + a.persistent_mem + a.runtime_mem) /1024/1024 "used_memory (mb)", 
                      a.first_load_time, 
                      TO_CHAR(a.last_load_time,'dd/mm/yy HH24:mi:ss') last_load_time, 
                      a.buffer_gets, 
                      a.sorts, 
                      a.loads, 
                      a.application_wait_time/(1000000) "application_wait_time (s)", 
                      a.concurrency_wait_time/(1000000) "concurrency_wait_time (s)", 
                      a.user_io_wait_time/(1000000) "user_io_wait_time (s)", 
                      a.plsql_exec_time/(1000000) "plsql_exec_time (s)", 
                      a.rows_processed, 
                      a.optimizer_mode, 
                      a.optimizer_cost,                       
                      --a.sql_text, 
                      DBMS_LOB.SUBSTR(a.SQL_FULLTEXT, 4000,1) sql_text, 
                      b.value_string 
        from          v$sqlarea a 
        INNER JOIN    dba_users u 
              ON      a.parsing_user_id = u.user_id 
        INNER JOIN    dba_users sc 
              ON      A.PARSING_SCHEMA_ID = SC.USER_ID 
        INNER JOIN    v$sql_bind_capture b 
              ON      a.address = b.address 
              AND     a.hash_value = b.hash_value;

99]] [] S

Fábio Prado www.fabioprado.net
danielpbarros
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 67
Joined: Sun, 15 Jan 2012 9:34 pm
Contact:
Daniel Barros

Thanks for the response.
Fábio's Select helped me a lot.

ABS.
Daniel.
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest