数据中基于RAW格式的表空间扩容。以下是详细步骤:
查看已有裸设备
#cd /dev/raw
#ls -rtl
查看之前裸设备大小情况/查看之前lv大小
#blockdev --getsize /dev/raw/raw37
20488192
#blockdev --getsize /dev/raw/raw38
20488192
#blockdev --getsize /dev/raw/raw30
10248192
#lvscan
ACTIVE '/dev/datavgsda/indxsda07' [4.89 GB] inherit
ACTIVE '/dev/datavgsda/datasda08' [9.77 GB] inherit
ACTIVE '/dev/datavgsda/indxsda08' [4.89 GB] inherit
ACTIVE '/dev/datavgsda/datasda05' [9.77 GB] inherit
.............................................................
查看裸设备与lv的绑定关系
#cd /etc/sysconfig
#more rawdevices
查看VG的空闲空间情况
#vgdisplay
Free PE / Size 27301 / 106.64 GB
创建lv
#lvcreate –L 10240m -n datasda11 datavgsda
#lvcreate –L 10240m -n datasda12 datavgsda
绑定lv到RAW
#raw /dev/raw/raw39 /dev/datavgsda/datasda11
#raw /dev/raw/raw40 /dev/datavgsda/datasda12
修改/etc/syscnfig/rawdevices文件中,加入下面二行,开机时自动加载裸设备
/dev/raw/raw39 /dev/datavgsda/datasda11
/dev/raw/raw40 /dev/datavgsda/datasda12
######先不执行此步:执行 /etc/init.d/rawdevices restart 使配置文件中的裸设备生效
授权
#chown oracle:dba /dev/raw/raw39
#chown oracle:dba /dev/raw/raw40
#chown 660 /dev/raw/raw39
#chown 660 /dev/raw/raw40
#此步已经做完:在/etc/rc.local中已经有一句/bin/chown -R oracle:dba /dev/raw,用来保证开机重启后授权有效
#raw -qa可以查看当前raw的信息
建立链接文件
查看之前的链接
# pwd
/oracle/data/EJETDB
# ls -rtl
总用量 188
lrwxrwxrwx 1 oracle dba 14 2010-06-06 undotbs03 -> /dev/raw/raw12
lrwxrwxrwx 1 oracle dba 14 2010-06-06 undotbs02 -> /dev/raw/raw11
建立链接(用oracle用户建)
ln -s /dev/raw/raw39 /oracle/data/EJETDB/datasda11
ln -s /dev/raw/raw40 /oracle/data/EJETDB/datasda12
ALTER TABLESPACE USERS ADD DATAFILE '/oracle/data/EJETDB/datasda11' SIZE 10200M REUSE;
ALTER TABLESPACE USERS ADD DATAFILE '/oracle/data/EJETDB/datasda12' SIZE 10200M REUSE;