Home > Database > Mysql Tutorial > ORACLE 11g开启跟踪并查看跟踪文件

ORACLE 11g开启跟踪并查看跟踪文件

WBOY
Release: 2016-06-07 15:24:58
Original
1099 people have browsed it

今天做了一个实验,测试oracle 11g 删除数据,并查看跟踪文件执行了哪些内容。 STEP1:准备环境,插入数据 SQL create table t2 as select object_id,object_name from dba_objects where rownum100; STEP2:开启当前会话的跟踪 -- 在 session 名称上加上跟

今天做了一个实验,测试oracle 11g 删除数据,并查看跟踪文件执行了哪些内容。


STEP1:准备环境,插入数据

SQL> create table t2 as select object_id,object_name from dba_objects where rownum<br>
STEP2:开启当前会话的跟踪


<pre class="brush:php;toolbar:false">-- 在 session 名称上加上跟踪标记,方便查找 trace 文件
SQL> alter session set tracefile_identifier='my_session_trace';    

--启用当前 session 的跟踪
SQL> alter session set sql_trace=true;   

--查看用户跟踪文件 trace 的目录
SQL> show parameter user_dump;
Copy after login

ORACLE 11g开启跟踪并查看跟踪文件


SETP:删除数据,查看跟踪文件:
SQL> delete from t2;

99 rows deleted.

SQL> commit;

Commit complete.
Copy after login
ORACLE 11g开启跟踪并查看跟踪文件

下图是截取的delete和commit  的trace内容:

ORACLE 11g开启跟踪并查看跟踪文件

OK,下面可以看看delete语句跟踪出来的信息,可以对跟踪文件进行分析了。


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template