利用dbms_system包SET_SQL_TRACE_IN_SESSION开启sql跟踪
select name,value, ISSYS_MODIFIABLE from v$parameter where name like'%sga%'; 查看参数更改是否立即生效
select sid, SERIAL#,username from v$session; 查看会话
select sid, SERIAL#,username from v$session;
153 15 SCOTT
desc dbms_systems
execute dbms_system.SET_SQL_TRACE_IN_SESSION(153,15,true); 启动sq跟踪
select s.sid,s.serial#,s.username,p.spid 根据sid, SERIAL#查询spid
from v$session s,v$process p
where s.paddr=p.ADDR
/
根据显示的spid到C:\oracle\product\10.2.0\admin\orcl\udump中找文件orcl_ora_2020.trc
C:\Documents and Settings\Administrator>tkprof
C:\Documents and Settings\Administrator>tkprof C:\oracle\product\10.2.0\admin\orcl\udump\orcl_ora_2020.trc c:\t1.txt 利用tkprof反编译跟踪文件