问题现象:
在AIX下新建LV,然后在LV上建表空间,出现WARNING(Oracle recommends creating new datafiles on devices with zero offset)
alter tablespace ZJ_DATA add datafile '/dev/rdata40_disk' size 2500M
Wed Apr 27 22:45:36 2011
WARNING: You are creating datafile /dev/rdata41_disk.
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.
通过mklv -T O -y data40_disk oradatavg 1重建如上表空间后上述警告消失,运行一段时间数据库完全正常,可见数据文件已经正常写入该DATAFILE。
但无意中一次lslv对比了数据库上线时和刚刚建立的两个lv文件,发现在TYPE、DEVICESUBTYPE、RELOCATABLE、MIRROR WRITE CONSISTENCY、EACH LP COPY ON A SEPARATE PV
方面存在区别,详见如下。
$ lslv data40_disk
LOGICAL VOLUME: data40_disk VOLUME GROUP: oradatavg
LV IDENTIFIER: 00c164fe00004c0000000110a1021713.66 PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/syncd
TYPE: jfs WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 256 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 10 PPs: 10
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 16
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
DEVICESUBTYPE : DS_LVZ
$ lslv data_disk
LOGICAL VOLUME: data_disk VOLUME GROUP: oradatavg
LV IDENTIFIER: 00c164fe00004c0000000110a1021713.14 PERMISSION: read/write
VG STATE: active/complete LV STATE: closed/syncd
TYPE: raw WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 256 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 4 PPs: 4
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: no
INTRA-POLICY: middle UPPER BOUND: 16
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: off
EACH LP COPY ON A SEPARATE PV ?: no
Serialize IO ?: NO
为了鉴证MKLV命令的默认参数,我们来继续几个做测试
方法一:mklv带有 -T O参数,但是不指定TYPE(-t) ,新建的lv带DEVICESUBTYPE属性,且TYPE:jfs
p550a:/home/oracle/dba#mklv -T O -y data40_disk oradatavg 1
data40_disk
p550a:/home/oracle/dba#lslv data40_disk
LOGICAL VOLUME: data40_disk VOLUME GROUP: oradatavg
LV IDENTIFIER: 000037750000d60000000112749c9dbb.173 PERMISSION: read/write
VG STATE: active/complete LV STATE: closed/syncd
TYPE: jfs WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 512 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 1 PPs: 1
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
DEVICESUBTYPE : DS_LVZ
方法二:mklv带有 -T O参数,指定TYPE(-t 'raw') ,通过lslv可以看出,新建的lv带DEVICESUBTYPE属性,且TYPE:raw
p550a:/home/oracle/dba#mklv -T O -t 'raw' -y data41_disk oradatavg 1
data41_disk
p550a:/home/oracle/dba#lslv data41_disk
LOGICAL VOLUME: data41_disk VOLUME GROUP: oradatavg
LV IDENTIFIER: 000037750000d60000000112749c9dbb.174 PERMISSION: read/write
VG STATE: active/complete LV STATE: closed/syncd
TYPE: raw WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 512 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 1 PPs: 1
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
DEVICESUBTYPE : DS_LVZ
方法三:通过smitlv,指定TYPE(-t 'raw')建lv ,通过lslv可以看出,新建的lv不带DEVICESUBTYPE属性,且TYPE:raw
p550a:/home/oracle/dba#smit lv
添加逻辑卷
在输入字段中输入或选择值。
当完成所有希望的更改之后,按 Enter 键。
[输入字段]
逻辑卷名称 [data42_disk]
* 卷组名称 oradatavg
* 逻辑分区的数量 [1] #
物理卷名 [] +
逻辑卷类型 [raw] +
物理卷位置 中间 +
物理卷范围 最小 +
用于分配的 [] #
物理卷最大数量
每个逻辑分区的副本数量 1 +
要一致性镜像化写入吗? 主动 +
要将每个逻辑分区副本分配 是 +
到一个单独的物理卷吗?
要在重新组织的过程中 是 +
重新分配物理卷吗?
逻辑卷标号 []
逻辑分区的最大数量 [512] #
要启用坏块重定位吗? 是 +
读取/写入的“规划策略” 并行 +
逻辑分区副本
要启用写入验证吗? 否 +
包含分配映射的文件 []
组合分割区大小? [未分割] +
序列化 IO? 否
p550a:/home/oracle/dba#lslv data42_disk
LOGICAL VOLUME: data42_disk VOLUME GROUP: oradatavg
LV IDENTIFIER: 000037750000d60000000112749c9dbb.175 PERMISSION: read/write
VG STATE: active/complete LV STATE: closed/syncd
TYPE: raw WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 512 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 1 PPs: 1
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
方法四:mklv不带 -T O参数,但指定TYPE(-t 'raw') ,通过lslv可以看出,新建的lv不带DEVICESUBTYPE属性,且RELOCATABLE: yes
p550a:/#mklv -t 'raw' -y data43_disk oradatavg 1
data43_disk
p550a:/#lslv data43_disk
LOGICAL VOLUME: data43_disk VOLUME GROUP: oradatavg
LV IDENTIFIER: 000037750000d60000000112749c9dbb.176 PERMISSION: read/write
VG STATE: active/complete LV STATE: closed/syncd
TYPE: raw WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 512 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 1 PPs: 1
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
综合以上测试可以得出:
1、mklv默认的TYPE是jfs
2、默认建立普通类型的lv,LV类型是DS_LV,这种类型的LV,在lslv的命令中没有任何SUBTYPE类型说明(不带DEVICESUBTYPE : DS_LVZ)。
本文转自zylhsy 51CTO博客,原文链接:http://blog.51cto.com/yunlongzheng/560404,如需转载请自行联系原作者