Scripts:查询db_block_buffer使用率的脚本perf_db_block_buffer_usage.sql
2014-05-30 09:04
513 查看
-- +----------------------------------------------------------------------------+
-- | Jeffrey M. Hunter |
-- | jhunter@idevelopment.info |
-- | www.idevelopment.info |
-- |----------------------------------------------------------------------------|
-- | Copyright (c) 1998-2011 Jeffrey M. Hunter. All rights reserved. |
-- |----------------------------------------------------------------------------|
-- | DATABASE : Oracle |
-- | FILE : perf_db_block_buffer_usage.sql |
-- | CLASS : Tuning |
-- | PURPOSE : Report on the state of all DB_BLOCK_BUFFERS. This script must |
-- | be run as the SYS user. |
-- | NOTE : As with any code, ensure to test this script in a development |
-- | environment before attempting to run it in production. |
-- +----------------------------------------------------------------------------+
SET LINESIZE 135
SET PAGESIZE 9999
SET VERIFY off
COLUMN block_status HEADING "Block Status"
COLUMN count HEADING "Count"
SELECT
DECODE(state, 0, 'Free',
1, DECODE(lrba_seq, 0, 'Available', 'Being Modified'),
2, 'Not Modified',
3, 'Being Read',
'Other') block_status
, count(*) count
FROM
sys.x$bh
GROUP BY
DECODE(state, 0, 'Free',
1, DECODE(lrba_seq, 0, 'Available', 'Being Modified'),
2, 'Not Modified',
3, 'Being Read',
'Other')
/
-- | Jeffrey M. Hunter |
-- | jhunter@idevelopment.info |
-- | www.idevelopment.info |
-- |----------------------------------------------------------------------------|
-- | Copyright (c) 1998-2011 Jeffrey M. Hunter. All rights reserved. |
-- |----------------------------------------------------------------------------|
-- | DATABASE : Oracle |
-- | FILE : perf_db_block_buffer_usage.sql |
-- | CLASS : Tuning |
-- | PURPOSE : Report on the state of all DB_BLOCK_BUFFERS. This script must |
-- | be run as the SYS user. |
-- | NOTE : As with any code, ensure to test this script in a development |
-- | environment before attempting to run it in production. |
-- +----------------------------------------------------------------------------+
SET LINESIZE 135
SET PAGESIZE 9999
SET VERIFY off
COLUMN block_status HEADING "Block Status"
COLUMN count HEADING "Count"
SELECT
DECODE(state, 0, 'Free',
1, DECODE(lrba_seq, 0, 'Available', 'Being Modified'),
2, 'Not Modified',
3, 'Being Read',
'Other') block_status
, count(*) count
FROM
sys.x$bh
GROUP BY
DECODE(state, 0, 'Free',
1, DECODE(lrba_seq, 0, 'Available', 'Being Modified'),
2, 'Not Modified',
3, 'Being Read',
'Other')
/
相关文章推荐
- Scripts:查询sga中各组件使用率的脚本perf_sga_usage.sql
- Scripts:查询每个session命中率的脚本perf_hit_ratio_by_session.sql
- Scripts:找出使用最多buffer get的SQL脚本perf_top_sql_by_buffer_gets.sql
- Scripts:查询数据文件IO使用率的脚本 perf_file_io.sql
- Scripts:查询每个数据文件等待时间的脚本perf_file_waits.sql
- Scripts:查询每个数据文件使用效率的脚本perf_file_io_efficiency.sql
- Scripts:查询library cache lock和hang的脚本library_cache_locks_pins.sql
- Scripts:查询log file sync 等待的脚本lfsdiag.sql
- Scripts:查询等待事件的SQL脚本owi_event_names.sql
- Scripts:报告物理数据库增长情况(注意脚本是看你数据库添加数据文件的时间哦)dba_db_growth.sql
- Scripts:查询参数信息的脚本parms.sql
- Scripts:查询没有统计信息的对象perf_objects_without_statistics.sql
- Scripts:查看数据文件使用率的脚本(包括临时表空间的文件哦)dba_file_space_usage.sql
- Scripts:找出使用最高的10个表的脚本perf_top_10_tables.sql
- Scripts:找出磁盘读最多的SQL的脚本 perf_top_sql_by_disk_reads.sql
- Scripts:查询物理读最多的10个SQL的脚本hphy10.sql
- Scripts:根据sid,ospid来查询进程信息的脚本os_pid.sql
- Scripts:查询所有参数修改信息的脚本parm_mods.sql
- Scripts:查询回滚段信息的脚本rollback_segments.sql
- sql脚本查询所有数据库表名