在AIX上使用裸设备创建数据库时,alert日志出现告警信息:
Thu Dec 22 00:03:51 2011
WARNING: You are creating datafile /dev/recomdb_ctl01.
WARNING: Oracle recommends creating new datafiles on devices with zero offset. The command "/usr/sbin/mklv -y LVname -T O -w n -s n -r n VGname NumPPs" can be used. Please contact Oracle customer support for more details.
WARNING: You are creating/reusing datafile /dev/recomdb_ctl01.
WARNING: Oracle recommends creating new datafiles on devices with zero offset. The command "/usr/sbin/mklv -y LVname -T O -w n -s n -r n VGname NumPPs" can be used. Please contact Oracle customer support for more details.
WARNING: You are creating datafile /dev/recomdb_ctl02.
WARNING: Oracle recommends creating new datafiles on devices with zero offset. The command "/usr/sbin/mklv -y LVname -T O -w n -s n -r n VGname NumPPs" can be used. Please contact Oracle customer support for more details.
WARNING: You are creating/reusing datafile /dev/recomdb_ctl02.
WARNING: Oracle recommends creating new datafiles on devices with zero offset. The command "/usr/sbin/mklv -y LVname -T O -w n -s n -r n VGname NumPPs" can be used. Please contact Oracle customer support for more details.
WARNING: You are creating datafile /dev/recomdb_ctl03.
WARNING: Oracle recommends creating new datafiles on devices with zero offset. The command "/usr/sbin/mklv -y LVname -T O -w n -s n -r n VGname NumPPs" can be used. Please contact Oracle customer support for more details.
WARNING: You are creating/reusing datafile /dev/recomdb_ctl03.
WARNING: Oracle recommends creating new datafiles on devices with zero offset. The command "/usr/sbin/mklv -y LVname -T O -w n -s n -r n VGname NumPPs" can be used. Please contact Oracle customer support for more details.
从告警的信息来看,Oracle建议创建出的数据库文件从zero offset开始记录数据。
由于创建出的裸设备有自己的头文件信息,所以当它被用做Oracle的数据库文件时,Oracle就没办法从这个裸设备的头部(zero offset)开始记录数据,如果数据库的db_block_size大于4K,由于Oracle读写数据是以Oracle block为最小单位的,此时就会导致Oracle一个block被分割并跨越条带区。这会导致操作系统crash或者重启时数据块断裂(fractured)的发生,严重的甚至会导致数据库不可用。
这些告警信息可能暂时没有影响,不过它会是问题发生的一个潜在隐患,同时由于Oracle block和OS block的不匹配,也会对数据库性能造成影响。
Oracle建议的创建lv的命令为:/usr/sbin/mklv -y LVname -T O -w n -s n -r n VGname NumPPs。
这里引用一下Oracle官方文档的参数说明:
LVname is the name of the logical volume that you want to create
■ The -T O option specifies that the device subtype should be z, which causes Oracle to use a zero offset when accessing this raw logical volume
■ VGname is the name of the volume group where you want to create the logical volume
■ NumPPs is the number of physical partitions to use
To determine the value to use for NumPPs, divide the required size of the logical volume by the size of the physical partition and round the value up to an integer. For example, if the size of the physical partition is 32 MB and you want to create a 500 MB logical volume, then you should specify 16 for the NumPPs (500/32 = 15.625).
而这次创建的裸设备文件,命令格式都如下:
mklv -y ecomdb_undo01 -t raw ecomdbvg 64
于是删除lv后重新创建:
mklv -y ecomdb_undo01 -T O -w n -s n -r n -t raw ecomdbvg 64
但是在创建Oracle数据库文件时,仍然出现上述告警。原来是由于在创建vg的时候,需要指定big vg,继续引用Oracle官方文档:
To create a volume group, enter a command similar to the following, or use SMIT (smit mkvg):
# /usr/sbin/mkvg -y VGname -B -s PPsize -V majornum \
-C PhysicalVolumes
这里在mkvg时有参数-B,表示创建的vg是big vg。
以下是man mklv的命令信息:
-T O
For big vg format volume groups, the -T O option indicates that the logical volume control block will not occupy the first block of the logical volume. Therefore, the space is available for application data. Applications can identify this type of logical volume with the IOC INFO ioctl. The logical volume has a device subtype of DS_LVZ. A logical volume created without this option has a device subtype of DS_LV. This option is ignored for old and scalable vg format volume groups.
从说明可以看到,-T O的作用只有在Big VG中才能启作用。
重建VG后,此问题解决,创建Oracle数据库文件时告警消失。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/20750200/viewspace-713920/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/20750200/viewspace-713920/