使用条件:
Oracle Linux或Solaris机器, AWR中建议doule buffer cache, db file sequential read是top wait event.
大小:
2-10倍的buffer cache.不能小于2倍. 如果使用ASMM, 2-10倍的SGA_TARGET
两个参数:
DB_FLASH_CACHE_FILE
Specifies a list of paths and file names for the files to contain the flash cache, in either the operating system file system or an Oracle Automatic Storage Management disk group. If a specified file does not exist, the database creates it during startup. Each file must reside on a flash disk device. If you configure the flash cache on a disk drive (spindle), performance may suffer. A maximum of 16 files is supported.
DB_FLASH_CACHE_SIZE
Specifies the size of each file in the flash cache. Each size corresponds with a file specified in db_flash_cache_file. The files and sizes correspond in the order that they are specified. An error is raised if the number of specified sizes does not match the number of specified files.
Each size specification must be less than or equal to the physical memory size of its flash disk device. The size is expressed as nG, indicating the number of gigabytes (GB). For example, to specify a 16 GB flash cache, set db_flash_cache_size value to 16G.
使用方法:
alter system set db_flash_cache_file = '/dev/raw/sda' scope=spfile;
alter system set db_flash_cache_size = 32G scope=spfile;
将db_flash_cache_size设为0 可以disable flash cache. 再设回来可以enable. 但不允许动态修改db_flash_cache_size的值.
对于RAC的环境, 需要在每个instance上面都设置以上两个参数 并且不能使用同一个file.
Oracle Linux或Solaris机器, AWR中建议doule buffer cache, db file sequential read是top wait event.
大小:
2-10倍的buffer cache.不能小于2倍. 如果使用ASMM, 2-10倍的SGA_TARGET
两个参数:
DB_FLASH_CACHE_FILE
Specifies a list of paths and file names for the files to contain the flash cache, in either the operating system file system or an Oracle Automatic Storage Management disk group. If a specified file does not exist, the database creates it during startup. Each file must reside on a flash disk device. If you configure the flash cache on a disk drive (spindle), performance may suffer. A maximum of 16 files is supported.
DB_FLASH_CACHE_SIZE
Specifies the size of each file in the flash cache. Each size corresponds with a file specified in db_flash_cache_file. The files and sizes correspond in the order that they are specified. An error is raised if the number of specified sizes does not match the number of specified files.
Each size specification must be less than or equal to the physical memory size of its flash disk device. The size is expressed as nG, indicating the number of gigabytes (GB). For example, to specify a 16 GB flash cache, set db_flash_cache_size value to 16G.
使用方法:
alter system set db_flash_cache_file = '/dev/raw/sda' scope=spfile;
alter system set db_flash_cache_size = 32G scope=spfile;
将db_flash_cache_size设为0 可以disable flash cache. 再设回来可以enable. 但不允许动态修改db_flash_cache_size的值.
对于RAC的环境, 需要在每个instance上面都设置以上两个参数 并且不能使用同一个file.
查看db_flash_cache_file 在Oracle中的默认设置
SQL> show parameter db_flash_cache
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_flash_cache_file string
db_flash_cache_size big integer 0
------------------------------------ ----------- ------------------------------
db_flash_cache_file string
db_flash_cache_size big integer 0
设置db_flash_cache_file 的大小
SQL> alter system set db_flash_cache_size=1G scope=spfile;
SQL> alter system set db_flash_cache_size=1G scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL> startup
ORACLE instance started.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL> startup
ORACLE instance started.
Total System Global Area 784998400 bytes
Fixed Size 2232472 bytes
Variable Size 499126120 bytes
Database Buffers 281018368 bytes
Redo Buffers 2621440 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL>
SQL> show parameter db_flash_cache
Fixed Size 2232472 bytes
Variable Size 499126120 bytes
Database Buffers 281018368 bytes
Redo Buffers 2621440 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL>
SQL> show parameter db_flash_cache
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_flash_cache_file string
db_flash_cache_size big integer 0
------------------------------------ ----------- ------------------------------
db_flash_cache_file string
db_flash_cache_size big integer 0
这里我重启后参数设置没有生效,看来还是要设置db_flash_cache_file。
SQL> alter system set db_flash_cache_file='/oracle/app/oracle/flash' scope=spfile;
SQL> alter system set db_flash_cache_file='/oracle/app/oracle/flash' scope=spfile;
System altered.
SQL> alter system set db_flash_cache_size=1G scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-01261: Parameter db_flash_cache_file destination string cannot be translated
这里我设置参数重启后报错ora_01261
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-01261: Parameter db_flash_cache_file destination string cannot be translated
这里我设置参数重启后报错ora_01261
后来询问了一下朋友,他是在db_flash_cache_file='/oracle/app/oracle/flash'加上.FLASH
那么我就来试一下
SQL> alter system set db_flash_cache_file='/oracle/app/oracle/flash/enmo.flash' scope=spfile;
那么我就来试一下
SQL> alter system set db_flash_cache_file='/oracle/app/oracle/flash/enmo.flash' scope=spfile;
System altered.
SQL> alter system set db_flash_cache_size=1G scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-00439: feature not enabled: Server Flash Cache
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-00439: feature not enabled: Server Flash Cache
好吧,还是起不来,后面把文档仔细的阅读了一下,发现这个参数只支持solaris和OracleLinux系统,其他的系统都不支持,我的是red hat Linux系统
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31467250/viewspace-2140523/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/31467250/viewspace-2140523/