如何在lvm映射的裸设备上安装Oracle数据库

本文主要介绍了Oracle 10g在lvm映射的裸设备上的安装过程,包括创建磁盘分区、创建PV、创建VG、创建相关的lv、以及裸设备配置文件的更改等,希望能够对您有所帮助。
Oracle 10g在lvm映射的裸设备上的安装过程,需要创建PV、VG以及相应的lv等操作,本文主要介绍了这一安装过程,接下来就让我们一起去了解一下吧。

安装过程如下:

1. 创建磁盘分区
分别对/dev/sdc /dev/sdd /dev/sde分区
例如:
#fdisk /dev/sdc
2. 创建pv(pvcreate)

[root@localhost ~]# pvcreate /dev/sdc1
Physical volume "/dev/sdc1" successfully created
[root@localhost ~]# pvcreate /dev/sdd1
Physical volume "/dev/sdd1" successfully created
[root@localhost ~]# pvcreate /dev/sde1
Physical volume "/dev/sde1" successfully created [root@localhost ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup00 lvm2 a- 9.88G 64.00M
/dev/sdb1 VolGroup00 lvm2 a- 9.97G 0
/dev/sdc1 lvm2 -- 10.00G 10.00G
/dev/sdd1 lvm2 -- 10.00G 10.00G
/dev/sde1 lvm2 -- 10.00G 10.00G
3. 创建VG(vgcreate) [root@localhost ~]# vgcreate VolOracle /dev/sdc1 /dev/sdd1 /dev/sde1
Volume group "VolOracle" successfully created [root@localhost ~]# vgs
VG #PV #LV #SN Attr VSize VFree
VolGroup00 2 2 0 wz--n- 19.84G 64.00M
VolOracle 3 0 0 wz--n- 29.99G 29.99G

4. 创建相关的lv,oracle默认的这些

spfile 10M
control1 50M
control2 50M
control3 50M
redo1_1 200M
redo2_1 200M
redo3_1 200M
system01 1024M
sysaux01 1024M
infodb 3096M
temp 500M
users 200M
undotbs 500M

[root@localhost ~]# lvcreate -L 10M -n spfile VolOracle
Rounding up size to full physical extent 12.00 MB
Logical volume "spfile" created
[root@localhost ~]# lvcreate -L 50M -n control1 VolOracle
Rounding up size to full physical extent 52.00 MB
Logical volume "control1" created
[root@localhost ~]# lvcreate -L 50M -n control2 VolOracle
Rounding up size to full physical extent 52.00 MB
Logical volume "control2" created
[root@localhost ~]# lvcreate -L 50M -n control3 VolOracle
Rounding up size to full physical extent 52.00 MB
Logical volume "control3" created
[root@localhost ~]# lvcreate -L 200M -n redo1_1 VolOracle
Logical volume "redo1_1" created
[root@localhost ~]# lvcreate -L 200M -n redo2_1 VolOracle
Logical volume "redo2_1" created
[root@localhost ~]# lvcreate -L 200M -n redo3_1 VolOracle
Logical volume "redo3_1" created
[root@localhost ~]# lvcreate -L 1024M -n system01 VolOracle
Logical volume "system01" created
[root@localhost ~]# lvcreate -L 1024M -n sysaux01 VolOracle
Logical volume "sysaux01" created
[root@localhost ~]# lvcreate -L 3096M -n infodb VolOracle
Logical volume "infodb" created
[root@localhost ~]# lvcreate -L 500M -n temp VolOracle
Logical volume "temp" created
[root@localhost ~]# lvcreate -L 200M -n users VolOracle
Logical volume "users" created
[root@localhost ~]# lvcreate -L 500M -n undotbs1 VolOracle
Logical volume "undotbs1" created

5. 把刚创建的lv映射成裸设备

配置/etc/sysconfig/rawdevices
注意:对应linux下的/etc/raw 修改的格式也稍不同 rawX:DG_NAME/VOL_NAME
# raw device bindings
# format:
#
# example: /dev/raw/raw1 /dev/sda1
# /dev/raw/raw2 8 5
/dev/raw/raw1 /dev/mapper/VolOracle-control1
/dev/raw/raw2 /dev/mapper/VolOracle-control2
/dev/raw/raw3 /dev/mapper/VolOracle-control3
/dev/raw/raw4 /dev/mapper/VolOracle-infodb
/dev/raw/raw5 /dev/mapper/VolOracle-redo1_1
/dev/raw/raw6 /dev/mapper/VolOracle-redo2_1
/dev/raw/raw7 /dev/mapper/VolOracle-redo3_1
/dev/raw/raw8 /dev/mapper/VolOracle-spfile
/dev/raw/raw9 /dev/mapper/VolOracle-sysaux01
/dev/raw/raw10 /dev/mapper/VolOracle-system01
/dev/raw/raw11 /dev/mapper/VolOracle-temp
/dev/raw/raw12 /dev/mapper/VolOracle-undotbs1
/dev/raw/raw13 /dev/mapper/VolOracle-users
/dev/raw/raw14 /dev/mapper/VolOracle-redo1_2
/dev/raw/raw15 /dev/mapper/VolOracle-redo2_2
/dev/raw/raw16 /dev/mapper/VolOracle-redo3_2

[root@localhost etc]# raw -qa
[root@infodb sysconfig]# service rawdevices restart
Assigning devices:
/dev/raw/raw1 --> /dev/mapper/VolOracle-control1
Error setting raw device (Device or resource busy)
/dev/raw/raw2 --> /dev/mapper/VolOracle-control2
Error setting raw device (Device or resource busy)
/dev/raw/raw3 --> /dev/mapper/VolOracle-control3
Error setting raw device (Device or resource busy)
/dev/raw/raw4 --> /dev/mapper/VolOracle-infodb
/dev/raw/raw4: bound to major 253, minor 11
/dev/raw/raw5 --> /dev/mapper/VolOracle-redo1_1
Error setting raw device (Device or resource busy)
/dev/raw/raw6 --> /dev/mapper/VolOracle-redo2_1
/dev/raw/raw6: bound to major 253, minor 7
/dev/raw/raw7 --> /dev/mapper/VolOracle-redo3_1
/dev/raw/raw7: bound to major 253, minor 8
/dev/raw/raw8 --> /dev/mapper/VolOracle-spfile
/dev/raw/raw8: bound to major 253, minor 2
/dev/raw/raw9 --> /dev/mapper/VolOracle-sysaux01
Error setting raw device (Device or resource busy)
/dev/raw/raw10 --> /dev/mapper/VolOracle-system01
Error setting raw device (Device or resource busy)
/dev/raw/raw11 --> /dev/mapper/VolOracle-temp
Error setting raw device (Device or resource busy)
/dev/raw/raw12 --> /dev/mapper/VolOracle-undotbs1
Error setting raw device (Device or resource busy)
/dev/raw/raw13 --> /dev/mapper/VolOracle-users
Error setting raw device (Device or resource busy)
/dev/raw/raw14 --> /dev/mapper/VolOracle-redo1_2
Error setting raw device (Device or resource busy)
/dev/raw/raw15 --> /dev/mapper/VolOracle-redo2_2
/dev/raw/raw15: bound to major 253, minor 17
/dev/raw/raw16 --> /dev/mapper/VolOracle-redo3_2
/dev/raw/raw16: bound to major 253, minor 18
done
[root@infodb sysconfig]# raw -qa
/dev/raw/raw1: bound to major 253, minor 3
/dev/raw/raw2: bound to major 253, minor 4
/dev/raw/raw3: bound to major 253, minor 5
/dev/raw/raw4: bound to major 253, minor 11
/dev/raw/raw5: bound to major 253, minor 6
/dev/raw/raw6: bound to major 253, minor 7
/dev/raw/raw7: bound to major 253, minor 8
/dev/raw/raw8: bound to major 253, minor 2
/dev/raw/raw9: bound to major 253, minor 10
/dev/raw/raw10: bound to major 253, minor 9
/dev/raw/raw11: bound to major 253, minor 12
/dev/raw/raw12: bound to major 253, minor 14
/dev/raw/raw13: bound to major 253, minor 13
/dev/raw/raw14: bound to major 253, minor 16
/dev/raw/raw15: bound to major 253, minor 17
/dev/raw/raw16: bound to major 253, minor 18 [root@infodb sysconfig]# ll /dev/raw
total 0
crw-rw---- 1 oracle dba 162, 1 Aug 19 10:55 raw1
crw-rw---- 1 oracle dba 162, 10 Aug 19 10:55 raw10
crw-rw---- 1 oracle dba 162, 11 Aug 19 10:55 raw11
crw-rw---- 1 oracle dba 162, 12 Aug 19 10:55 raw12
crw-rw---- 1 oracle dba 162, 13 Aug 19 10:55 raw13
crw-rw---- 1 oracle dba 162, 14 Aug 19 10:55 raw14
crw-rw---- 1 oracle dba 162, 15 Aug 19 11:17 raw15
crw-rw---- 1 oracle dba 162, 16 Aug 19 11:17 raw16
crw-rw---- 1 oracle dba 162, 2 Aug 19 10:55 raw2
crw-rw---- 1 oracle dba 162, 3 Aug 19 10:55 raw3
crw-rw---- 1 oracle dba 162, 4 Aug 19 11:17 raw4
crw-rw---- 1 oracle dba 162, 5 Aug 19 10:55 raw5
crw-rw---- 1 oracle dba 162, 6 Aug 19 11:17 raw6
crw-rw---- 1 oracle dba 162, 7 Aug 19 11:17 raw7
crw-rw---- 1 oracle dba 162, 8 Aug 19 11:17 raw8
crw-rw---- 1 oracle dba 162, 9 Aug 19 10:55 raw9
6. 创建oracle的安装卷 [root@localhost etc]# lvm
lvm> lvcreate -L 3g -n lv_oracle VolOracle
Logical volume "lv_oracle" created
lvm> exit
Exiting.
格式化刚创建的lv_oracle
[root@localhost ~]# mkfs.ext3 /dev/mapper/VolOracle-lv_oracle
创建要挂载到的目录:
[root@localhost ~]#mkdir /oracle
修改/etc/fstab,挂载文件系统
[root@localhost ~]#vi /etc/fstab
/dev/mapper/VolOracle-lv_oracle /oracle auto defaults 1 1
重启机器:
[root@localhost ~]#shutdown -ry 0

7. 更改系统的裸设备配置文件

[root@localhost ~]# vi /etc/udev/permissions.d/50-udev.permissions
[root@localhost ~]# cat /etc/udev/permissions.d/50-udev.permissions |grep raw
# raw devices
#raw/*:root:disk:0660
raw/*:oracle:dba:0660
设置相应的oracle环境和参数。
安装oracle软件(不创建数据库),用dbca单独创建数据库。

配置裸设备和数据库文件的映射:

$ORACLE_HOME/dbs/dbca_raw_config

control1=/dev/raw/raw1
control2=/dev/raw/raw2
control3=/dev/raw/raw3
infodb=/dev/raw/raw4
redo1_1=/dev/raw/raw5
redo1_2=/dev/raw/raw14
redo2_1=/dev/raw/raw6
redo2_2=/dev/raw/raw15
redo3_1=/dev/raw/raw7
redo3_2=/dev/raw/raw16
spfile=/dev/raw/raw8
sysaux=/dev/raw/raw9
system=/dev/raw/raw10
temp=/dev/raw/raw11
undotbs1=/dev/raw/raw12
users=/dev/raw/raw13
至此,Oracle 10g在lvm映射的裸设备上的安装过程已经全部完成

转自chinaunix

转载请注明:运维派 » 如何在lvm映射的裸设备上安装Oracle数据库

0
3.6k
1