[20171117]参数filesystemio_options.txt

[20171117]参数filesystemio_options.txt

--//前几天看别人的awr报表发现设置参数filesystemio_options=setall,问为什么?对方给出一个链接,某某人都是这样设置的,
--//自己很无语,我希望对方能提出自己的见解.

--//首先给出oracle官方的解析:

https://docs.oracle.com/cd/E11882_01/server.112/e41573/os.htm#PFGRF94410

9.1.1.2 FILESYSTEMIO_OPTIONS Initialization Parameter

You can use the FILESYSTEMIO_OPTIONS initialization parameter to enable or disable asynchronous I/O or direct I/O on
file system files. This parameter is platform-specific and has a default value that is best for a particular platform.

FILESYTEMIO_OPTIONS can be set to one of the following values:

ASYNCH: enable asynchronous I/O on file system files, which has no timing requirement for transmission.
DIRECTIO: enable direct I/O on file system files, which bypasses the buffer cache.
SETALL: enable both asynchronous and direct I/O on file system files.
NONE: disable both asynchronous and direct I/O on file system files.

--//我以前在学习时也测试过这个参数,因为对于os没有相关的命令了解某个文件的缓存情况,我仅仅在dg上测试,因为没有负载很难了解
--//该参数的设置的效果,仅仅在生产系统遇到一个存储的问题,获得一个小工具nocache,一下子茅舍顿开.
--//参考链接:http://blog.itpub.net/267265/viewspace-2147398/

--//首先在讲解之前,我仅仅说明数据库采用文件系统的模式,ASM不在讨论范围.先讲讲我以前遇到的问题.

1.对于内存盘,不能设置FILESYSTEMIO_OPTIONS=setall,directio.

--//我的测试环境是建立在ramdisk上的,方法可以参考链接http://blog.itpub.net/267265/viewspace-1283884/

# mount | column -t | grep tmpfs
tmpfs              on  /dev/shm                  type  tmpfs        (rw)
tmpfs              on  /mnt/ramdisk              type  tmpfs        (rw,size=8G)

--//当然如果重启机器,测试数据库就消失了,不过因为是测试,我保留一个冷备份在磁盘中.直接拷贝就ok了.

# find /mnt/ramdisk/book -name "*.*" -print0  | xargs -0 -I{} cachestats {}
/mnt/ramdisk/book/sysaux01.dbf           pages in cache: 240642/240642 (100.0%)  [filesize=962568.0K, pagesize=4K]
/mnt/ramdisk/book/tea01.dbf              pages in cache: 10242/10242 (100.0%)  [filesize=40968.0K, pagesize=4K]
/mnt/ramdisk/book/redo03.log             pages in cache: 12801/12801 (100.0%)  [filesize=51200.5K, pagesize=4K]
/mnt/ramdisk/book/redo02.log             pages in cache: 12801/12801 (100.0%)  [filesize=51200.5K, pagesize=4K]
/mnt/ramdisk/book/redo01.log             pages in cache: 12801/12801 (100.0%)  [filesize=51200.5K, pagesize=4K]
/mnt/ramdisk/book/users01.dbf            pages in cache: 65538/65538 (100.0%)  [filesize=262152.0K, pagesize=4K]
/mnt/ramdisk/book/control02.ctl          pages in cache: 2612/2612 (100.0%)  [filesize=10448.0K, pagesize=4K]
/mnt/ramdisk/book/control01.ctl          pages in cache: 2612/2612 (100.0%)  [filesize=10448.0K, pagesize=4K]
/mnt/ramdisk/book/undotbs01.dbf          pages in cache: 275202/275202 (100.0%)  [filesize=1100808.0K, pagesize=4K]
/mnt/ramdisk/book/temp01.dbf             pages in cache: 104851/105986 (98.9%)  [filesize=423944.0K, pagesize=4K]
/mnt/ramdisk/book/system01.dbf           pages in cache: 194562/194562 (100.0%)  [filesize=778248.0K, pagesize=4K]
/mnt/ramdisk/book/redostb04.log          pages in cache: 12801/12801 (100.0%)  [filesize=51200.5K, pagesize=4K]
/mnt/ramdisk/book/redostb03.log          pages in cache: 12801/12801 (100.0%)  [filesize=51200.5K, pagesize=4K]
/mnt/ramdisk/book/redostb02.log          pages in cache: 12801/12801 (100.0%)  [filesize=51200.5K, pagesize=4K]
/mnt/ramdisk/book/redostb01.log          pages in cache: 12801/12801 (100.0%)  [filesize=51200.5K, pagesize=4K]
/mnt/ramdisk/book/example01.dbf          pages in cache: 88642/88642 (100.0%)  [filesize=354568.0K, pagesize=4K]

