ORACLE 性能调试 总结中ing

1、分析用户所有的对象:

SELECT 'exec dbms_stats.gather_table_stats(''scms'',''' ||t.TABLE_NAME|| ''',cascade=>TRUE,estimate_percent=>2);'  FROM user_tables t

查询出来的记录,在Commond Window里执行:

exec dbms_stats.gather_table_stats('scms','SCMS_ORG_CODE_DSRIS_BAK',cascade=>TRUE,estimate_percent=>2);

exec dbms_stats.gather_table_stats('scms','BSP_DICTMGR',cascade=>TRUE,estimate_percent=>2);

……

2、调试sql

登录oracle服务器(UNIX、AIX),topas——找到执行最高的PID

然后在pl/sql里执行

select t.sql_text
  from v$process p, v$session s, v$sqltext t
 where p.addr = s.paddr
   and s.sql_hash_value = t.hash_value
   and p.spid = '1990832'--PID
 order by piece asc

 

找到sql语句,然后进行索引等调试。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Database Performance Tuning and Optimization Publisher: Springer | Pages: 510 | 2002-12-13 | ISBN: 0387953930 | PDF | 2 MB Product Description: Examples abound in database applications of well-formulated queries running slowly, even if all levels of the database are properly tuned. It is essential to address each level separately by focusing first on underlying principles and root causes, and only then proposing both theoretical and practical solutions. "Database Performance Tuning and Optimization" comprehensively addresses each level separately by focusing first on underlying principles and root causes, and then proposes both theoretical and practical solutions using Oracle 8i examples as the RDBMS. The book combines theory with practical tools (in the form of Oracle and UNIX shell scripts) to address the tuning and optimization issues of DBAs and developers, irrespective of whether they use Oracle. Topics and features: * An integrated approach to tuning by improving all three levels of a database (conceptual, internal, and external) for optimal performance * Balances theory with practice, developing underlying principles and then applying them to other RDBMSs, not just Oracle * Includes CD-ROM containing all scripts and methods utilized in the book * Coverage of data warehouses provides readers much needed principles and tools for tuning large reporting databases * Coverage of web-based databases * Appendix B shows how to create an instance and its associated database and all its objects * Provides useful exercises, references, and Oracle 8i and select 9i examples Based on nearly two decades of experience as an Oracle developer and DBA, the author delivers comprehensive coverage of the fundamental principles and methodologies of tuning and optimizing database performance. Database professionals and practitioners with some experience developing, implementing, and maintaining relational databases will find the work an essential resource. It is also suitable for professional short courses and self-study purposes.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值