問題現象:
在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)。
本文出自 “麥地塢” 博客,請務必保留此出處http://yunlongzheng.blog.51cto.com/788996/560404