oracle 创建数据文件offset

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:102

问题.WARNING: You are creating/reusing datafile /dev/rcv_sysaux_800m.
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/rcv_sysaux_800m.
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.
一. 分析
数据库创建时,裸设备未使用-T O参数,一般情况下,AIX 的逻辑卷前 4k 用于存储 control block (LVCB),在 Oracle 9iR2 之前,Oracle 软件自动跳过这 4k 而不用。这带来了一个潜在的问题,当 Oracle 的 db_block_size 大于 4k 的时候,一个 Block 可能跨在两个 PV/LUN/磁盘上。这样当系统崩溃的时候,很有可能造成大量的 IO 不完整,一个 PV 上 IO 写入,另一边可能未完成,启动 Oracle 的时候将会看到 ORA-1578 错误,这几乎是致命的。
二. 解决方法
Raw lv 列表
Vg lv
Oraclevg cp_crs1024m
cp_vote1024m
cp_system_1024m
cp_pwdfile_100m
cp_sysaux_800m
cp_undo1_4096m
cp_undo2_4096m
cp_temp_4096m
cp_example_800m
cp_users_800m
cp_redo1_1_500m
cp_redo1_2_500m
cp_redo1_3_500m
cp_redo1_4_500m
cp_redo1_5_500m
cp_redo1_6_500m
cp_redo2_1_500m
cp_redo2_2_500m
cp_redo2_3_500m
cp_redo2_4_500m
cp_redo2_5_500m
cp_redo2_6_500m
cp_ctl1_110m
cp_ctl2_110m
cp_ctl3_110m
cp_spfile_110m
cv_system_1024m
cv_pwdfile_100m
cv_sysaux_800m
cv_undo1_4096m
cv_undo2_4096m
cv_temp_4096m
cv_example_800m
cv_users_800m
cv_redo1_1_500m
cv_redo1_2_500m
cv_redo1_3_500m
cv_redo1_4_500m
cv_redo1_5_500m
cv_redo1_6_500m
cv_redo2_1_500m
cv_redo2_2_500m
cv_redo2_3_500m
cv_redo2_4_500m
cv_redo2_5_500m
cv_redo2_6_500m
cv_ctl1_110m
cv_ctl2_110m
cv_ctl3_110m
cv_spfile_110m
Cvpovg cv_pobase
cv_pobase_indx
cv_poplan
cv_poplan_indx
cv_poorder
cv_poorder_indx
cv_posys
cv_posys_indx
cv_potemp
cv_potemp_indx
方案A:
1. 修改VG为scarable vg
#smit chvg
2. 用以下命令把lv的整个数据向前移动4K:dd if=/dev/lvname of=/dev/lvname seek=0 skip=1 bs=4k
dd if=/dev/rc p_crs1024m of=/dev/rc p_crs1024m seek=0 skip=1 bs=4k
dd if=/dev/rc p_vote1024m of=/dev/rc p_vote1024m seek=0 skip=1 bs=4k
dd if=/dev/rc p_system_1024m of=/dev/rc p_system_1024m seek=0 skip=1 bs=4k
dd if=/dev/rc p_pwdfile_100m of=/dev/rc p_pwdfile_100m seek=0 skip=1 bs=4k
dd if=/dev/rc p_sysaux_800m of=/dev/rc p_sysaux_800m seek=0 skip=1 bs=4k
dd if=/dev/rc p_undo1_4096m of=/dev/rc p_undo1_4096m seek=0 skip=1 bs=4k
dd if=/dev/rc p_undo2_4096m of=/dev/rc p_undo2_4096m seek=0 skip=1 bs=4k
dd if=/dev/rc p_temp_4096m of=/dev/rc p_temp_4096m seek=0 skip=1 bs=4k
dd if=/dev/rc p_example_800m of=/dev/rc p_example_800m seek=0 skip=1 bs=4k
dd if=/dev/rc p_users_800m of=/dev/rc p_users_800m seek=0 skip=1 bs=4k
dd if=/dev/rc p_redo1_1_500m of=/dev/rc p_redo1_1_500m seek=0 skip=1 bs=4k
dd if=/dev/rc p_redo1_2_500m of=/dev/rc p_redo1_2_500m seek=0 skip=1 bs=4k
dd if=/dev/rc p_redo1_3_500m of=/dev/rc p_redo1_3_500m seek=0 skip=1 bs=4k
dd if=/dev/rc p_redo1_4_500m of=/dev/rc p_redo1_4_500m seek=0 skip=1 bs=4k
dd if=/dev/rc p_redo1_5_500m of=/dev/rc p_redo1_5_500m seek=0 skip=1 bs=4k
dd if=/dev/rc p_redo1_6_500m of=/dev/rc p_redo1_6_500m seek=0 skip=1 bs=4k
dd if=/dev/rc p_redo2_1_500m of=/dev/rc p_redo2_1_500m seek=0 skip=1 bs=4k
dd if=/dev/rc p_redo2_2_500m of=/dev/rc p_redo2_2_500m seek=0 skip=1 bs=4k
dd if=/dev/rc p_redo2_3_500m of=/dev/rc p_redo2_3_500m seek=0 skip=1 bs=4k
dd if=/dev/rc p_redo2_4_500m of=/dev/rc p_redo2_4_500m seek=0 skip=1 bs=4k
dd if=/dev/rc p_redo2_5_500m of=/dev/rc p_redo2_5_500m seek=0 skip=1 bs=4k
dd if=/dev/rc p_redo2_6_500m of=/dev/rc p_redo2_6_500m seek=0 skip=1 bs=4k
dd if=/dev/rc p_ctl1_110m of=/dev/rc p_ctl1_110m seek=0 skip=1 bs=4k
dd if=/dev/rc p_ctl2_110m of=/dev/rc p_ctl2_110m seek=0 skip=1 bs=4k
dd if=/dev/rc p_ctl3_110m of=/dev/rc p_ctl3_110m seek=0 skip=1 bs=4k
dd if=/dev/rc p_spfile_110m of=/dev/rc p_spfile_110m seek=0 skip=1 bs=4k
dd if=/dev/rc v_system_1024m of=/dev/rc v_system_1024m seek=0 skip=1 bs=4k
dd if=/dev/rc v_pwdfile_100m of=/dev/rc v_pwdfile_100m seek=0 skip=1 bs=4k
dd if=/dev/rc v_sysaux_800m of=/dev/rc v_sysaux_800m seek=0 skip=1 bs=4k
dd if=/dev/rc v_undo1_4096m of=/dev/rc v_undo1_4096m seek=0 skip=1 bs=4k
dd if=/dev/rc v_undo2_4096m of=/dev/rc v_undo2_4096m seek=0 skip=1 bs=4k
dd if=/dev/rc v_temp_4096m of=/dev/rc v_temp_4096m seek=0 skip=1 bs=4k
dd if=/dev/rc v_example_800m of=/dev/rc v_example_800m seek=0 skip=1 bs=4k
dd if=/dev/rc v_users_800m of=/dev/rc v_users_800m seek=0 skip=1 bs=4k
dd if=/dev/rc v_redo1_1_500m of=/dev/rc v_redo1_1_500m seek=0 skip=1 bs=4k
dd if=/dev/rc v_redo1_2_500m of=/dev/rc v_redo1_2_500m seek=0 skip=1 bs=4k
dd if=/dev/rc v_redo1_3_500m of=/dev/rc v_redo1_3_500m seek=0 skip=1 bs=4k
dd if=/dev/rc v_redo1_4_500m of=/dev/rc v_redo1_4_500m seek=0 skip=1 bs=4k
dd if=/dev/rc v_redo1_5_500m of=/dev/rc v_redo1_5_500m seek=0 skip=1 bs=4k
dd if=/dev/rc v_redo1_6_500m of=/dev/rc v_redo1_6_500m seek=0 skip=1 bs=4k
dd if=/dev/rc v_redo2_1_500m of=/dev/rc v_redo2_1_500m seek=0 skip=1 bs=4k
dd if=/dev/rc v_redo2_2_500m of=/dev/rc v_redo2_2_500m seek=0 skip=1 bs=4k
dd if=/dev/rc v_redo2_3_500m of=/dev/rc v_redo2_3_500m seek=0 skip=1 bs=4k
dd if=/dev/rc v_redo2_4_500m of=/dev/rc v_redo2_4_500m seek=0 skip=1 bs=4k
dd if=/dev/rc v_redo2_5_500m of=/dev/rc v_redo2_5_500m seek=0 skip=1 bs=4k
dd if=/dev/rc v_redo2_6_500m of=/dev/rc v_redo2_6_500m seek=0 skip=1 bs=4k
dd if=/dev/rc v_ctl1_110m of=/dev/rc v_ctl1_110m seek=0 skip=1 bs=4k
dd if=/dev/rc v_ctl2_110m of=/dev/rc v_ctl2_110m seek=0 skip=1 bs=4k
dd if=/dev/rc v_ctl3_110m of=/dev/rc v_ctl3_110m seek=0 skip=1 bs=4k
dd if=/dev/rc v_spfile_110m of=/dev/rc v_spfile_110m seek=0 skip=1 bs=4k
dd if=/dev/rc v_pobase of=/dev/rc v_pobase seek=0 skip=1 bs=4k
dd if=/dev/rc v_pobase_indx of=/dev/rc v_pobase_indx seek=0 skip=1 bs=4k
dd if=/dev/rc v_poplan of=/dev/rc v_poplan seek=0 skip=1 bs=4k
dd if=/dev/rc v_poplan_indx of=/dev/rc v_poplan_indx seek=0 skip=1 bs=4k
dd if=/dev/rc v_poorder of=/dev/rc v_poorder seek=0 skip=1 bs=4k
dd if=/dev/rc v_poorder_indx of=/dev/rc v_poorder_indx seek=0 skip=1 bs=4k
dd if=/dev/rc v_posys of=/dev/rc v_posys seek=0 skip=1 bs=4k
dd if=/dev/rc v_posys_indx of=/dev/rc v_posys_indx seek=0 skip=1 bs=4k
dd if=/dev/rc v_potemp of=/dev/rc v_potemp seek=0 skip=1 bs=4k
dd if=/dev/rc v_potemp_indx of=/dev/rc v_potemp_indx seek=0 skip=1 bs=4k
方案B:
1.修改VG为scarable vg
#smit chvg
2.重建裸设备
oraclevg
mklv -y'cv_crs1024m' -t ‘raw’ -T O oraclevg 8
mklv -y'cv_vote1024m' -t ‘raw’ -T O oraclevg 8
mklv -y'cv_system_1024m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_pwdfile_100m' -t ‘raw’ -T O oraclevg 1
mklv -y'cv_sysaux_800m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_undo1_4096m' -t ‘raw’ -T O oraclevg 40
mklv -y'cv_undo2_4096m' -t ‘raw’ -T O oraclevg 40
mklv -y'cv_temp_4096m' -t ‘raw’ -T O oraclevg 40
mklv -y'cv_example_800m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_users_800m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_redo1_1_500m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_redo1_2_500m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_redo1_3_500m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_redo1_4_500m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_redo1_5_500m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_redo1_6_500m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_redo2_1_500m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_redo2_2_500m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_redo2_3_500m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_redo2_4_500m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_redo2_5_500m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_redo2_6_500m' -t ‘raw’ -T O oraclevg 10
mklv -y'cv_ctl1_110m' -t ‘raw’ -T O oraclevg 1
mklv -y'cv_ctl2_110m' -t ‘raw’ -T O oraclevg 1
mklv -y'cv_ctl3_110m' -t ‘raw’ -T O oraclevg 1
mklv -y'cv_spfile_110m' -t ‘raw’ -T O oraclevg 1
mklv -y'cv_recover4096m' -t ‘raw’ -T O oraclevg 40
cvpovg
mklv -y 'cv_pobase' -t ‘raw’ -T O cvpovg 79
mklv -y 'cv_pobase_indx' -t ‘raw’ -T O cvpovg 47
mklv -y 'cv_poplan' -t ‘raw’ -T O cvpovg 157
mklv -y 'cv_poplan_indx' -t ‘raw’ -T O cvpovg 94
mklv -y 'cv_poorder' -t ‘raw’ -T O cvpovg 157
mklv -y 'cv_poorde_indx' -t ‘raw’ -T O cvpovg 94
mklv -y 'cv_posys' -t ‘raw’ -T O cvpovg 40
mklv -y 'cv_posys_indx' -t ‘raw’ -T O cvpovg 24
mklv -y 'cv_potemp' -t ‘raw’ -T O cvpovg 79
3. 属性修改(两个节点都要操作)
#cd /dev
chown oracle:dba /dev/rcv*
chmod 755 /dev/ rcv*
4. 重建库
#su – oracle
$dbca

