Sunday, February 28, 2010

What's Happening - if flash cache file corrupt

This is something, I wish to know. if flash cache file corrupt.
Question: What's happening - if flash cache file has the problem(corrupt)?

Flash Cache parameters.
SQL> show parameter db_flash_cache_file

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_flash_cache_file string /dev/sdc

SQL> show parameter db_flash_cache_size

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_flash_cache_size big integer 20G
Number of database blocks in flash cache script.
SELECT
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
/
- Check on flash cache file.
$ dd if=/dev/sdc count=1024 | strings
Oracle RDBMS Flash Cache File
orcl
1024+0 records in
1024+0 records out
- Check database blocks in flash cache.
FLASH_BLOCKS CACHE_BLOCKS TOTAL_BLOCKS
------------ ------------ ------------
1352 3417 4769
A. Test To Destroy Flash Cache File.
$ dd if=/dev/zero of=/dev/sdc bs=4k count=10000
10000+0 records in
10000+0 records out
40960000 bytes (41 MB) copied, 0.044147 seconds, 928 MB/s
$ dd if=/dev/sdc count=1024 | strings
1024+0 records in
1024+0 records out
Flash Cache File corrupt.

- Check Alert Log File.
Sun Feb 28 22:33:59 2010
Encounter problem verifying flash cache /dev/sdc. Disable flash cache and issue an ORA-700 for diagnostics
Errors in file /u01/app/diag/rdbms/orcl/orcl/trace/orcl_gen0_9755.trc (incident=71223):
ORA-00700: soft internal error, arguments: [kcbl2vfyfh_action], [db_flash_cache_file integrity check failed], [], [], [], [], [], [], [], [], [], []
Incident details in: /u01/app/diag/rdbms/orcl/orcl/incident/incdir_71223/orcl_gen0_9755_i71223.trc
Sun Feb 28 22:33:59 2010
L2 cache file closed by dbwr 0
L2 cache disabled for dbwr 0
Sun Feb 28 22:33:59 2010
Sweep [inc][71223]: completed
Sweep [inc2][71223]: completed
- Check database blocks in flash cache.
FLASH_BLOCKS CACHE_BLOCKS TOTAL_BLOCKS
------------ ------------ ------------
0 3412 3412
B. Test DML on table.
SQL> update tb_test01 set object_id=101;
- Check Alert Log File.
Nothing Error
- Check flash cache file.
$ dd if=/dev/sdc count=1024 | strings
1024+0 records in
1024+0 records out
- Check database blocks in flash cache.
FLASH_BLOCKS CACHE_BLOCKS TOTAL_BLOCKS
------------ ------------ ------------
0 3412 3412
The flash cache is disabled, So database could not use flash cache.

C. Solve this issue.
SQL> show parameter db_flash_cache_size

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_flash_cache_size big integer 20G

SQL> alter system set db_flash_cache_size=20G;

System altered.

SQL> show parameter db_flash_cache_size

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_flash_cache_size big integer 20G
- Check Alert Log File.
Sun Feb 28 22:36:47 2010
Dynamically re-enabling flash cache db_flash_cache_file (/dev/sdc) to size 21474836480
ALTER SYSTEM SET db_flash_cache_size='20G' SCOPE=BOTH;
- Check flash cache file
$ dd if=/dev/sdc count=1024 | strings
Oracle RDBMS Flash Cache File
orcl
1024+0 records in
1024+0 records out
- Check database blocks in flash cache
FLASH_BLOCKS CACHE_BLOCKS TOTAL_BLOCKS
------------ ------------ ------------
1877 3437 5314
Answer: The Flash Cache is disabled, If Flash Cache File has the problem.

No comments: