On Aug 20, 4:30 am, "n38i...@gmail.com" <n38i...@googlemail.com>
wrote:
> Hi,
>
> one question:
>
> I an executing a pl/sql script that contains a lot of single small
> SQLs. As stupid example, I use (I know it does nothing):
>
> ----8<-----
>
> DECLARE
>
> v1 varchar2(10);
>
> cursor c1 is select ' ' from dual;
>
> BEGIN
>
> open c1;
>
> WHILE 1=1 LOOP
>    fetch c1 into v1;
> END LOOP;
> END;
>
> ----8<----
>
> While executing, I check on EM the 'Top SQL' and it shows me the
> script as top SQL:
>
> ----8<----
>
> Top SQL
>
> Select  Activity (%) [Sorted in descending order]       SQL ID  SQL Type
>         [CPU (98.02%)] 98.02    au9y515nbqzr0   PL/SQL EXECUTE
>         [CPU (.99%)] .99        b8b5jdj7khuaw   SELECT
>         [CPU (.33%)] .33        g8b5dynmxs5xq   SELECT
>         [CPU (.33%)] .33        ag4n74tn13tkt   SELECT
>         [CPU (.33%)] .33        63uj9rtdp8k2a   SELECT
>
> ----8<----
>
> Does someone know how I can find out the current consuming PL/SQL by
> an ordinary SQL-command without using the EM? Or: Does someone know
> what SQL-Statement the EM is using to create such a result table?
>
> I cannot find any help on the net.
>
> Thanks in advance.
>
> Stefan

set long 50000

select sql_fulltext
from v$sql
where lower(sql_text) like '%begin%'
or lower(sql_text) like '%declare%'
/

There's probably a way to do that with regexp_like but I'm not
familiar with that function.


David Fitzjarrell
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
oracle-plsql-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to