Flash Cache

From Tom's notes
Jump to navigation Jump to search

Enable flash cache:

alter system set db_flash_cache_file='/flash/cache.dbf' scope=spfile;
alter system set db_flash_cache_size=10G scope=spfile;

Prevent flash cache from turning off due to small interruption:

alter system set _db_flash_cache_max_latency=200;
alter system set _db_flash_cache_max_slow_io=10000;

In case flash cache is turned off due to a latency error, it can be re-enabled by setting the size to 0 (disabling flash cache), then setting the size back to the old setting. Online resizing of flash cache is not supported so only values 0 and the old value are valid settings.

Show contents of Flash cache:

SELECT /*+ use_hash(o bh) */
       owner
     , object_name
     , object_type
     , count(1) * &block_size / 1048576 / 1024 "Size (GB)"
  FROM dba_objects o
     , v$bh bh
 WHERE o.data_object_id  = bh.objd
   AND bh.status IN ('flashcur')
 GROUP BY owner, object_name, object_type
 ORDER BY count(1) desc;

Size of flash cache:

SELECT count(1) * &block_size / 1048576 / 1024 "Size (GB)"
  FROM v$bh bh
 WHERE bh.status IN ('flashcur');