SELECTWe'll see number of database blocks in flash cache.
SUM (CASE WHEN b.status LIKE 'flash%' THEN 1 else 0 END) flash_blocks, SUM
(CASE WHEN b.status LIKE 'flash%' THEN 0 else 1 END) cache_blocks,
count(*) total_blocks
FROM v$bh b
/
FLASH_BLOCKS CACHE_BLOCKS TOTAL_BLOCKSWe see 3132 blocks in flash cache.
------------ ------------ ------------
3132 3427 6559
How to clear database blocks in flash cache?
- Disable Flash Cache
SQL> show parameter db_flash_cache_sizeCheck
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_flash_cache_size big integer 20G
SQL> alter system set db_flash_cache_size=0;
System altered.
SQL> show parameter db_flash_cache_size
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_flash_cache_size big integer 0
FLASH_BLOCKS CACHE_BLOCKS TOTAL_BLOCKS- Flush Buffer Cache
------------ ------------ ------------
0 3427 3427
The FLUSH BUFFER_CACHE clause lets you clear all data from the buffer cache in the system global area (SGA), including the KEEP, RECYCLE, and DEFAULT buffer pools.I'm curious with it, so test & check.
FLASH_BLOCKS CACHE_BLOCKS TOTAL_BLOCKSAlter system...
------------ ------------ ------------
2404 3382 5786
SQL> alter system flush buffer_cache;Check
System altered.
FLASH_BLOCKS CACHE_BLOCKS TOTAL_BLOCKSAfter, I flushed buffer_cache, I don't see database block in flash cache. However I think we should use Disable Flash Cache.
------------ ------------ ------------
0 3382 3382
This is just fun for test system, don't flush buffer cache on production system.
No comments:
Post a Comment