MAC+Vmware Fusion安裝Oracle11g RAC

tangyunoracle發表於2015-02-05

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、     安裝GIOracle

安裝GIOracle軟體及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磁碟狀態,會發現節點2MOUNT_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>

 

安裝成功時,節點2root.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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章