关于这个问题我们首先来看一下AIX的vg的3种类型:
original vg 普通卷组
big vg 大卷组
scalable vg 动态的或者可扩展的卷组
如何快速区分这三组卷组呢?
通过其参数MAX PVS,上述3个类型的卷组对应的限制是:32、128、1024;除此之外,还可以通过readvgda命令来读取pv的元数据判断。
好了,实际来看几个例子。
db1:/#uname -a
AIX db1 1 6 00F7B72A4C00
db1:/#oslevel -r
6100-07
这是一台aix6.1下的环境,含有rootvg和vg01两个卷组:
db1:/#lsvg -o
vg01
rootvg
其中rootvg当然是系统使用的vg,vg01是准备用来被oracle使用的。
现有pv如下:
db1:/#lspv
hdisk0 00f7b72ab2370b93 rootvg active
hdisk1 00f7b72aacb2dab0 rootvg active
hdisk2 none None
hdisk3 none None
hdisk4 none None
hdisk5 none None
hdisk6 none None
hdisk7 none None
hdisk8 00f7b72af78cefac vg01 active
hdisk9 00f7b72af78cf3f9 vg01 active
hdisk10 00f7b72af78cf834 vg01 active
hdisk11 00f7b72af7a7bf97 diskhb
现在我们通过MAX PVS这个参数判断卷组类型:
db1:/#lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: 00f7b72a00004c000000013bb2371f49
VG STATE: active PP SIZE: 512 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1116 (571392 megabytes)
MAX LVs: 256 FREE PPs: 650 (332800 megabytes)
LVs: 16 USED PPs: 466 (238592 megabytes)
OPEN LVs: 13 QUORUM: 1 (Disabled)
TOTAL PVs: 2 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 1024 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
PV RESTRICTION: none INFINITE RETRY: no
db1:/#lsvg vg01
VOLUME GROUP: vg01 VG IDENTIFIER: 00f7b72a00004c000000013ef78cf9e8
VG STATE: active PP SIZE: 256 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 3597 (920832 megabytes)
MAX LVs: 256 FREE PPs: 3565 (912640 megabytes)
LVs: 2 USED PPs: 32 (8192 megabytes)
OPEN LVs: 0 QUORUM: 2 (Enabled)
TOTAL PVs: 3 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 3 AUTO ON: no
MAX PPs per VG: 32768 MAX PVs: 1024
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
MIRROR POOL STRICT: off
PV RESTRICTION: none INFINITE RETRY: no
根据参数我们可以得出rootvg是original vg,而vg01是scalable vg,通过readvgda也可以得出相同的结论:
db1:/#readvgda hdisk0 | grep -i type
..... readvgda_type: smallvg
vgtype: 0
对应的0就是original vg了,其他的还有1对应big vg,2对应scalable vg。
接下来我们看下关于4k offset的问题。首先分别在original和scalable vg创建2个lv,一共4个lv:
db1:/#/usr/sbin/mklv -y'lv_system03_512' -t'raw' rootvg 4
lv_system03_512
db1:/#/usr/sbin/mklv -T O -y'lv_system04_512' -t'raw' rootvg 4
lv_system04_512
db1:/#/usr/sbin/mklv -y'lv_system01_4g' -t'raw' vg01 16
lv_system01_4g
db1:/#/usr/sbin/mklv -T O -y'lv_system02_4g' -t'raw' vg01 16
lv_system02_4g
查看下创建出来的lv:
db1:/#lslv lv_system03_512
LOGICAL VOLUME: lv_system03_512 VOLUME GROUP: rootvg
LV IDENTIFIER: 00f7b72a00004c000000013bb2371f49.15 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: 4 PPs: 4
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
INFINITE RETRY: no
db1:/#lslv lv_system04_512
LOGICAL VOLUME: lv_system04_512 VOLUME GROUP: rootvg
LV IDENTIFIER: 00f7b72a00004c000000013bb2371f49.16 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: 4 PPs: 4
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
INFINITE RETRY: no
db1:/#lslv lv_system01_4g
LOGICAL VOLUME: lv_system01_4g VOLUME GROUP: vg01
LV IDENTIFIER: 00f7b72a00004c000000013ef78cf9e8.1 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: 16 PPs: 16
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 1024
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
INFINITE RETRY: no
DEVICESUBTYPE: DS_LVZ
COPY 1 MIRROR POOL: None
COPY 2 MIRROR POOL: None
COPY 3 MIRROR POOL: None
db1:/#lslv lv_system02_4g
LOGICAL VOLUME: lv_system02_4g VOLUME GROUP: vg01
LV IDENTIFIER: 00f7b72a00004c000000013ef78cf9e8.2 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: 16 PPs: 16
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 1024
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
INFINITE RETRY: no
DEVICESUBTYPE: DS_LVZ
COPY 1 MIRROR POOL: None
COPY 2 MIRROR POOL: None
COPY 3 MIRROR POOL: None
结合结果,有如下结论:
0. Origninal VG无论是否使用“-T O”参数,创建出来的lv都是DS_LV;
1. Scalable VG无论是否使用“-T O”参数,创建出来的lv都是DS_LVZ;
2. Big VG使用“-T O”参数创建出来的lv是DS_LVZ类型,否则是DS_LV类型。
通过查看lv的属性DEVICESUBTYPE:DS_LVZ也就是没有偏移的lv,初次之外Oracle也提供了一个工具来检查是有offset:
db1:/#ls -l /dev/lv_*
brw-rw---- 1 root system 53, 1 Jul 02 09:12 /dev/lv_system01_4g
brw-rw---- 1 root system 53, 2 Jul 02 09:15 /dev/lv_system02_4g
brw-rw---- 1 root system 10, 15 Jul 02 09:16 /dev/lv_system03_512
brw-rw---- 1 root system 10, 16 Jul 02 09:18 /dev/lv_system04_512
db1:/#ls -l /dev/rlv_*
crw-rw---- 1 root system 53, 1 Jul 02 09:12 /dev/rlv_system01_4g
crw-rw---- 1 root system 53, 2 Jul 02 09:15 /dev/rlv_system02_4g
crw-rw---- 1 root system 10, 15 Jul 02 09:16 /dev/rlv_system03_512
crw-rw---- 1 root system 10, 16 Jul 02 09:18 /dev/rlv_system04_512
其中每个lv对应有快设备和字符设备,oracle使用的是字符设备:
db1:/#chown oracle:oinstall /dev/rlv_*
db1:/#chmod 700 /dev/rlv_*
db1:/#ls -l /dev/rlv_*
crwx------ 1 oracle oinstall 53, 1 Jul 02 09:12 /dev/rlv_system01_4g
crwx------ 1 oracle oinstall 53, 2 Jul 02 09:15 /dev/rlv_system02_4g
crwx------ 1 oracle oinstall 10, 15 Jul 02 09:16 /dev/rlv_system03_512
crwx------ 1 oracle oinstall 10, 16 Jul 02 09:18 /dev/rlv_system04_512
由于该工具只能检查被用于数据文件的lv,因此只能在被使用之后检查,现在先删除掉上述4个lv,之后重新创建用于测试,注意要用root用户执行:
db1:/oracle$ dbfsize /dev/rlv_system01_4g
/dev/rlv_system01_4g: Header block magic number is bad; trying raw file format...
/dev/rlv_system01_4g: Header block magic number is bad
db1:/oracle$ dbfsize /dev/rlv_system03_512
/dev/rlv_system03_512: Header block magic number is bad
删除 rmlv -f 'rlv_system01_4g' rmlv -f 'rlv_system02_4g' rmlv -f 'rlv_system03_512' rmlv -f 'rlv_system04_512'
在创建数据库之后重新执行下如下结果就可以结果:
db1:/#/oracle/app/oracle/product/10.2/db1/bin/dbfsize /dev/lv_control_01
Database file: /dev/lv_control_01
Database file type: raw device without 4K starting offset
Database file size: 334 16384 byte blocks
这个是没有offset的.
接着来看下有offset的结果:
/usr/sbin/mklv -y'lvtest' -t'raw' rootvg 1
chown oracle:oinstall /dev/rlvtest
chmod 700 /dev/rlvtest
db1:/#su - oracle
db1:/oracle$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Jul 2 11:50:32 2013
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create tablespace gtlions datafile '/dev/rlvtest' size 10m;
Tablespace created.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
db1:/oracle$ /oracle/app/oracle/product/10.2/db1/bin/dbfsize /dev/lvtest
Database file: /dev/lvtest
Database file type: raw device
Database file size: 1280 8192 byte blocks
而且使用有offset的lv创建表空间的时候在后台日志也会做相应的记录并提出建议:
create tablespace gtlions datafile '/dev/rlvtest' size 10m
WARNING: You are creating datafile /dev/rlvtest.
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/rlvtest.
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.
Completed: create tablespace gtlions datafile '/dev/rlvtest' size 10m
-EOF-

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】