ITPub博客

首页 > 数据库 > Oracle > Sql Trace

Sql Trace

原创 Oracle 作者:passionwu 时间:2007-01-19 09:43:32 0 删除 编辑
讲述如何跟踪sql语句.[@more@]

Start session trace

ALTER SESSION SET sql_trace = true;

You can also add an identifier to the trace file name for later identification:

ALTER SESSION SET SQL_TRACE=TRUE;
ALTER SESSION SET TRACEFILE_IDENTIFIER=mysqltrace;

Stop session trace

ALTER SESSION SET sql_tarce = false;

Tracing other user's SQL

EXEC DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(sid, serial$, TRUE/FALSE);

Identifying trace files

Trace output is written to the database's UDUMP directory.

The default name for a trace files is INSTANCE_PID_ora_TRACEID.trc where:

  • INSTANCE is the name of the Oracle instance,
  • PID is the operating system process ID (V$PROCESS.OSPID); and
  • TRACEID is a character string of your choosing.

Formating output

The TKProf utility can be used to format trace output

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/60088/viewspace-891600/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-09-08

  • 博文量
    19
  • 访问量
    633017