此内容只在kernel 2.6, oracle 10.2.0.2 以上有效. linux LVM 在oracle 10.2.0.2 不支持块设备(Notes: 357492.1), 所以只可以在fdisk /dev/sdx 下创建裸设备.否则在向LVM创建的裸设备COPY文件时会出现如下错误.
============================================================
RMAN> run{
2> allocate channel ch0 type disk;
3> copy datafile '/oracle/test01.dbf' to '/dev/raw/raw1';
4> }
using target database control file instead of recovery catalog
allocated channel: ch0
channel ch0: sid=159 devtype=DISK
Starting backup at 13-JAN-09
channel ch0: starting datafile copy
input datafile fno=00005 name=/oracle/test01.dbf
released channel: ch0
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ch0 channel at 01/13/2009 09:10:09
ORA-19504: failed to create file "/dev/raw/raw1"
ORA-27094: raw volume used can damage partition table
Additional information: -2
Additional information: 1048576000
============================================================
1.版本
[root@LGXRH1 sysconfig]# uname -a
Linux LGXRH1 2.6.9-78.ELsmp #1 SMP Wed Jul 9 15:39:47 EDT 2008 i686 i686 i386 GNU/Linux
2.创建PV
[root@LGXRH1 vg01]# pvcreate /dev/sde
Physical volume "/dev/sde" successfully created
3.创建VG
[root@LGXRH1 vg01]# vgcreate vg01 /dev/sde
Volume group "vg01" successfully created
查看VG
[root@LGXRH1 vg01]# vgs
VG #PV #LV #SN Attr VSize VFree
vg01 1 0 0 wz--n- 8.00G 8.00G
4.创建LV
[root@LGXRH1 vg01]# lvcreate -L 1000M -n lvm01 vg01
Logical volume "lvm01" created
[root@LGXRH1 vg01]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
lvm01 vg01 -wi-a- 1000.00M
5.绑定到raw
[root@LGXRH1 vg01]raw /dev/raw/raw1 /dev/vg01/lvm01
/dev/raw/raw1: bound to major 253, minor 0
使用raw命令绑定的裸设备在重启后会失效。所以需要修改/etc/sysconfig/rawdevices配置文件,在文件中
加入如下内容(每个裸设备一行):
/dev/raw/raw1 /dev/vg01/lvm01
最后使得裸设备生效,并且在机器启动的时候就自动加载
执行 /etc/init.d/rawdevices restart 使裸设备生效
执行 /sbin/chkconfig rawdevices on 保证机器启动的时候裸设备能够加载,这一步很重要
查询主机现有的裸设备
raw -qa
6.授权
[root@LGXRH1 sysconfig]# chown -R oracle.dba /dev/vg01
修改配置文件/etc/udev/permissions.d/50-udev.permissions
注释掉raw/*:root:disk:0660
添加新行raw/*:oracle:dba:0660
阅读(965) | 评论(0) | 转发(0) |