[PT]使用跟踪事件10046
为了方便查阅,记录在此zz from 王朝网络链接: http://www.wangchao.net.cn/bbsdetail_147873.html很多时候,对数据库进行性能诊断可以使用SQL跟踪的方法,把一些信息记录在trace文件里以后分析。一般情况下我们可以通过初始化参数SQL_TRACE=TRUE来设置SQL跟踪。 我们也可以通过设置10046事件来进行SQL跟踪,并且可以设置不同的跟踪级别,比使用SQL_TRACE获得更多的信息。 Level 0 停用SQL跟踪,相当于SQL_TRACE=FALSE Level 1 标准SQL跟踪,相当于SQL_TRACE=TRUE Level 4 在level 1的基础上增加绑定变量的信息 Le
[PT]Tracing SQL in Oracle Database 10g
Tracing SQL in Oracle Database 10g By Kimberly Floss New tools help you better understand the performance of your applications. In a busy production environment with many active users, tracing a SQL session is time-consuming and complicated, because processing SQL statements in any multitier system that uses a connection pool can span multiple processes, or even different instances. With Oracle Database 10g, Oracle rationalizes SQL tracing through a new built-in package, DBMS_MONITOR, which enco
[PT]Something about Optimizer Statistics
1. DBMS_STATS gathers only statistics needed for optimization; it does not gather other statistics. For example, the table statistics gathered by DBMS_STATS include the number of rows, number of blocks currently containing data, and average row length, but not the number of chained rows, average free space, or number of unused data blocks.2. Oracle Database automatically collects index statistics whenever an index is created or rebuilt. Exceptions are domain indexes, or indexes created while the
[PT]Sort Operations
学习Sort Operations的时候希望能看到一些更详细的内容,去google了一把,于是又找到了wanghai的这篇文章,摘录在此。最近摘录了很多别人的文章,但是在阅读这些文章的过程中感觉到自己学到了很多东西,每天都在进步。虽然求职的道路很漫长也很艰难,但是我相信只要我持续地努力,不放下技术,总有成功的一天。oracle sort 系列一作者:wanghai链接:http://wzwanghai.spaces.live.com/blog/cns!56626E237AFBD116!156.entry相信做oracle开发和管理的朋友对sort肯定不会陌生,大家通常都遇到这样那样的排序性能问题,所以我写这一系列关于s
[PT]Parameters related to Performance Tuning
前几天面试时的一个问题,除了内存相关参数外,还有哪些参数和性能相关。当时只说出了第二个。今天看SQL TUNING时刚好看到相关内容,因此在这里列出一些。虽然这些参数一般取默认值即可,不过还是有必要了解一下。CURSOR_SHARINGCURSOR_SHARING determines what kind of SQL statements can share the same cursors. The default value is EXACT.Values:FORCEForces statements that may differ in some literals, but are otherwise identical, to share a cursor, unless the literals affect the meaning of the statement.SIMILARCaus
[PT]Column Histogram Statistics
(The descirption is from Oracle Document: Performance Tuning)Column statistics may be stored as histograms. These histograms provide accurate estimates of the distribution of column data. Histograms provide improved selectivity estimates in the presence of data skew, resulting in optimal execution plans with nonuniform data distributions.Oracle uses two types of histograms for column statistics: height-balanced histograms and frequency histograms. The type of histogram is stored in the HISTOGRAM
[PT]and_equal、index_join&index_combine(zz from wanghai)
今天学习了三种利用索引关联来访问数据的方法,记录在此。and_equal,index_join,index_combine这三种都是oracle利用索引关联获得数据的方法,三者的目的都是为了最大限度的利用索引,减少回表的代价.但是三者的实现方法是有区别的,下面一一来分析.and_equal:这种方式需要查询条件里面包括所有索引列,然后取得每个索引中得到的rowid列表,然后对这些列表做merge join,过滤出相同的rowid后再去表中获取数据或者直接从索引中获得数据.and_equal有一些限制,比如它只对单列索引有效,只对非唯一索引有效,使用到的索引不能超过5个,查询条件只能是”=
[PT]EXIST versus IN
zz from 蓝精灵oracle中in与exists的效率比较效率比较:select * from t1 where x in ( select y from t2 )事实上可以理解为:select * from t1, ( select distinct y from t2 ) t2 where t1.x = t2.y如果你有一定的SQL优化经验,从这句很自然的可以想到t2绝对不能是个大表,因为需要对t2进行全表的“唯一排序”,如果t2很大这个排序的性能是不可忍受的。但是t1可以很大,为什么呢?最通俗的理解就是因为t1.x=t2.y可以走索引。但这并不是一个很好的解释。试想,如果t1.x和t2.y都有索引,我们知道索引是种有序的结构,因此t1和t2之间最佳的