易截截图软件、单文件、免安装、纯绿色、仅160KB

怎么捕获自己session执行的sql,进行深入跟踪

 
alter session set timed_statistics = true; --可选
alter session set max_dump_file_size = unlimited; --可选,防止dump目录放不下
-- To enable the trace event 10046
alter session set events '10046 trace name context forever, level 8';
--设置TRACEFILE_IDENTIFIER参数值,让trace文件包括MyTrace字符,这样找起来方便(这个方法不错!),从8.1.7开始就已经有了
alter session set tracefile_identifier = 'MyTrace';  -- 可选
-- Run your SQL script or program to trace wait event information--
...你的sql...
--To turn off the tracing
alter session set events '10046 trace name context off';
OK, 找到该转储文件localdb_ora_4456_mytrace.trc
再使用tkprof:
C:\> tkprof D:\oracle\product\10.2.0\admin\localdb\udump\localdb_ora_4456_mytrace.trc D:\output.txt
使结果更加可读。如图:
读Oracle Wait Interface: A Practical Guide to Performance Diagnostics & Tuning 有感~


相关文档:

1.The SQL introuduction

Introducing Oracle Database 11g
List the features of Oracle Database 11g
Discuss the basic design, theoretical and physical aspects of a relational database
Categorize the different types of SQL statements
Describe the data set used by the course
Log onto the database using the SQL Develope ......

必备sql语句

 1.读出表中的字段名
ResultSet  rs = test.selectSql("SELECT * from datainfo");  
java.sql.ResultSetMetaData md=rs.getMetaData();   //读出数据库的字段名
   int nColumn=md.getColumnCount();   //字段总数
   for(int i=0;i<nColumn;i++)
& ......

SQL SERVER 2005相关问题

已成功与服务器建立连接,但是在登录前的握手期间发生错误的处理方法
      在用SQL SERVER 用户登陆SQL SERVER 2005时,弹出一个对话框,提示" 已成功与服务器建立连接,但是在登录前的握手期间发生错误",查找了一下原因,原来是SQL SERVER 2005时禁用TCP/IP登陆了,打开SQL SERVER 2005菜 ......

SQL SERVER日期时间函数

 来源http://hi.baidu.com/smilevt/blog/item/04bddeef0fe3f42e2cf5348b.html这里还有很多sql server的帖子
1. 当前系统日期、时间
select getdate()
2. dateadd 在向指定日期加上一段时间的基础上,返回新的 datetime 值
例如:向日期加上2天
select dateadd(day,2,'2004-10-15') --返回:2004-10-17 00:00:00. ......

一个sql分页的存储过程

 CREATE  procedure SqlPager_Ex
 @sqlstr varchar(8000), --查询字符串
  @currentpage int, --第N页
  @pagesize int --每页行数, 
 as
  set nocount on
  declare @P1 int, --P1是游标的id
   @rowcount int
  exec sp_cursorope ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号