怎么捕获自己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 有感~
相关文档:
将Excel文件数据库导入SQL Server的三种方案
//方案一: 通过OleDB方式获取Excel文件的数据,然后通过DataSet中转到SQL Server
openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "Excel files(*.xls)|*.xls";
if(openFileDialog.ShowDialog()==DialogResult.OK)
{
FileInfo ......
http://hi.baidu.com/dumao/blog/item/1cafa71e5886d019413417e4.html
1.全文索引概述
对 Microsoft® SQL Server™ 2000 数据的全文支持涉及两个功能:对字符数据发出查询的能力和创建及维护基础索引以简化这些查询的能力。
全文索引在许多地方与普通的 SQL 索引不同。
普通 SQL 索引全文索引
存储时受 ......
一、加快sql的执行速度
1.select 语句中使用sort,或join
如果你有排序和连接操作,你可以先select数据到一个临时表中,然后再对临时表进行处理。因为临时表是建立在内存中,所以比建立在磁盘上表操作要快的多。
如:
SELECT time_records.*, case_name
from time_records, OUTER cases
WHERE time_re ......
1 PLS_INTEGER
PLS_INTEGER可以存储一个有符号的整形值,其精度范围和BINARY_INTEGER一样,是:-2^31~2^31。
PLS_INTEGER和NUMBER比较起来,其优点是:
1).占有较少的存储空间;
2).可以直接进行算术运算(在NUMBER上不能直接进行算术运算,如果要计算,NUMBER必须先被转换成二进制)。所以在进行算术的时候PLS_INTEGER ......