可参见oracle 官方安装文档:
图片太多了,就没有上传,下次整理再补....
ORACLE 11g GRID安装
1.1. oracleasmlib 和 安装ASM包(root身份)2
1.3.2. 进入操作系统 fdisk 格式化硬盘(root身份)4
1. ASM磁盘创建
1.1. oracleasmlib 和 安装ASM包(root身份)
此相关软件包下载地址:
http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html#oracleasm_rhel5_x86
注意,请顺序安装,如果中间却少相关系统包,请找到相关包进行安装;
rpm -vhi oracleasm-support-2.1.7-1.el5.i386.rpm
rpm -ivh oracleasm-2.6.18-194.el5-2.0.5-1.el5.i686.rpm
rpm -vhi oracleasmlib-2.0.4-1.el5.i386.rpm
rpm -vhi oracleasm-2.6.18-194.el5debug-2.0.5-1.el5.i686.rpm
rpm -vhi oracleasm-2.6.18-194.el5-debuginfo-2.0.5-1.el5.i686.rpm
rpm -vhi oracleasm-2.6.18-194.el5PAE-2.0.5-1.el5.i686.rpm
rpm -vhi oracleasm-2.6.18-194.el5xen-2.0.5-1.el5.i686.rpm
在我们的实验里,我需要如下系统包:
kernel-debug-2.6.18-194.el5.i686.rpm
kernel-PAE-2.6.18-194.el5.i686.rpm
kernel-xen-2.6.18-194.el5.i686.rpm
1.2. 配置oracleasm(root身份)
[root@dbserver2 oracle]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks:
[ OK ]
[root@dbserver2 oracle]#
1.3. 准备磁盘设备
1.3.1. 给虚拟机增加硬盘
一路点 next 直到创建盘成功;
1.3.2. 进入操作系统 fdisk 格式化硬盘(root身份)
[root@dbserver2 oracle]# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2610 20860402+ 8e Linux LVM
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
[root@dbserver2 oracle]#
[root@dbserver2 oracle]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 1044.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1044, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044): +5000m
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (610-1044, default 610):
Using default value 610
Last cylinder or +size or +sizeM or +sizeK (610-1044, default 1044):
Using default value 1044
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@dbserver2 oracle]#
[root@dbserver2 oracle]# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2610 20860402+ 8e Linux LVM
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 609 4891761 83 Linux
/dev/sdb2 610 1044 3494137+ 83 Linux
[root@dbserver2 oracle]#
1.4. 创建asm磁盘卷设备(root身份)
[root@localhost oracle]#
[root@localhost oracle]# /etc/init.d/oracleasm createdisk vol1 /dev/sdb1
Marking disk "vol1" as an ASM disk: [ OK ]
[root@localhost oracle]# /etc/init.d/oracleasm createdisk vol2 /dev/sdb2
Marking disk "vol2" as an ASM disk: [ OK ]
[root@localhost oracle]#
[root@localhost oracle]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
1.4.1. 异常错误处理
如果出出现错误:Marking disk "VOL1" as an ASM disk: [FAILED]
查看日志
[root@Oracle11gOcp_catalog disks]# less /var/log/oracleasm
1.如果是如下错误信息:
Disk "VOL1" does not exist or is not instantiated
Writing disk header: done
Instantiating disk: oracleasm-instantiate-disk: Unable to open manager: No such file or directory
failed
Clearing disk header: done
此表示没有启用 oracleasm 需要执行:
[root@Oracle11gOcp_catalog ~]# /etc/init.d/oracleasm enable
2.如果是如下错误信息:
Device "/dev/sdc1" is already labeled for ASM disk "VOL1"
解决的两种方法:
1). 删除已存在的asm盘
/etc/init.d/oracleasm deletedisk VOL1
2). 更名增加asm盘
/etc/init.d/oracleasm createdisk volX /dev/sdb1
1.5. 准备grid安装软件
[oracle@dbserver2 ~]$ cd /oracle_soft/
[oracle@dbserver2 oracle_soft]$ ls
database p10404530_112030_LINUX_3of7.zip
[oracle@dbserver2 oracle_soft]$ unzip p10404530_112030_LINUX_3of7.zip
[oracle@dbserver2 oracle_soft]$ ls
database grid p10404530_112030_LINUX_3of7.zip
[oracle@dbserver2 oracle_soft]$
[oracle@dbserver2 oracle_soft]$
[oracle@dbserver2 oracle_soft]$ rm -rf p10404530_112030_LINUX_3of7.zip
[oracle@dbserver2 oracle_soft]$
[oracle@dbserver2 oracle_soft]$ ls
database grid
1.6. 创建数据库
请见相关章节
有个奇怪现象,我没有配置系统启动asm实例与oracle实例,怎么一启操作系统就随系统启动了...