# find /mnt/ramdisk/book -name "*.*" -print0  | xargs -0 -I{} cachedel {}

# find /mnt/ramdisk/book -name "*.*" -print0  | xargs -0 -I{} cachestats {}
/mnt/ramdisk/book/sysaux01.dbf           pages in cache: 240642/240642 (100.0%)  [filesize=962568.0K, pagesize=4K]
/mnt/ramdisk/book/tea01.dbf              pages in cache: 10242/10242 (100.0%)  [filesize=40968.0K, pagesize=4K]
/mnt/ramdisk/book/redo03.log             pages in cache: 12801/12801 (100.0%)  [filesize=51200.5K, pagesize=4K]
/mnt/ramdisk/book/redo02.log             pages in cache: 12801/12801 (100.0%)  [filesize=51200.5K, pagesize=4K]
/mnt/ramdisk/book/redo01.log             pages in cache: 12801/12801 (100.0%)  [filesize=51200.5K, pagesize=4K]
/mnt/ramdisk/book/users01.dbf            pages in cache: 65538/65538 (100.0%)  [filesize=262152.0K, pagesize=4K]
/mnt/ramdisk/book/control02.ctl          pages in cache: 2612/2612 (100.0%)  [filesize=10448.0K, pagesize=4K]
/mnt/ramdisk/book/control01.ctl          pages in cache: 2612/2612 (100.0%)  [filesize=10448.0K, pagesize=4K]
/mnt/ramdisk/book/undotbs01.dbf          pages in cache: 275202/275202 (100.0%)  [filesize=1100808.0K, pagesize=4K]
/mnt/ramdisk/book/temp01.dbf             pages in cache: 104851/105986 (98.9%)  [filesize=423944.0K, pagesize=4K]
/mnt/ramdisk/book/system01.dbf           pages in cache: 194562/194562 (100.0%)  [filesize=778248.0K, pagesize=4K]
/mnt/ramdisk/book/redostb04.log          pages in cache: 12801/12801 (100.0%)  [filesize=51200.5K, pagesize=4K]
/mnt/ramdisk/book/redostb03.log          pages in cache: 12801/12801 (100.0%)  [filesize=51200.5K, pagesize=4K]
/mnt/ramdisk/book/redostb02.log          pages in cache: 12801/12801 (100.0%)  [filesize=51200.5K, pagesize=4K]
/mnt/ramdisk/book/redostb01.log          pages in cache: 12801/12801 (100.0%)  [filesize=51200.5K, pagesize=4K]
/mnt/ramdisk/book/example01.dbf          pages in cache: 88642/88642 (100.0%)  [filesize=354568.0K, pagesize=4K]

--//可以发现对于tmpfs类型文件系统无法清除缓存的.至于temp01.dbf不是100%,我估计可能sparse file的原因.
--//补充说明:
# ls -lk temp01.dbf
-rw-r----- 1 oracle oinstall 423944 2017-11-16 08:35:13 temp01.dbf
# du -sk temp01.dbf
420236  temp01.dbf
# cachestats temp01.dbf
temp01.dbf                               pages in cache: 104851/105986 (98.9%)  [filesize=423944.0K, pagesize=4K]
--//两者看到大小不一致. 423944/4=105986. 也就是实际文件没有这么大,还是完全缓存的.
----------------

SYS@book> alter system set filesystemio_options=setall scope=spfile;
System altered.

SYS@book> startup mount
ORACLE instance started.
Total System Global Area  634732544 bytes
Fixed Size                  2255792 bytes
Variable Size             197133392 bytes
Database Buffers          427819008 bytes
Redo Buffers                7524352 bytes
ORA-00205: error in identifying control file, check alert log for more info

