-
- SQL> create or replace procedure ins_t(p_id in number,p_value in number)
- 2 as
- 3 begin
- 4 insert into t values(p_id,p_value);
- 5 commit;
- 6 end;
- 7 /
-
- Procedure created.
-
- SQL> select sid,serial# from v$session where username='SCOTT';
-
- SID SERIAL#
-
- 1084 938
-
- SQL> exec dbms_monitor.session_trace_enable(session_id=>1084,serial_num=>938);
-
- PL/SQL procedure successfully completed.
-
- SQL> exec ins_t(31,62);
-
- PL/SQL procedure successfully completed.
-
- SQL> exec ins_t(32,64);
-
- PL/SQL procedure successfully completed.
-
- SQL> exec dbms_monitor.session_trace_disable(session_id=>1084,serial_num=>938);
-
- PL/SQL procedure successfully completed.
-
- SQL> SET LINESIZE 180
- SQL> COLUMN trace_file FORMAT A100
- SQL> SELECT s.sid,
- 2 s.serial#,
- 3 p.spid,
- 4 pa.value || '/' || LOWER(SYS_CONTEXT('userenv','instance_name')) ||
- 5 '_ora_' || p.spid || '.trc' AS trace_file
- 6 FROM v$session s,
- 7 v$process p,
- 8 v$parameter pa
- 9 WHERE pa.name = 'user_dump_dest'
- 10 AND s.paddr = p.addr
- 11 AND s.audsid = SYS_CONTEXT('USERENV', 'SESSIONID');
-
- SID SERIAL# SPID TRACE_FILE
-
- 1084 938 10883 /u02/database/CNMMBO/udump/cnmmbo_ora_10883.trc
-
- SQL> SQL>
- SQL> ho pwd
- /users/oracle
-
-
- SQL> ho tkprof /u02/database/CNMMBO/udump/cnmmbo_ora_10883.trc /users/oracle/ins_t.txt explain=goex_admin/goex_admin
-
- TKPROF: Release 10.2.0.3.0 - Production on Fri Sep 9 12:55:18 2011
-
- Copyright (c) 1982, 2005, Oracle. All rights reserved.
-
- SQL> ho cat /users/oracle/ins_t.txt
- ......
- BEGIN ins_t(31,62); END;
- ......
- INSERT INTO T
- VALUES
- (:B2 ,:B1 )
-
- call count cpu elapsed disk query current rows
-
- Parse 0 0.00 0.00 0 0 0 0
- Execute 2 0.11 0.11 2 281 27 2
- .......
|