select * from dba_hist_snapshot --awr快照,可以通过一个脚本来生成awr报告,生成报告必须用sys用户登录
1级 37条性能差sql
2级 55条性能差sql
SQL> show user
USER 为 "SYS"
SQL> @ C:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\awrrpt.sql
Type Specified: html --text/enter 保存格式。html 保存 sql host 显示的cmd路径下
select * from dba_hist_buffer_pool_stat order by snap_id
DB_BLOCK_GETS CONSISTENT_GETS PHYSICAL_READS
4787 51490 4785
16394 153248 73123
22520 178914 73661
1376 44620 4529
16146 119773 34632
22701 137859 35737
select snap_id,round(100*(a.DB_BLOCK_GETS+a.CONSISTENT_GETS)/(a.DB_BLOCK_GETS+a.CONSISTENT_GETS+a.PHYSICAL_READS),2)
from dba_hist_buffer_pool_stat a order by snap_id --命中率计算方式
awr报告 --automatic workload repository
SQL ordered by Gets
SQL ordered by Reads --磁盘上读了多少块
SQL ordered by Executions --执行次数
SQL ordered by Parse Calls --解析次数
Top 5 Timed Events --top 5等待事件
addm --automatic database diagnostic monitor 告诉我们问题在哪里
SQL> exec dbms_workload_repository.create_snapshot; --手动生成快照
PL/SQL 过程已成功完成。
SQL> @ C:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\addmrpt.sql;
sql tuning --sql 优化
troubleshoot --故障排除
select * from v$bgprocess where paddr<>'00' --paddr不等于0的后台进程
DBW0
LGWR
CKPT
select * from v$log
第四天4-4】【生成awr报告】【addm】
最新推荐文章于 2024-11-18 14:36:14 发布