MAC+Vmware Fusion安装Oracle11g RAC
小黑时代已经过去了,现在IT民工已经开始转向高大上的Mac了。但是屌丝终究是屌丝,换了Mac后还是得安装RAC作为平时工作的环境,面对这高级的Mac OS X的操作系统,不得不觉得折腾,图形界面是一个折腾,共享存储是一个折腾,为了后面从小黑换Mac的兄弟们提高效率,减少折腾,这里把最折腾的几个地方分享一下,希望对准备在Mac安装Oracle RAC的您会有帮助。
1、 版本说明
Oracle版本:11g R2 11.2.0.3
Linux版本:Red Hat Enterprise Linux Server release 6.4
:Linux tony3 2.6.32-358.el6.x86_64
主机版本:Mac OS X 13.4.0
图形界面工具:XQuartz
虚拟机软件:VMware Fusion
2、 安装虚拟机及操作系统
虚拟机的配置与安装和在Windows下基本一致,操作系统的安装更是完全一样,所以这里就不做介绍了,关于网络适配器的选择,我一般选择“host only”的模式(选择仅供我的Mac专用),大家可以根据自己的爱好选择。
安装的时候选择创建自定义虚拟机
3、 修改Oracle安装的操作系统相关参数
修改操作系统的相关参数和安装相应的rpm包可以参考Windows环境下的安装、直接参考官方安装文档即可。
4、 添加用户及目录
/usr/sbin/groupadd -g 1010 oinstall
/usr/sbin/groupadd -g 1011 dba
/usr/sbin/groupadd -g 1012 oper
/usr/sbin/groupadd -g 1020 asmadmin
/usr/sbin/groupadd -g 1021 asmdba
/usr/sbin/groupadd -g 1022 asmoper
useradd -u 1001 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
useradd -u 1002 -g oinstall -G dba,asmdba,oper oracle
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/grid
chown -R grid:oinstall /u01
mkdir /u01/app/oracle
chown oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/
5、 配置IP地址、环境变量
参考Windows环境的安装。
6、 配置NTP服务并调整时钟同步
参考Windows环境的安装,由于是测试环境,这里不配置NTP。
7、 配置DNS
参考Windows环境的安装,由于是测试环境,这里不配置DNS。
8、 克隆虚拟机
这里和Windows稍有差别,在Windows环境下,我们一般采用复制的方式克隆第二个节点,Mac系统下,采用右键-创建完整克隆的方式克隆。
9、 创建ASM共享存储
创建两个(多个)共享磁盘:crs01/asm01
在tony3上添加两个新的磁盘:
这里无论是OCR磁盘还是ASM磁盘都必须勾选?预先分配磁盘空间,否则无论是在GI的安装还是后面的DBCA建库都会在第二个节点(tony4)提示ORA-15063,磁盘权限不足。
在tony4创建共享存储,选择现有磁盘,选择共享磁盘。
10、 配置裸设备
由于从Linux2.6.30开始已经不提供ASMLib包,所以Linux 6.4版本安装Oracle 11g RAC需要使用udev配置RAW做为ASM磁盘实现共享存储。
使用fdisk进行磁盘分区:
# ls -l /dev/sd*
brw-rw---- 1 root disk 8, 0 Feb 4 10:39 /dev/sda
brw-rw---- 1 root disk 8, 1 Feb 4 10:39 /dev/sda1
brw-rw---- 1 root disk 8, 2 Feb 4 10:39 /dev/sda2
brw-rw---- 1 root disk 8, 16 Feb 4 10:39 /dev/sdb
brw-rw---- 1 root disk 8, 17 Feb 4 10:39 /dev/sdb1
brw-rw---- 1 root disk 8, 32 Feb 4 10:39 /dev/sdc
brw-rw---- 1 root disk 8, 33 Feb 4 10:39 /dev/sdc1
使用udev配置裸设备
# cat /etc/udev/rules.d/60-raw.rules
# Enter raw device bindings here.
ACTION=="add",KERNEL=="sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add",KERNEL=="raw1",OWNER="grid",GROUP="asmadmin",MODE="660"
ACTION=="add",KERNEL=="sdc1",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add",KERNEL=="raw2",OWNER="grid",GROUP="asmadmin",MODE="660"
启动udev
# start_udev
Starting udev: [ OK ]
检查裸设备权限
# ls -l /dev/raw/raw*
crw-rw---- 1 grid asmadmin 162, 1 Feb 4 10:57 /dev/raw/raw1
crw-rw---- 1 grid asmadmin 162, 2 Feb 4 10:57 /dev/raw/raw2
11、 安装GI和Oracle
安装GI、Oracle软件及DBCA建库可以参考Windows环境的安装文档,这里只记录在安装时,如果不预先分配OCR磁盘时,在安装GI时第二个节点运行root.sh脚本的运行结果:
节点2:
[root@tony4 ~]# /u01/app/11.2/grid/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/11.2/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/11.2/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
OLR initialization - successful
Adding Clusterware entries to upstart
CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node tony3, number 1, and is terminating
An active cluster was found during exclusive startup, restarting to join the cluster
Start of resource "ora.crsd" failed
CRS-2800: Cannot start resource 'ora.asm' as it is already in the INTERMEDIATE state on server 'tony4'
CRS-4000: Command Start failed, or completed with errors.
Failed to start Oracle Grid Infrastructure stack
Failed to start Cluster Ready Services at /u01/app/11.2/grid/crs/install/crsconfig_lib.pm line 1286.
/u01/app/11.2/grid/perl/bin/perl -I/u01/app/11.2/grid/perl/lib -I/u01/app/11.2/grid/crs/install /u01/app/11.2/grid/crs/install/rootcrs.pl execution failed
[root@tony4 ~]#
也有可能报类似以下错:
ORA-15032: not
all alterations performed
ORA-15017: diskgroup "CRSDG" cannot be mounted
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "CRSDG"
或者通过ASM日志信息可以看到如下报错:
Tue Feb 03 06:16:03 2015
SQL> ALTER DISKGROUP ALL MOUNT /* asm agent call crs *//* {0:0:209} */
NOTE: Diskgroup used for Voting files is:
CRSDG
Diskgroup used for OCR is:CRSDG
NOTE: cache registered group CRSDG number=1 incarn=0x880b0a1a
NOTE: cache began mount (not first) of group CRSDG number=1 incarn=0x880b0a1a
NOTE: Assigning number (1,0) to disk (/dev/raw/raw1)
ERROR: no read quorum in group: required 1, found 0 disks
NOTE: cache dismounting (clean) group 1/0x880B0A1A (CRSDG)
NOTE: messaging CKPT to quiesce pins Unix process pid: 15740, image: oracle@tony4 (TNS V1-V3)
NOTE: dbwr not being msg'd to dismount
NOTE: lgwr not being msg'd to dismount
NOTE: cache dismounted group 1/0x880B0A1A (CRSDG)
NOTE: cache ending mount (fail) of group CRSDG number=1 incarn=0x880b0a1a
NOTE: cache deleting context for group CRSDG 1/0x880b0a1a
Tue Feb 03 06:16:04 2015
NOTE: No asm libraries found in the system
ASM Health Checker found 1 new failures
GMON dismounting group 1 at 2 for pid 23, osid 15740
NOTE: Disk in mode 0x8 marked for de-assignment
ERROR: diskgroup CRSDG was not mounted
WARNING: Disk Group CRSDG containing configured OCR is not mounted
WARNING: Disk Group CRSDG containing voting files is not mounted
ORA-15032: not all alterations performed
ORA-15017: diskgroup "CRSDG" cannot be mounted
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "CRSDG"
ERROR: ALTER DISKGROUP ALL MOUNT /* asm agent call crs *//* {0:0:209} */
SQL> ALTER DISKGROUP ALL ENABLE VOLUME ALL /* asm agent *//* {0:0:209} */
Tue Feb 03 06:25:17 2015
SQL> alter diskgroup all mount
NOTE: Diskgroup used for Voting files is:
CRSDG
Diskgroup used for OCR is:CRSDG
NOTE: cache registered group CRSDG number=1 incarn=0x880b0a1e
NOTE: cache began mount (not first) of group CRSDG number=1 incarn=0x880b0a1e
NOTE: Assigning number (1,0) to disk (/dev/raw/raw1)
Tue Feb 03 06:25:17 2015
ERROR: no read quorum in group: required 1, found 0 disks
NOTE: cache dismounting (clean) group 1/0x880B0A1E (CRSDG)
NOTE: messaging CKPT to quiesce pins Unix process pid: 16484, image: oracle@tony4 (TNS V1-V3)
NOTE: dbwr not being msg'd to dismount
NOTE: lgwr not being msg'd to dismount
NOTE: cache dismounted group 1/0x880B0A1E (CRSDG)
NOTE: cache ending mount (fail) of group CRSDG number=1 incarn=0x880b0a1e
NOTE: cache deleting context for group CRSDG 1/0x880b0a1e
Tue Feb 03 06:25:17 2015
NOTE: No asm libraries found in the system
ASM Health Checker found 1 new failures
GMON dismounting group 1 at 4 for pid 24, osid 16484
NOTE: Disk in mode 0x8 marked for de-assignment
ERROR: diskgroup CRSDG was not mounted
WARNING: Disk Group CRSDG containing configured OCR is not mounted
WARNING: Disk Group CRSDG containing voting files is not mounted
ORA-15032: not all alterations performed
ORA-15017: diskgroup "CRSDG" cannot be mounted
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "CRSDG"
ERROR: alter diskgroup all mount
检查两个节点的ASM磁盘状态,会发现节点2的MOUNT_STATUS,状态为CLOSED。
节点1:
SQL> select name,path,GROUP_NUMBER,MOUNT_STATUS,HEADER_STATUS,OS_MB,TOTAL_MB,FREE_MB from v$asm_disk
NAME PATH GROUP_NUMBER MOUNT_STAT HEADER_STA OS_MB TOTAL_MB FREE_MB
--------------- --------------- ------------ ---------- ---------- ---------- ---------- ----------
CRSDG_0000 /dev/raw/raw1 1 CACHED MEMBER 5114 5114 4761
SQL>
节点2:
SQL> select name,path,GROUP_NUMBER,MOUNT_STATUS,HEADER_STATUS,OS_MB,TOTAL_MB,FREE_MB from v$asm_disk
NAME PATH GROUP_NUMBER MOUNT_STAT HEADER_S OS_MB TOTAL_MB FREE_MB
------ ---------------- ------------ ---------- -------- ---------- ---------- ----------
/dev/raw/raw1 0 CLOSED MEMBER 5114 0 0
SQL>
安装成功时,节点2的root.sh运行结果为:
# /u01/app/11.2/grid/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/11.2/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/11.2/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
OLR initialization - successful
Adding Clusterware entries to upstart
CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node tony3, number 1, and is terminating
An active cluster was found during exclusive startup, restarting to join the cluster
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
[root@tony4 ~]#
Tony.Tang(TangYun)20150205
——————————End————————————————————
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24930246/viewspace-1426856/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24930246/viewspace-1426856/