How To Identify a Hot Block Within The Database Buffer Cache. [ID 163424.1]
Possible hot blocks in the buffer cache normally can be identified by a high or
rapid increasing wait count on the CACHE BUFFERS CHAINS latch.
This latch is acquired when searching for data blocks cached in the buffer cache.
Since the Buffer cache is implemented as a sum of chains of blocks, each of those
chains is protected by a child of this latch when needs to be scanned. Contention
in this latch can be caused by very heavy access to a single block. This can
require the application to be reviewed.
To solve a hot block, the application maybe need to be reviewed.
By examining the waits on this latch, information about the segment and the
specific block can be obtained using the following queries.
First determine which latch id(ADDR) are interesting by examining the number of
sleeps for this latch. The higher the sleep count, the more interesting the
latch id(ADDR) is:
Run the above query a few times to to establish the id(ADDR) that has the most
consistent amount of sleeps. Once the id(ADDR) with the highest sleep count is found
then this latch address can be used to get more details about the blocks
currently in the buffer cache protected by this latch.
The query below should be run just after determining the ADDR with
the highest sleep count.
Depending on the TCH column (The number of times the block is hit by a SQL
statement), you can identify a hotblock. The higher the value of the TCH column,
the more frequent the block is accessed by SQL statements.
In order to reduce contention for this object the following mechanisms can be put in place:
1) Examine the application to see if the execution of certain DML and SELECT statements
can be reorganized to eliminate contention on the object.
2) Decrease the buffer cache -although this may only help in a small amount of cases.
3) DBWR throughput may have a factor in this as well.
If using multiple DBWR's then increase the number of DBWR's.
4) Increase the PCTFREE for the table storage parameters via ALTER TABLE
or rebuild. This will result in less rows per block.
5) Consider implementing reverse key indexes
(if range scans aren't commonly used against the segment)[@more@]
rapid increasing wait count on the CACHE BUFFERS CHAINS latch.
This latch is acquired when searching for data blocks cached in the buffer cache.
Since the Buffer cache is implemented as a sum of chains of blocks, each of those
chains is protected by a child of this latch when needs to be scanned. Contention
in this latch can be caused by very heavy access to a single block. This can
require the application to be reviewed.
To solve a hot block, the application maybe need to be reviewed.
By examining the waits on this latch, information about the segment and the
specific block can be obtained using the following queries.
First determine which latch id(ADDR) are interesting by examining the number of
sleeps for this latch. The higher the sleep count, the more interesting the
latch id(ADDR) is:
SQL> select CHILD# "cCHILD"
, ADDR "sADDR"
, GETS "sGETS"
, MISSES "sMISSES"
, SLEEPS "sSLEEPS"
from v$latch_children
where name = 'cache buffers chains'
order by 5, 1, 2, 3;
Run the above query a few times to to establish the id(ADDR) that has the most
consistent amount of sleeps. Once the id(ADDR) with the highest sleep count is found
then this latch address can be used to get more details about the blocks
currently in the buffer cache protected by this latch.
The query below should be run just after determining the ADDR with
the highest sleep count.
SQL> column segment_name format a35
select /*+ RULE */
e.owner ||'.'|| e.segment_name segment_name,
e.extent_id extent#,
x.dbablk - e.block_id + 1 block#,
x.tch,
l.child#
from
sys.v$latch_children l,
sys.x$bh x,
sys.dba_extents e
where
x.hladdr = '&ADDR' and
e.file_id = x.file# and
x.hladdr = l.addr and
x.dbablk between e.block_id and e.block_id + e.blocks -1
order by x.tch desc ;
Example of the output :
SEGMENT_NAME EXTENT# BLOCK# TCH CHILD#
-------------------------------- ------------ ------------ ------ ----------
SCOTT.EMP_PK 5 474 17 7,668
SCOTT.EMP 1 449 2 7,668
SEGMENT_NAME EXTENT# BLOCK# TCH CHILD#
-------------------------------- ------------ ------------ ------ ----------
SCOTT.EMP_PK 5 474 17 7,668
SCOTT.EMP 1 449 2 7,668
Depending on the TCH column (The number of times the block is hit by a SQL
statement), you can identify a hotblock. The higher the value of the TCH column,
the more frequent the block is accessed by SQL statements.
In order to reduce contention for this object the following mechanisms can be put in place:
1) Examine the application to see if the execution of certain DML and SELECT statements
can be reorganized to eliminate contention on the object.
2) Decrease the buffer cache -although this may only help in a small amount of cases.
3) DBWR throughput may have a factor in this as well.
If using multiple DBWR's then increase the number of DBWR's.
4) Increase the PCTFREE for the table storage parameters via ALTER TABLE
or rebuild. This will result in less rows per block.
5) Consider implementing reverse key indexes
(if range scans aren't commonly used against the segment)[@more@]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9907339/viewspace-1043538/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- How to Collect Diagnostics for Database Hanging Issues (Doc ID 452358.1)Database
- how webpack Hot Module Replacement worksWeb
- GC Buffer Busy Waits in RAC: Finding Hot BlocksGCAIBloC
- How To Turn SNMP On/Off ? [ID 472530.1]
- SUPTOOL: BBED - 7.3.2+ Database Block Editor(轉)DatabaseBloC
- What is OPAQUE_TRANSFORM Hint and how to Control it [ID 780503.1]OpaqueORM
- Migration Of An Oracle Database Across OS Platforms [ID 733205.1]OracleDatabaseROSPlatform
- rfs (PID:146054): Database mount ID mismatch案例Database
- [20221222]How to Enable and Disable Database Options in oracle 11g.txtDatabaseOracle
- How to Increase CSS Misscount in single instance ASM installations [ID 729878.1]CSSASM
- 【CURSOR】How to Monitor and tune Open and Cached Cursors (Doc ID 1430255.1)
- How to redirect to a specific web page after sign out from Entra IDWeb
- How To Replicate Data from Oracle to Postgres Using GoldenGate (Doc ID 1544137.1OracleGo
- [轉帖]Release Schedule of Current Database Releases (Doc ID 742060.1)Database
- XTTS全備開啟BCT後等待事件 block change tracking buffer spaceTTS事件BloC
- oracle ORA-01157: cannot identify/lock data file 64OracleIDE
- 新CSS偽類:focus-withinCSS
- 神奇的選擇器 :focus-within
- 解析HOT原理
- BlockBloC
- Block學習①--block的本質BloC
- Unused Block Compression和Null Block CompressionBloCNull
- CSS :focus-within 偽類選擇器CSS
- hot100 reviewView
- PostgreSQL DBA(182) - HOTSQL
- __block使用BloC
- How to ssh
- IO之核心buffer----"buffer cache"
- Block學習②--block的變數捕獲BloC變數
- iOS block巢狀block中weakify的使用iOSBloC巢狀
- The database owner SID recorded in the master database differs from the database owner SID recorded in database 'DB_NAME'DatabaseAST
- one-hot編碼
- Discourse Hot 主題功能
- Oracle Database Cloud - Database as a Service Quick StartOracleDatabaseCloudUI
- Error querying database. XXXXXXXXXXXXX, No database selected。ErrorDatabase
- Convert a Physical Standby Database into a Snapshot Standby DatabaseDatabase
- iOS Block探究iOSBloC
- protocol bufferProtocol
- 【node】Buffer