需求
1.归档日志刷得太快,经常把空间挤爆.
2.Oracle数据库表空间需要扩容
解决方案
1.先做重要数据备份
2.进行文件系统扩容
步骤
1. df -g 查找出/u01 对应的VG卷 VOLUME GROUP:
# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
.
/dev/fslv00 60.00 3.95 94% 550567 36% /u01
> # lslv fslv00
2.查看rootvg的FREE PPs:
# lsvg rootvg
PP SIZE(PP单位)
FREE PPs(PP块数)
FREE PPs: 10 (1280 megabytes) 可以看到只剩下1个G了
3.发现空间不足,进行磁盘扩展
3.1刷新磁盘(若果添加了物理磁盘,需要刷新一下)
# cfgmgr
cfgmgr命令详见
3.2查看磁盘使用情况
# lspv
.
.
注:查看磁盘空间大小
#bootinfo -s hdisk1
3.3进行扩展,发现报错
#extendvg rootvg hdisk2 hdisk3 0516-1254 extendvg: Changing the PVID in the ODM. 0516-1254 extendvg: Changing the PVID in the ODM.
0516-1162 extendvg: Warning, The Physical Partition Size of 128
requires the
creation of 1093 partitions for hdisk2. The limitation for volume group
rootvg is 1016 physical partitions per physical volume. Use chvg command
with -t option to attempt to change the maximum Physical Partitions per
Physical volume for this volume group. 0516-1162 extendvg: Warning, The Physical Partition Size of 128 requires the
creation of 1093 partitions for hdisk3. The limitation for volume group
rootvg is 1016 physical partitions per physical volume. Use chvg command
with -t option to attempt to change the maximum Physical Partitions per
Physical volume for this volume group. 0516-792 extendvg: Unable to extend volume group.#chdev -l hdisk2 -a pv=yes
#chdev -l hdisk3 -a pv=yes#chvg -t rootvg 0516-1187 chvg: Volume group not changed. Either the volume group rootvg
has the specified factor value or is at proper maximum physical partitions
per physical volume limit already. 0516-732 chvg: Unable to change volume group rootvg.
//因为PP数目已经达到上限
3.4刷新pp
#chvg -t 2 rootvg
0516-1164 chvg: Volume group rootvg changed. With given
characteristics rootvg
can include upto 16 physical volumes with 2032 physical partitions each.
//数字2表示2×1016个PP
3.5再次进行扩展
#extendvg rootvg hdisk2 hdisk3
3.6查看磁盘使用情况,发现已经在使用
`
> #lspv
`
hdisk0 0007df58fb3e71d4 rootvg active
hdisk1 00009d03638bf367 rootvg active
hdisk2 00009d034caa708d rootvg active
hdisk3 00009d034caa7219 rootvg active
3.7查看vg卷的情况,确认已经扩容
#lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: 0007df580000d70000000113fb3e72ce
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 3278 (419584 megabytes)
MAX LVs: 256 FREE PPs: 2208 (282624 megabytes)
LVs: 60 USED PPs: 1070 (136960 megabytes)
OPEN LVs: 27 QUORUM: 1
TOTAL PVs: 4 VG DESCRIPTORS: 4
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 4 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 2032 MAX PVs: 16
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
4.扩容完毕,进行文件系统扩容
#chfs -a size=+500G /u01
0516-787 extendlv: Maximum allocation for logical volume /u01 is 1145.
注:+代表在原来基础上增加500G大小
从这个提示可以看到逻辑卷lv2已经到达最大的pp扩展数
# lslv fslv00
已经超过max值了
重新调整pp的max值
回车保存,退出
再次进行扩展文件系统
#chfs -a size=+500G /u01
没有报错,扩容完毕