- 浏览: 1150622 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (411)
- Java Foundation (41)
- AI/机器学习/数据挖掘/模式识别/自然语言处理/信息检索 (2)
- 云计算/NoSQL/数据分析 (11)
- Linux (13)
- Open Source (12)
- J2EE (52)
- Data Structures (4)
- other (10)
- Dev Error (41)
- Ajax/JS/JSP/HTML5 (47)
- Oracle (68)
- FLEX (19)
- Tools (19)
- 设计模式 (4)
- Database (12)
- SQL Server (9)
- 例子程序 (4)
- mysql (2)
- Web Services (4)
- 面试 (8)
- 嵌入式/移动开发 (18)
- 软件工程/UML (15)
- C/C++ (7)
- 架构Architecture/分布式Distributed (1)
最新评论
-
a535114641:
LZ你好, 用了这个方法后子页面里的JS方法就全不能用了呀
页面局部刷新的两种方式:form+iframe 和 ajax -
di1984HIT:
学习了,真不错,做个记号啊
Machine Learning -
赵师傅临死前:
我一台老机器,myeclipse9 + FB3.5 可以正常使 ...
myeclipse 10 安装 flash builder 4.6 -
Wu_Jiang:
触发时间在将来的某个时间 但是第一次触发的时间超出了失效时间, ...
Based on configured schedule, the given trigger will never fire. -
cylove007:
找了好久,顶你
Editable Select 可编辑select
Oracle: 三个内置的性能工具包 Explain plan、Autotrace、Tkprof:
http://vitas08xy.blog.sohu.com/108168502.html
Oracle EXPLAIN PLAN 执行计划
Using EXPLAIN PLAN:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/ex_plan.htm#PFGRF009
通过分析SQL语句的执行计划优化SQL(总结):
http://www.itpub.net/thread-478999-1-11.html#
Oracle's explain plan:
http://www.adp-gmbh.ch/ora/explainplan.html
Oracle执行计划解释:
http://space.itpub.net/14075938/viewspace-471205
怎样看懂Oracle的执行计划:
http://hi.baidu.com/edeed/blog/item/73c46538d2614d2796ddd864.html
原文:http://kr.forums.oracle.com/forums/thread.jspa?messageID=4537207 以后再找最初的原文
SQLPlus中查看解释计划:
关于dbms_xplan.display:
dbms_xplan是SYS用户的一个package,display是该package下的一个function。
TKPROF
关于tkprof:
TKPROF使用实例:
http://www.blogjava.net/wxqxs/archive/2009/04/12/265343.html
使用TKPROF的一个例子:
http://unix-cd.com/vc/www/16/2010-09/16229.html
Oracle alert.log这个文件放在哪里?
Unix: $ORACLE_BASE/admin/sid/bdump下
Windows: %ORACLE_BASE%/admin/sid/bdump下
另外trace文件在udump文件夹下
Oracle Table Access Methods:
http://www.remote-dba.net/t_op_sql_table_access.htm
How to avoid the full table scan:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9422487749968
How to fetch all the records :
http://forums.oracle.com/forums/thread.jspa?threadID=447344
There's no setting to fetch all records. You wouldn't like SQL Developer to fetch for minutes on big tables anyway.
If, for 1 specific table, you want to fetch all records, you can do Control-End in the results pane to go to the last record. You could time the fetching time yourself, but that will vary on the network speed and congestion, the program (SQL*Plus will be quicker than SQL Dev because it's more simple), etc.
Now, what I think you really want here, is getting the execution time. If you really want to analyze the query's performance, you'd have to use the explain plan, autotrace and tkprof (see the manual for tuning and performance).
To make us life easier, the makers of SQL Developer included support of the explain plan, and as of v1.1, autotrace!
I'm sure you've got enough to work things out from here...
http://vitas08xy.blog.sohu.com/108168502.html
Oracle EXPLAIN PLAN 执行计划
Using EXPLAIN PLAN:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/ex_plan.htm#PFGRF009
通过分析SQL语句的执行计划优化SQL(总结):
http://www.itpub.net/thread-478999-1-11.html#
引用
读笔:
1 初始化参数optimizer_mode::
http://blog.csdn.net/whqcfp/archive/2006/12/05/1430653.aspx google more
2 Oracle 绑定变量:
http://www.ezloo.com/2009/04/oracle_bind_variable.html google more
ACCESS PATH(访问路径/存取路径):
http://space.itpub.net/6517/viewspace-145522
http://lzfhope.blog.163.com/blog/static/6363992201072465310995/
1 初始化参数optimizer_mode::
http://blog.csdn.net/whqcfp/archive/2006/12/05/1430653.aspx google more
2 Oracle 绑定变量:
http://www.ezloo.com/2009/04/oracle_bind_variable.html google more
ACCESS PATH(访问路径/存取路径):
http://space.itpub.net/6517/viewspace-145522
http://lzfhope.blog.163.com/blog/static/6363992201072465310995/
Oracle's explain plan:
http://www.adp-gmbh.ch/ora/explainplan.html
Oracle执行计划解释:
http://space.itpub.net/14075938/viewspace-471205
怎样看懂Oracle的执行计划:
http://hi.baidu.com/edeed/blog/item/73c46538d2614d2796ddd864.html
原文:http://kr.forums.oracle.com/forums/thread.jspa?messageID=4537207 以后再找最初的原文
SQLPlus中查看解释计划:
SQL> explain plan for <需做解释计划的语句>; Explained SQL> select * from table(dbms_xplan.display);
关于dbms_xplan.display:
dbms_xplan是SYS用户的一个package,display是该package下的一个function。
TKPROF
关于tkprof:
引用
You can run the TKPROF program to format the contents of the trace file and place the output into a readable output file. Optionally, TKPROF can also:
Determine the execution plans of SQL statements
Create a SQL script that stores the statistics in the database
TKPROF reports each statement executed with the resources it has consumed, the number of times it was called, and the number of rows which it processed. This information lets you easily locate those statements that are using the greatest resource. With experience or with baselines available, you can assess whether the resources used are reasonable given the work done.
Determine the execution plans of SQL statements
Create a SQL script that stores the statistics in the database
TKPROF reports each statement executed with the resources it has consumed, the number of times it was called, and the number of rows which it processed. This information lets you easily locate those statements that are using the greatest resource. With experience or with baselines available, you can assess whether the resources used are reasonable given the work done.
TKPROF使用实例:
http://www.blogjava.net/wxqxs/archive/2009/04/12/265343.html
使用TKPROF的一个例子:
http://unix-cd.com/vc/www/16/2010-09/16229.html
Oracle alert.log这个文件放在哪里?
Unix: $ORACLE_BASE/admin/sid/bdump下
Windows: %ORACLE_BASE%/admin/sid/bdump下
另外trace文件在udump文件夹下
Oracle Table Access Methods:
http://www.remote-dba.net/t_op_sql_table_access.htm
How to avoid the full table scan:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9422487749968
How to fetch all the records :
http://forums.oracle.com/forums/thread.jspa?threadID=447344
引用
There's no setting to fetch all records. You wouldn't like SQL Developer to fetch for minutes on big tables anyway.
If, for 1 specific table, you want to fetch all records, you can do Control-End in the results pane to go to the last record. You could time the fetching time yourself, but that will vary on the network speed and congestion, the program (SQL*Plus will be quicker than SQL Dev because it's more simple), etc.
Now, what I think you really want here, is getting the execution time. If you really want to analyze the query's performance, you'd have to use the explain plan, autotrace and tkprof (see the manual for tuning and performance).
To make us life easier, the makers of SQL Developer included support of the explain plan, and as of v1.1, autotrace!
I'm sure you've got enough to work things out from here...
发表评论
-
Oracle: minus | in | exists
2012-09-05 13:49 1486解释及例子: MINUS Query: http://www. ... -
一个奇怪的Oracle sql问题
2011-01-13 16:13 1365select A.M,B.N from Table1 A ... -
Oracle Analytic Functions:RANK, DENSE_RANK, FIRST and LAST;PARTITION BY
2010-12-13 17:02 1319Oracle/PLSQL: Rank Function: ht ... -
Oracle Analytic Functions:RANK, DENSE_RANK, FIRST and LAST
2010-12-13 17:02 1268Oracle/PLSQL: Rank Function: ht ... -
Oracle:Collections Records Type %TYPE %ROWTYPE
2010-11-09 22:27 1273PL/SQL Collections and Records: ... -
Oracle Cursor 游标
2010-11-09 20:44 3050Oracle中Cursor介绍: http://www.ite ... -
Oracle 锁机制
2010-09-19 20:12 3725Oracle多粒度封锁机制研究: http://www.itp ... -
Oracle Data Dictionary 数据字典
2010-09-19 16:44 1545Oracle数据字典查阅: http://download.o ... -
Oracle Sign Function
2010-09-17 14:52 1466Oracle/PLSQL: Sign Function: ht ... -
Oracle Built-In Functions: Next_Day and Last_Day
2010-09-16 17:09 1542next_day(date,char): 它用来返回从第一个 ... -
Oracle Procedure 存储过程
2010-09-16 08:36 1365Oracle/PLSQL: Creating Procedur ... -
Oracle Exception Handle 异常处理
2010-09-15 13:00 2091Handling PL/SQL Errors: http:// ... -
关于Oracle数据和对象的导入导出 [转]
2010-09-14 10:25 1273关于Oracle数据和对象的导入导出 [转]: http:// ... -
Oracle jobs(DBMS_JOB and DBMS_SCHEDULER)
2010-07-21 14:14 7828写PL/SQL procedure的时候,一定要写的够健壮、够 ... -
Oracle 各种注释
2010-07-20 14:19 3654为SQL语句添加注释: http://do ... -
Oracle 监听 本地Net服务名 配置
2010-07-20 10:32 1326Oracle数据库配置: http://shupili1410 ... -
[Oracle]Difference between a database and an instance(数据库 实例 区别)
2010-07-20 09:31 1502Difference between a database a ... -
Oracle Bulk Collect
2010-07-16 10:03 1375On BULK COLLECT: http://www.ora ... -
Oracle/PLSQL: FOR Loop 循环语句
2010-07-15 16:43 9355Oracle/PLSQL: FOR Loop: http:// ... -
Oracle Trigger 触发器
2010-06-09 16:37 1824备忘速查: oracle的update insert dele ...
相关推荐
本文将详细介绍两种常用的性能诊断工具——Explain和Tkprof,以及SQL编写时应注意的一些事项。 一、性能诊断工具:Explain的使用方法 Explain是Oracle提供的一种用于分析SQL语句执行计划的工具。通过Explain,我们...
通过工具如`sqlplus`、` tkprof` 或 `autotrace`,我们可以分析SQL的执行计划,找出慢查询并进行优化。例如,使用`EXPLAIN PLAN`可以查看SQL的执行计划,`DBMS_X PLAN DISPLAY`用于获取已执行的计划,而`v$session_...
本文将详细介绍一系列用于提高 SQL 性能的工具和技术,包括 SQL*Plus、EXPLAIN PLAN、AUTOTRACE、TKPROF、Runstats、Statspack、DBMS_PROFILER 以及 JDeveloper。这些工具不仅能够帮助我们理解查询执行的过程,还...
通过工具如Explain Plan或SQL Trace,我们可以分析SQL语句的执行路径和成本,找出可能导致性能问题的因素。 二、索引策略 索引是提高查询速度的重要手段。理解何时创建B树索引、位图索引、函数索引以及全局分区索引...
AUTOTRACE实用程序集成了TKPROF和EXPLAIN PLAN的功能,相比单独使用这两个工具,AUTOTRACE提供了更为便捷的体验。不同于TKPROF需要格式化跟踪文件才能查看执行计划,AUTOTRACE可以在执行SQL语句的同时生成执行计划,...
启用`SQLTRACE`后执行SQL语句,再用`TKPROF`工具对产生的跟踪文件进行格式化,以查看执行计划。 二、执行计划解读 执行计划通常由以下部分组成: 1. **操作符(Operators)**:如全表扫描(Full Table Scan)、...
3. **诊断工具**:使用EXPLAIN PLAN、SQL TRACE、TKPROF和Autotrace来识别和解决性能瓶颈。 综上所述,Oracle数据库优化是一个综合性的过程,涉及设计、代码、内存、I/O、冲突、操作系统等多个层面,通过收集和分析...
- `SQL*Plus的AUTOTRACE`:结合了`EXPLAIN PLAN`和统计信息,方便地进行SQL性能分析。 7. **优化器模式**:Oracle提供了基于规则和成本的两种优化器模式。基于规则的优化器根据固定的规则选择执行路径,而基于成本...
4. **PL/SQL Developer或TOAD工具**:这些开发工具提供了快捷键(如F5或CTRL+E)来快速生成执行计划,本质上也是调用EXPLAIN PLAN功能。 ### 解读执行计划的技巧 解读执行计划时,应遵循“从上到下,由右及左”的...
通过tkprof工具,可以清晰地查看执行计划。 4. **动态性能视图(Dynamic Performance Views)**:如V$SQL和V$SQL_PLAN,可以查询到实时的执行计划信息,无需进行复杂的设置。 ### 执行计划示例分析 在Oracle数据库...
- **使用TkProf工具**:TkProf工具可以用来分析跟踪文件并提供性能报告。 ### 4. 数据库统计信息 - **开启SQL跟踪**:可以使用以下命令来开启SQL跟踪: ```sql ALTER SYSTEM SET SQL_TRACE = TRUE; ``` - **...
§12.8.5 解释计划(Explain Plan)策略 156 §12.8.6 AUTOTRACE 实用程序 157 第13章 数据访问方法 160 §13.1 使用索引的访问方法 161 §13.1.1 何时创建索引 161 §13.1.2 索引列和表达式的选择 161 §13.1.3 选择...
- **STATSPACK**是Oracle提供的一个强大的性能诊断工具集,用于收集和分析性能统计数据。 - 使用**spcreate.sql**脚本创建STATSPACK基础设施。 - 执行**snap;**命令来收集快照数据。 - 使用**spreport.sql**生成...
### 六、SQLTrace与TKPROF:深入分析查询性能 `SQLTrace`是Oracle提供的一个强大的跟踪工具,可以记录SQL语句的执行细节,而`TKPROF`则是用来分析`SQLTrace`输出文件,将复杂的追踪信息转换为易于理解的格式,帮助...
- **评估SQL语句执行效率**:通过`EXPLAIN PLAN`、`SQL Trace`和`TKPROF`、`SQL*Plus AUTOTRACE`以及`Oracle SQL Analyze`等工具,可以深入了解SQL语句的执行计划,识别出性能瓶颈。 - **基于成本的优化(Cost-...
通过`EXPLAIN PLAN INTO table_name`或设置AUTOTRACE(如`SET AUTOTRACE ON`),可以查看执行计划和统计信息,帮助理解查询的执行流程和潜在的性能问题。 在进行Oracle调优时,Tuning Task和Tuning Set也是常用的...