ALTER DATABASE   MOUNT
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/mnt/ramdisk/book/control02.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 22: Invalid argument
Additional information: 2
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/mnt/ramdisk/book/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 22: Invalid argument
Additional information: 2
ORA-205 signalled during: ALTER DATABASE   MOUNT...

--//设置filesystemio_options=directio也一样.

2.rman恢复与filesystemio_options:
--//参考链接:http://blog.itpub.net/267265/viewspace-2122164/

--//我当时将移动硬盘插入我的机器,使用mount.cifs安装在服务端,在设置filesystemio_options=setall的情况下,rman恢复时报如下错
--//误.
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 07/18/2016 08:34:31
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore

3.下面为了测试方面,我将数据库移到本地硬盘. 具体步骤略..
--//另外4种设置情况,仅仅介绍2中setall,asynch. 限于篇幅另写一篇文章.

时间: 2024-07-30 10:48:27

[20171117]参数filesystemio_options.txt的相关文章

20171121参数filesystemio_options=asynch

[20171121]参数filesystemio_options=asynch.txt --//首先给出oracle官方的解析: https://docs.oracle.com/cd/E11882_01/server.112/e41573/os.htm#PFGRF94410 9.1.1.2 FILESYSTEMIO_OPTIONS Initialization Parameter You can use the FILESYSTEMIO_OPTIONS initialization parame

[20171122]rman filesystemio_options.txt

[20171122]rman备份与参数filesystemio_options设置.txt --//这几天写了几篇filesystemio_options参数设置的文章,单独测试这个参数对rman备份以及os缓存的影响. 1.测试环境: SYS@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ -------------- ----------

20171122参数filesystemio_options=setall

[20171122]参数filesystemio_options=setall.txt --//首先给出oracle官方的解析: https://docs.oracle.com/cd/E11882_01/server.112/e41573/os.htm#PFGRF94410 9.1.1.2 FILESYSTEMIO_OPTIONS Initialization Parameter You can use the FILESYSTEMIO_OPTIONS initialization parame

[20171105]exp imp buffer参数解析.txt

[20171105]exp imp buffer参数解析.txt oracle官方所给的关于buffer的解释如下: https://docs.oracle.com/cd/A84870_01/doc/server.816/a76955/ch01.htm BUFFER Default: operating system-dependent. See your Oracle operating system-specific documentation to determine the defaul

[20171109]查看隐含参数脚本.txt

[20171109]查看隐含参数脚本.txt --//查看隐含参数的脚本,今天没事修改一下增加查询description字段的内容.也有网友要求提供这个脚本,实际上这些脚本都是自己工作 --//中不断收集整理.网上许多地方都能找到. $ cat hide.sql col name format a40 col description format a66 col session_value format a22 col default_value format a22 col system_va

[20170516]11G use_large_pages参数2.txt

[20170516]11G use_large_pages参数2.txt //前面我提到如果设置use_large_pages=auto.设置页面大小不足时,oracle会oradism经常修改内核参数vm.nr_hugepages. //忘记测试是否在退出后可以收回.链接如下: http://blog.itpub.net/267265/viewspace-2135210/ --//不知道什么回事,以前写的,忘记发了,补上. 1.环境 SYS@book> @ &r/ver1 PORT_STR

[20151021]理解dbms_xplan.display_cursor的format参数all.txt

[20151021]理解dbms_xplan.display_cursor的format参数all.txt --今天才理解dbms_xplan.display_cursor的format参数all,看来看书与看文档不够仔细. --我一般看执行计划使用我自己的脚本: $ cat dpcz.sql set verify off --select * from table(dbms_xplan.display_cursor(NVL('&1',NULL),NULL,'ALLSTATS LAST PEEK

[20151208]隐含参数_trace_pin_time.txt

[20151208]隐含参数_trace_pin_time.txt --使用隐含参数可以trace how long a current pin is held,作为测试与学习了解oracle内部相关知识. --自己测试看看. 1.测试环境: SYS@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ -------------- -------

[20150325]关于参数archive_lag_target.txt

[20150325]关于参数archive_lag_target.txt --今天同事在测试设置参数archive_lag_target遇到一些问题,自己也做一些测试: DGMGRL>  show database test ArchiveLagTarget   ArchiveLagTarget = '0' DGMGRL> edit database test set PROPERTY ArchiveLagTarget=30; Error: ORA-16790: the value of th