目录
0,说明
1,查看系统版本号
2,检查asm依赖的oracleasm-support和kernel-uek包是否存在
3,在VMware Workstation 9.0 虚拟机添加4个大小为5G的磁盘为虚拟裸设备使用
4,扫描已经mount的硬盘
5,给磁盘分区
6,查看分区后的硬盘信息
7,将已经分区的磁盘绑定为裸设备 raw
8,给裸设备设置权限
9,启动绑定的裸设备
10,配置ASM磁盘
11,在ASM实例中查看ASM磁盘信息
12,在DB实例中使用ASM磁盘
0, 说明
环境>
操作系统:Oracle Enterprise Linux6.2
数据库:Oracle11.2.0.3.0 with Grid
裸设备虚拟环境:VMware Workstation 9.0
一般是oracle用户对应DB实例,grid用户对应ASM实例,为了便于管理,将两个实例统一由oracle用户管理,通过每次启动实例前,运行. .asm和. .db这两个环境变量实现在oracle一个用户下启动和使用不同的实例。
两个环境变量配置如下。
[oracle@updba ~]$ cat .asm
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export ORACLE_BASE=/u01/app/oracle
export GRID_HOME=/u01/app/grid/11g ——Grid主目录
export ORACLE_HOME=$GRID_HOME
export ORACLE_SID=+ASM
PATH=$GRID_HOME/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:
export PATH
[oracle@updba ~]$ cat .db
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export ORACLE_BASE=/u01/app/oracle
export DB_HOME=/u01/app/oracle/11g ——DB主目录
export ORACLE_SID=updb
export ORACLE_HOME=$DB_HOME
PATH=$DB_HOME/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:
export PATH
1,查看系统版本号
[root@updba rules.d]# uname -a
Linux updba.uplooking.com 2.6.32-300.3.1.el6uek.x86_64 #1 SMP Fri Dec 9 18:57:35 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
2,检查asm依赖的oracleasm-support和kernel-uek包是否存在
[oracle@updba ~]$ rpm -qa|grep oracleasm-support
oracleasm-support-2.1.5-1.el6.x86_64
[oracle@updba ~]$ rpm -qa|grep kernel-uek
kernel-uek-firmware-2.6.32-300.3.1.el6uek.noarch
kernel-uek-headers-2.6.32-300.3.1.el6uek.x86_64
kernel-uek-2.6.32-300.3.1.el6uek.x86_64
包的版本号和系统的版本号一致。
由于我用的是 Oracle Enterprise Linux6.2,所以系统自带这两个包。如果是用的redhat6.X,需要在 yum.oracle.com 上下载与之版本号相匹配的包,小版本号也最好相同,安装包后需要重新启动系统。
3,在VMware Workstation 9.0 虚拟机添加4个大小为5G的磁盘为虚拟裸设备使用
4,扫描已经mount的硬盘
共有4个,依次是:sdb,sdc,sde,sdd
[root@updba ~]# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000bb795
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 3917 30944256 8e Linux LVM
Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdb doesn't contain a