xml 2016-02-14
软件:VMware11
操作系统: Oracle Linux 5.11 x64
数据库: Oracle 10.2.0.5 x64
主机名: odb.test.local
IP地址: 192.168.223.100 #使用的是虚拟机主机网络
实例: odb
[root@odb ~]# ll /dev/raw*
total 0
cr--r----- 1 root root 162, 1 Jan 18 21:52 raw1
cr--r----- 1 root root 162, 10 Jan 18 21:52 raw10
cr--r----- 1 root root 162, 11 Jan 18 21:52 raw11
cr--r----- 1 root root 162, 12 Jan 18 21:52 raw12
cr--r----- 1 root root 162, 2 Jan 18 21:52 raw2
cr--r----- 1 root root 162, 3 Jan 18 21:52 raw3
cr--r----- 1 root root 162, 4 Jan 18 21:52 raw4
cr--r----- 1 root root 162, 5 Jan 18 21:52 raw5
cr--r----- 1 root root 162, 6 Jan 18 21:52 raw6
cr--r----- 1 root root 162, 7 Jan 18 21:52 raw7
cr--r----- 1 root root 162, 8 Jan 18 21:52 raw8
cr--r----- 1 root root 162, 9 Jan 18 21:52 raw9
4.设置裸设备属组和访问权限(直接修改是没用的,在重启后会自动恢复root属组)
[root@odb ~]# vim /etc/udev/rules.d/60-raw.rules
ACTION=="add",KERNEL=="raw*",OWNER="oracle",GROUP="dba",MODE="0660"
[root@odb ~]# start_udev
Starting udev: [ OK ]
[root@odb ~]# ll /dev/raw*
crw-rw---- 1 oracle dba 162, 0 Jan 18 21:52 /dev/rawctl
/dev/raw:
total 0
crw-rw---- 1 oracle dba 162, 1 Jan 18 21:52 raw1
crw-rw---- 1 oracle dba 162, 10 Jan 18 21:52 raw10
crw-rw---- 1 oracle dba 162, 11 Jan 18 21:52 raw11
crw-rw---- 1 oracle dba 162, 12 Jan 18 21:52 raw12
crw-rw---- 1 oracle dba 162, 2 Jan 18 21:52 raw2
crw-rw---- 1 oracle dba 162, 3 Jan 18 21:52 raw3
crw-rw---- 1 oracle dba 162, 4 Jan 18 21:52 raw4
crw-rw---- 1 oracle dba 162, 5 Jan 18 21:52 raw5
crw-rw---- 1 oracle dba 162, 6 Jan 18 21:52 raw6
crw-rw---- 1 oracle dba 162, 7 Jan 18 21:52 raw7
crw-rw---- 1 oracle dba 162, 8 Jan 18 21:52 raw8
crw-rw---- 1 oracle dba 162, 9 Jan 18 21:52 raw9
5.创建数据文件指向裸设备的软连接
[root@odb ~]# mkdir -p /opt/oracle/oradata/odb
ln -s /dev/raw/raw1 /opt/oracle/oradata/odb/spfile
ln -s /dev/raw/raw2 /opt/oracle/oradata/odb/control01
ln -s /dev/raw/raw3 /opt/oracle/oradata/odb/control02
ln -s /dev/raw/raw4 /opt/oracle/oradata/odb/control03
ln -s /dev/raw/raw5 /opt/oracle/oradata/odb/redo01
ln -s /dev/raw/raw6 /opt/oracle/oradata/odb/redo02
ln -s /dev/raw/raw7 /opt/oracle/oradata/odb/redo03
ln -s /dev/raw/raw8 /opt/oracle/oradata/odb/sysaux01
ln -s /dev/raw/raw9 /opt/oracle/oradata/odb/system01
ln -s /dev/raw/raw10 /opt/oracle/oradata/odb/users01
ln -s /dev/raw/raw11 /opt/oracle/oradata/odb/undo01
ln -s /dev/raw/raw12 /opt/oracle/oradata/odb/temp01
创建完软连接后,建议将这些链接文件的属组和权限也改一下
[root@odb ~]# chown -R oracle:oinstall /opt/oracle/oradata/odb/
[root@odb ~]# chmod -R 775 /opt/oracle/oradata/odb/
6.创建裸设备映射文件DBCA_RAW_CONFIG.txt
[root@odb ~]# su - oracle
[oracle@odb ~]$ vim DBCA_RAW_CONFIG.txt
spfile=/opt/oracle/oradata/spfile
control1=/opt/oracle/oradata/odb/control01
control2=/opt/oracle/oradata/odb/control02
control3=/opt/oracle/oradata/odb/control03
redo1_1=/opt/oracle/oradata/odb/redo01
redo2_1=/opt/oracle/oradata/odb/redo02
redo3_1=/opt/oracle/oradata/odb/redo03
sysaux=/opt/oracle/oradata/odb/sysaux01
system=/opt/oracle/oradata/odb/system01
users=/opt/oracle/oradata/odb/users01
undotbs1=/opt/oracle/oradata/odb/undo01
temp=/opt/oracle/oradata/odb/temp01
7.先运行 netca 创建LISTENTER和TNSNAMES之类的,过程略
8.运行DBCA创建数据库
[oracle@odb ~]$ export DBCA_RAW_CONFIG=/home/oracle/DBCA_RAW_CONFIG.txt
[oracle@odb ~]$ dbca
后面的安装过程略,建议选择自定义安装,安装过程中裸设备文件如果没有到,可以手工指定软链接的文件位置
以上就是基于LVM的裸设备安装ORACLE数据库的方法。