首页 > 数据库 > Oracle >

用裸设备扩展oracle表空间

2013-04-19

用裸设备扩展oracle表空间服务器:IBM P6小型机操作系统: AIX5.3DB:Oracle 10g现有表空间users,提示表空间不足。1.查询表空间已使用的裸设备文件名称执行如下sql:select * from DBA_DATA_FILESwhere ...

用裸设备扩展oracle表空间
服务器:IBM P6小型机
操作系统: AIX5.3
DB:Oracle 10g
现有表空间users,提示表空间不足。
1.查询表空间已使用的裸设备文件名称
执行如下sql:
select * from DBA_DATA_FILES
where tablespace_name = 'USERS'
结果:
FILE_NAME FILE_ID TABLESPACE_NAME BYTES
/dev/rlvusers01 5 USERS 17179607040
/dev/rlvusers02 6 USERS 17179860992
/dev/rlvusers03 7 USERS 17179860992
/dev/rlvusers04 9 USERS 17179860992
2.查询裸设备所在的vg
[P6:51:oracle]/home/oracle>lsvg -l datavg
datavg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
lvusers01 raw 64 64 1 open/syncd N/A
lvusers02 raw 64 64 1 open/syncd N/A
lvusers03 raw 64 64 1 open/syncd N/A
lvusers04 raw 64 64 1 open/syncd N/A
3.查看裸设备lv的详细信息
[P6:51:oracle]/home/oracle>lslv lvusers04
LOGICAL VOLUME: lvusers04 VOLUME GROUP: datavg
LV IDENTIFIER: 00c4cf1400004c00000001216d90213b.24 PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/syncd
TYPE: raw WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 256 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 64 PPs: 64
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: no
INTRA-POLICY: middle UPPER BOUND: 128
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: off
EACH LP COPY ON A SEPARATE PV ?: no
Serialize IO ?: NO
DEVICESUBTYPE : DS_LVZ
注意LPS:64,VG:datavg,PP size:256M
所以lvusers04的大小 = 64*256M= 16G
4.查看vg空闲空间是否够
[P6:51:oracle]/dev>lsvg datavg
VOLUME GROUP: datavg VG IDENTIFIER: 00c4cf1400004c00000001216d90213b
VG STATE: active PP SIZE: 256 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1209 (309504 megabytes)
MAX LVs: 512 FREE PPs: 495 (126720 megabytes)
LVs: 27 USED PPs: 714 (182784 megabytes)
OPEN LVs: 26 QUORUM: 1 (Disabled)
TOTAL PVs: 3 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 3 AUTO ON: no
Concurrent: Enhanced-Capable Auto-Concurrent: Disabled
VG Mode: Concurrent
Node ID: - Active Nodes:
MAX PPs per VG: 130048
MAX PPs per PV: 1016 MAX PVs: 128
LTG size (Dynamic): 1024 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
注意Free PPs:126720M,约120G
5.新建裸设备LV(使用root登陆)
#mklv -y 'lvusers05' -t 'raw' datavg 64
6.更改裸设备所属owner
#chown oracle:dba /dev/rlvusers05
*这里尤其要注意一点,如果oracle使用了RAC的话,必须每个节点都执行上述语句。
***
而且经过测试发现,增加之后,必须更新hacmp(因为增加的lv只有在1节点上有,2节点并没有),所以要重启hacmp并更新hacmp信息。
重启后lv的owner可能会恢复成root,需要手动重置下。
***
7.在ORACLE扩展表空间
sql<
ALTER tablespace users add DATAFILE &#39;/dev/rlvusers05&#39; SIZE 16000M AUTOEXTEND OFF;
注意 size是160000M,而不是直接16G,因为不能用满,得留点空间。
8.查看裸设备lv状态
[P6:51:oracle]/dev>lslv lvusers05
LOGICAL VOLUME: lvusers05 VOLUME GROUP: datavg
LV IDENTIFIER: 00c4cf1400004c00000001216d90213b.26 PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/syncd
TYPE: raw WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 256 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 64 PPs: 64
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 128
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
注意状态变成:opened/syncd
到此工作结束
相关文章
最新文章
热点推荐