| « | 三月 2010 | » | ||||
|---|---|---|---|---|---|---|
| 一 | 二 | 三 | 四 | 五 | 六 | 日 |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 | ||||
9i有一个新的包 dbms_xplan,对查询plan_table表是一个很有用的工具,相对于以前写一个复杂的SQL语句,然后从plan_table看执行计划,不如调用 dbms_xplan 包,还可以显示格式,这个工具的使用也非常方便。
调用的语法类似
这是ITPUB上的帖子:
http://www.itpub.net/335137.html
1. Jametong
减产前40个字符相同, 有多于5个不同sql版本的sql语句^_^
select substr(sqltext,1,40) sql_text,count(*)
from v$sql
group by substr(sqltext,1,40)
having count(*) >= 5;
在诊断数据库系统性能的过程中,总会涉及到跟踪效率低下的sql语句,现在就如何跟踪sql语句来做一个简单的总结。权做抛砖引玉之用。 查看全文
Like keyword will disable using index when placing a '%' in search words, even there is an index on search column. So we may try other way to improve the performance. Here, what we will do is to setup an "index". Note the quote on index, actually it is not a real index, instead it is a table which contains two columns, one is a column I'll blind search on, the other is rowid related with the 1st column, both are from the original table. Let's see how we do. 查看全文
由于几个方面的原因,开发人员通常会选择不在 PL/SQL 中使用动态 SQL。一个方面的原因是这样做有风险,因为 SQL 语句到运行时期才解析,所以捕获简单语法错误的难度会更大。此外,很多动态 SQL 的尝试都会带来性能问题,简单编写动态 SQL 的复杂性对动态 SQL 也有负面的影响。 查看全文
1 如何修改statspack的脚本产生自定义报表?
2 如何用statspack的报表确定热表及索引?
3 如何用statspack的报表确定keep池与default池的分配?
4 如何用crontab定期产生statspack的报表?
[Q]如果设置自动跟踪
[A]用system登录
执行$ORACLE_HOME/rdbms/admin/utlxplan.sql创建计划表
执行$ORACLE_HOME/sqlplus/admin/plustrce.sql创建plustrace角色
如果想计划表让每个用户都能使用,则
SQL>create public synonym plan_table for plan_table;
SQL> grant all on plan_table to public;
如果想让自动跟踪的角色让每个用户都能使用,则
SQL> grant plustrace to public;
通过如下语句开启/停止跟踪
SET AUTOTRACE ON |OFF
| ON EXPLAIN | ON STATISTICS | TRACEONLY | TRACEONLY EXPLAIN 查看全文
[Q]如果设置自动跟踪
[A]用system登录
执行$ORACLE_HOME/rdbms/admin/utlxplan.sql创建计划表
执行$ORACLE_HOME/sqlplus/admin/plustrce.sql创建plustrace角色
如果想计划表让每个用户都能使用,则
SQL>create public synonym plan_table for plan_table;
SQL> grant all on plan_table to public;
如果想让自动跟踪的角色让每个用户都能使用,则
SQL> grant plustrace to public;
通过如下语句开启/停止跟踪
SET AUTOTRACE ON |OFF
| ON EXPLAIN | ON STATISTICS | TRACEONLY | TRACEONLY EXPLAIN 查看全文
很简单的一次调整,语句加了适当的索引后性能就有大幅的提升。当时看到这条语句的时候,第一感觉就是执行效率肯定低下。语句的功能是求某一客户当天产品的总销量。原来的语句是这样的:
select sum(sl0000) from xstfxps2 where
dhao00 in (
select dhao00 from xstfxps1 where trunc(ywrq00)=trunc(sysdate)
and khdm00='500000003913');
本文为Tim Gorman关于CBO一篇文章的读后感。
主要分为两部分:
1)RBO如何工作的:
工作原理;举例论证;得到的结论
2)CBO如何工作的:
cost的计算;physical and logical I/O的比较;
部分参数的介绍;









