Oracle资料--自用

性能优化
http://database.ctocio.com.cn/110/12195110.shtml

http://database.51cto.com/art/200904/118526.htm

http://database.ctocio.com.cn/7/12200007.shtml
http://database.ctocio.com.cn/9/12200009.shtml
http://database.ctocio.com.cn/10/12200010.shtml

http://database.ctocio.com.cn/102/12198602.shtml

http://www.iteye.com/topic/19464
信息系统访问量又不大,瓶颈一般不会出现在应用层,极有可能在数据库这一层,不用急着看程序。先找出逻辑读取次数最多的SQL,硬盘读取次数最多的SQL,找到SQL,对于SQL进行优化。看看有没有发生全表扫描的地方。
一般发生全表扫描,极有可能是没有建立合理的索引,或者索引由于左边引用函数或其它原因造成索引失效。
对于运行一年多的系统,最好要自己写一个自动重建索引的程序,定时重建索引。
或者使用TOAD工具帮你重建索引。

另外在看一下数据库的CPU占用率,如果占用率在经常在80%-100%,那一定要是SQL或存储过程及trigger中写的不好。

不需要从应用层找SQL,方向性错误,太累,也看不出效果。
而应当使用pl/SQL, toad等工具,分析出最bad的SQL语句,一看到这些语句后,再修改应用层的查询就是了。又快又方便。



-- 逻辑读多的SQL
select * from (select buffer_gets, sql_text
from v$sqlarea
where buffer_gets > 500000
order by buffer_gets desc) where rownum<=30;

-- 执行次数多的SQL   
  select sql_text,executions from
  (select sql_text,executions from v$sqlarea order by executions desc)
   where rownum<81;

-- 读硬盘多的SQL 
  select sql_text,disk_reads from
  (select sql_text,disk_reads from v$sqlarea order by disk_reads desc)
   where rownum<21;    

-- 排序多的SQL   
  select sql_text,sorts from
   (select sql_text,sorts from v$sqlarea order by sorts desc)
    where rownum<21;           
 
--分析的次数太多,执行的次数太少,要用绑变量的方法来写sql
set pagesize 600;
set linesize 120;
select substr(sql_text,1,80) "sql", count(*), sum(executions) "totexecs"
   from v$sqlarea
   where executions < 5
   group by substr(sql_text,1,80)
   having count(*) > 30
   order by 2;


Oracle数据库优化器的优化方式
http://database.ctocio.com.cn/397/12119397.shtml

SQL条件的顺序对数据库性能的影响
http://database.ctocio.com.cn/396/12119396.shtml


Oracle性能优化:drop table与db cache
http://database.ctocio.com.cn/497/12182497.shtml



事物隔离
http://database.ctocio.com.cn/480/12201980.shtml


删除重复
http://database.ctocio.com.cn/32/12201032.shtml

Oracle数据库索引的优点与缺点的描述
http://database.ctocio.com.cn/116/12198616.shtml
ORACLE PL/SQL编程之把过程与函数说透
http://database.ctocio.com.cn/152/12139152.shtml
ORACLE PL/SQL编程之把触发器说透
http://database.ctocio.com.cn/447/12139947.shtml
Oracle存储过程(增、删、改)写法
http://database.ctocio.com.cn/299/11476299.shtml

Oracle数据库自治事务详解
http://database.ctocio.com.cn/454/12137454.shtml

如何为数据库中的表和列取一个好名字?
http://database.ctocio.com.cn/135/11668135.shtml


Oracle数据库中数据如何存储
http://database.ctocio.com.cn/103/11498103.shtml

猜你喜欢

转载自xiaoyufu007.iteye.com/blog/1329706
今日推荐