关于DB_FILE_CACHE的设置

使用条件:
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 的大小
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.
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
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
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;
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
后来询问了一下朋友,他是在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;
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
好吧,还是起不来,后面把文档仔细的阅读了一下,发现这个参数只支持solaris和OracleLinux系统,其他的系统都不支持,我的是red hat Linux系统

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31467250/viewspace-2140523/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31467250/viewspace-2140523/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值