溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

MAC Vmware Fusion+OracleLinux+Oracle11gRAC

發(fā)布時間:2020-08-18 12:32:04 來源:ITPUB博客 閱讀:180 作者:Blyth_li 欄目:關(guān)系型數(shù)據(jù)庫
本文獻給剛剛使用mac系統(tǒng),并且正在學(xué)習(xí)怎樣在虛擬機下安裝oracle rac的同學(xué)。 大量的截圖花費了我好多時間,希望能為您帶來幫助!

環(huán)境介紹:
主機操作系統(tǒng):OS X 10.9.4
虛擬機軟件:VMware Fusion 專業(yè)版6.0.3
虛擬機系統(tǒng):Oracle Linux 5.7
數(shù)據(jù)庫版本:Oracle 11g R2 11.2.0.3

如果您也使用筆記本安裝虛擬機運行Oracle,并且希望在家里或者公司無線網(wǎng)絡(luò)不是同一個網(wǎng)段都能使用的同學(xué),將虛擬網(wǎng)卡設(shè)置host only的方式會減少很多切換的麻煩。如果您不知道虛擬網(wǎng)卡是什么,參考本文做就可以了。

啟動Fusion虛擬機后在終端中輸入ifconfi查看虛擬網(wǎng)卡
ifconfig
vmnet1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 00:50:56:c0:00:01
inet 172.16.228.1 netmask 0xffffff00 broadcast 172.16.228.255
vmnet8: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 00:50:56:c0:00:08
inet 172.16.150.1 netmask 0xffffff00 broadcast 172.16.150.255

其中vmnet1為host only模式,我們的虛擬機public IP、vip、scanip要設(shè)置該網(wǎng)段內(nèi)。如果不啟動Fusion軟件的話不會輸出以上信息。

配置虛擬機資源


MAC Vmware Fusion+OracleLinux+Oracle11gRAC
     MAC Vmware Fusion+OracleLinux+Oracle11gRAC
              更多選項...
MAC Vmware Fusion+OracleLinux+Oracle11gRAC
        創(chuàng)建自定義虛擬機
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
   RAC1、RAC2、rawdisks目錄需要自己手工創(chuàng)建,名稱隨意
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
        加載OracleLinux操作系統(tǒng)的iso文件 - 連接CD/DVD

       MAC Vmware Fusion+OracleLinux+Oracle11gRAC
MAC Vmware Fusion+OracleLinux+Oracle11gRAC      MAC Vmware Fusion+OracleLinux+Oracle11gRAC

       安裝操作系統(tǒng)


MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
為rac1主添加第二塊網(wǎng)卡
MAC Vmware Fusion+OracleLinux+Oracle11gRAC
將網(wǎng)絡(luò)適配器、網(wǎng)絡(luò)適配器2都設(shè)置為“僅宿主機模式”,也就是host only方式。注意:如果您的網(wǎng)絡(luò)環(huán)境不會經(jīng)常變化,不會切換網(wǎng)段可以將第一塊網(wǎng)絡(luò)適配器設(shè)置為“橋接模式”

MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC

       啟動虛擬機安裝操作系統(tǒng)
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
       注意:為了快速部署安裝,此處省略了劃分磁盤的步驟


MAC Vmware Fusion+OracleLinux+Oracle11gRAC
        etho為public IP,和虛擬網(wǎng)卡一個網(wǎng)段172.16.228.x
        eth0為privateIP,IP地址自定義
        禁用IPv6設(shè)置
        Gateway設(shè)置為虛擬網(wǎng)卡地址,方便使用
MAC Vmware Fusion+OracleLinux+Oracle11gRAC
    冰城哈爾濱Asia/Harbin
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
       此處不選擇任何項目,后面會采用更好的方法來補充安裝所需的包 yum install oracle-validated
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
       測試環(huán)境關(guān)閉防火墻
MAC Vmware Fusion+OracleLinux+Oracle11gRAC
       測試環(huán)境關(guān)閉SELinux
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
       此處不創(chuàng)建用戶,在后面統(tǒng)一創(chuàng)建用戶
MAC Vmware Fusion+OracleLinux+Oracle11gRAC
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
克隆虛擬機

退出當(dāng)前虛擬機的光盤 - 創(chuàng)建完整克隆
采用克隆的方法可以大大縮短創(chuàng)建第二臺虛擬機的時間

MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
        克隆路徑為RAC2
MAC Vmware Fusion+OracleLinux+Oracle11gRAC
        RAC2克隆完成
MAC Vmware Fusion+OracleLinux+Oracle11gRAC
        修改rac2主機名、IP地址
        由于rac2是克隆主機,所以主機名和IP地址需要手工改動
MAC Vmware Fusion+OracleLinux+Oracle11gRAC
創(chuàng)建共享磁盤
rac1主機上添加新硬盤
ocr_vote_disk
ocr_vote_disk2
ocr_vote_disk3
data_disk1
data_disk2
data_disk3
data_disk4
arch_disk
MAC Vmware Fusion+OracleLinux+Oracle11gRAC
       “預(yù)先非配磁盤空間”必須勾選,這是共享磁盤的必要條件之一
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
          在rac2主機創(chuàng)建新磁盤
                只需要共享剛剛由rac1主機創(chuàng)建好的磁盤就可以了
MAC Vmware Fusion+OracleLinux+Oracle11gRAC
        與創(chuàng)建此虛擬磁盤的虛擬機共享此虛擬磁盤
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
       創(chuàng)建完成后,rac1、rac2的主機配置
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
   使用FTP工具上傳安裝介質(zhì)到rac1主機

     設(shè)置rac1、rac2 /etc/hosts文件

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6

172.16.228.101 rac1
172.16.228.201 rac1-vip

172.16.228.102 rac2
172.16.228.202 rac2-vip

172.16.228.91  cluster-scan
172.16.228.92  cluster-scan
172.16.228.93  cluster-scan

182.168.1.101  rac1-priv
182.168.1.102  rac2-priv

創(chuàng)建用戶和組
[root@rac1 ~]# groupadd -g 5000 asmadmin
[root@rac1 ~]# groupadd -g 5001 asmdba
[root@rac1 ~]# groupadd -g 5002 asmoper
[root@rac1 ~]# groupadd -g 6000 oinstall
[root@rac1 ~]# groupadd -g 6001 dba
[root@rac1 ~]# groupadd -g 6002 oper

[root@rac1 ~]# useradd -g oinstall -G asmadmin,asmdba,asmoper grid
[root@rac1 ~]# echo "grid"|passwd --stdin grid

[root@rac1 ~]# useradd -g oinstall -G dba,asmdba oracle
[root@rac1 ~]# echo "oracle"|passwd --stdin oracle

創(chuàng)建目錄
[root@rac1 ~]# mkdir /grid_base
[root@rac1 ~]# mkdir /grid_home
[root@rac1 ~]# chown grid:oinstall /grid_base
[root@rac1 ~]# chown grid:oinstall /grid_home
[root@rac1 ~]# mkdir /oracle
[root@rac1 ~]# chown oracle:oinstall /oracle

關(guān)閉ntpd
[root@rac1 ~]# chkconfig ntpd off
[root@rac1 ~]# mv /etc/ntp.conf /etc/ntp.conf.bak

掛載光盤
[root@rac1 ~]# mount /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only

安裝操作系統(tǒng)所需的各種包
注意:該操作比圖形化安裝系統(tǒng)依賴包更加方便。
echo "[oel5]

name = Enterprise Linux 5.7 DVD

baseurl=file:///mnt/Server/

gpgcheck=0

enabled=1" >> /etc/yum.repos.d/public-yum-el5.repo

[root@rac1 ~]# yum install oracle-validated

補充grid用戶的配置
echo "grid   soft   nofile    131072
grid   hard   nofile    131072

grid   soft   nproc    131072

grid   hard   nproc    131072

grid   soft   core    unlimited

grid   hard   core    unlimited

grid   soft   memlock    50000000

grid   hard   hemlock    50000000" >> /etc/security/limits.conf

關(guān)閉rac1、rac2主機
[root@rac1 ~]# init 0
[root@rac2 ~]# init 0

解除VMware Fusion不支持共享磁盤的限制

找到RAC1安裝路徑下的虛擬機文件rac1,右鍵點擊rac1,選擇”顯示包內(nèi)容”
用文本工具打開rac1.vmx,添加下面的配置信息
#shared disks configure
disk.locking="false"
diskLib.dataCacheMaxSize="0"
diskLib.dataCacheMaxReadAheadSize="0"
diskLib.DataCacheMinReadAheadSize="0"
diskLib.dataCachePageSize="4096"
diskLib.maxUnsyncedWrites="0"
scsi0:1.deviceType="disk"
scsi0:1.mode = "independent-persistent"
scsi0.sharedBus = “VIRTUAL"

同樣在RAC2路徑下找到rac2文件執(zhí)行相同的操作
#shared disks configure
disk.locking="false"
diskLib.dataCacheMaxSize="0"
diskLib.dataCacheMaxReadAheadSize="0"
diskLib.DataCacheMinReadAheadSize="0"
diskLib.dataCachePageSize="4096"
diskLib.maxUnsyncedWrites="0"
scsi0:1.deviceType="disk"
scsi0:1.mode = "independent-persistent"
scsi0.sharedBus = “VIRTUAL"


重新啟動rac1、rac2

查看共享磁盤
[root@rac1 ~]# ls -l /dev/sd*
brw-r----- 1 root disk 8,   0 Sep 11 22:52 /dev/sda
brw-r----- 1 root disk 8,   1 Sep 11 22:53 /dev/sda1
brw-r----- 1 root disk 8,   2 Sep 11 22:52 /dev/sda2
brw-r----- 1 root disk 8,  16 Sep 11 22:52 /dev/sdb
brw-r----- 1 root disk 8,  32 Sep 11 22:52 /dev/sdc
brw-r----- 1 root disk 8,  48 Sep 11 22:52 /dev/sdd
brw-r----- 1 root disk 8,  64 Sep 11 22:52 /dev/sde
brw-r----- 1 root disk 8,  80 Sep 11 22:52 /dev/sdf
brw-r----- 1 root disk 8,  96 Sep 11 22:52 /dev/sdg
brw-r----- 1 root disk 8, 112 Sep 11 22:52 /dev/sdh
brw-r----- 1 root disk 8, 128 Sep 11 22:52 /dev/sdi

udev配置共享磁盤
for i in b c d e f g h i ;
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id -g -u -s %p\", RESULT==\"`scsi_id -g -u -s /block/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""  >> /etc/udev/rules.d/99-oracle-asmdevices.rules
done

[root@rac1 ~]# start_udev
Starting udev: [  OK  ]

查看配置結(jié)果
[root@rac1 ~]# ls -l /dev/asm*
brw-rw---- 1 grid asmadmin 8,  16 Sep 11 23:08 /dev/asm-diskb
brw-rw---- 1 grid asmadmin 8,  32 Sep 11 23:08 /dev/asm-diskc
brw-rw---- 1 grid asmadmin 8,  48 Sep 11 23:08 /dev/asm-diskd
brw-rw---- 1 grid asmadmin 8,  64 Sep 11 23:08 /dev/asm-diske
brw-rw---- 1 grid asmadmin 8,  80 Sep 11 23:08 /dev/asm-diskf
brw-rw---- 1 grid asmadmin 8,  96 Sep 11 23:08 /dev/asm-diskg
brw-rw---- 1 grid asmadmin 8, 112 Sep 11 23:08 /dev/asm-diskh
brw-rw---- 1 grid asmadmin 8, 128 Sep 11 23:08 /dev/asm-diski

配置rac2主機的udev
[root@rac1 ~]# scp /etc/udev/rules.d/99-oracle-asmdevices.rules rac2:/etc/udev/rules.d/99-oracle-asmdevices.rules

[root@rac2 ~]# start_udev
Starting udev: [  OK  ]
[root@rac2 ~]# ls -l /dev/asm*
brw-rw---- 1 grid asmadmin 8,  48 Sep 11 23:10 /dev/asm-diskb
brw-rw---- 1 grid asmadmin 8,  32 Sep 11 23:10 /dev/asm-diskc
brw-rw---- 1 grid asmadmin 8,  16 Sep 11 23:10 /dev/asm-diskd
brw-rw---- 1 grid asmadmin 8, 112 Sep 11 23:10 /dev/asm-diske
brw-rw---- 1 grid asmadmin 8,  96 Sep 11 23:10 /dev/asm-diskf
brw-rw---- 1 grid asmadmin 8,  80 Sep 11 23:10 /dev/asm-diskg
brw-rw---- 1 grid asmadmin 8,  64 Sep 11 23:10 /dev/asm-diskh
brw-rw---- 1 grid asmadmin 8, 128 Sep 11 23:10 /dev/asm-diski

配置grid用戶bash_pofile
[root@rac1 ~]# su - grid
[grid@rac1 ~]$ vi .bash_profile

CRS_HOME=/grid_home/11.2.0/grid
ORACLE_BASE=/grid_base
ORACLE_SID=+ASM1
stty erase ^h
alias s="sqlplus / as sysasm"
PATH=$CRS_HOME/bin:$PATH:$HOME/bin

[grid@rac1 ~]$ scp .bash_profile rac2:~/

[root@rac2 ~]# su - grid
[grid@rac2 ~]$ vi .bash_profile
CRS_HOME=/grid_home/11.2.0/grid
ORACLE_BASE=/grid_base
ORACLE_SID=+ASM2
stty erase ^h
alias s="sqlplus / as sysasm"
PATH=$CRS_HOME/bin:$PATH:$HOME/bin
export PATH CRS_HOME ORACLE_BASE ORACLE_SID


解壓縮集群軟件安裝包
[grid@rac1 ~]$ cd /grid_base
[grid@rac1 grid_base]$ mkdir 11203_grid_install
[grid@rac1 grid_base]$ cd 11203_grid_install/
[grid@rac1 11203_grid_install]$ unzip /tmp/p10404530_112030_Linux-x86-64_3of7.zip

MAC Vmware Fusion+OracleLinux+Oracle11gRAC
啟動工具Xquartz
Xquartz在啟動圖形安裝時不需要export DISPLAY
連接grid用戶
ssh -X grid@172.16.228.101
/grid_base/11203_grid_install/grid/runInstaller
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
MAC Vmware Fusion+OracleLinux+Oracle11gRAC

    推薦使用圖形化SSH互信,省去很多手工配置的時間

MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
  grid的base目錄和home目錄要分開

MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC

  Task.resolv.conf Integrity錯誤可以忽略,不影響安裝
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC

順序執(zhí)行以下腳本,執(zhí)行完畢點擊ok
[root@rac1 ~]# /grid_home/oraInventory/orainstRoot.sh
[root@rac2 ~]# /grid_home/oraInventory/orainstRoot.sh
[root@rac1 ~]# /grid_home/11.2.0/grid/root.sh
[root@rac2 ~]# /grid_home/11.2.0/grid/root.sh
 
   以下錯誤提示不影響安裝

MAC Vmware Fusion+OracleLinux+Oracle11gRAC

安裝ASM磁盤組

在Xquartz輸入asmca后配置如下
OCRVOTE:
ocr_vote_disk
ocr_vote_disk2
ocr_vote_disk3

DATA:
data_disk1
data_disk2
data_disk3
data_disk4

ARCH:
arch_disk

MAC Vmware Fusion+OracleLinux+Oracle11gRAC

設(shè)置Oracle用戶bash_profile
[oracle@rac1 ~]$ vi .bash_profile
ORACLE_BASE=/oracle
ORACLE_HOME=/oracle/product/11.2.0/dbhome_1
ORACLE_SID=PROD1
PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:$PATH:$HOME/bin
export PATH ORACLE_BASE ORACLE_HOME ORACLE_SID

[oracle@rac2 ~]$ vi .bash_profile
ORACLE_BASE=/oracle
ORACLE_HOME=/oracle/product/11.2.0/dbhome_1
ORACLE_SID=PROD2
PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:$PATH:$HOME/bin
export PATH ORACLE_BASE ORACLE_HOME ORACLE_SID

su - oracle
cd /oracle
mkdir 11203_db_install
cd 11203_db_install
unzip /tmp/p10404530_112030_Linux-x86-64_1of7.zip
unzip /tmp/p10404530_112030_Linux-x86-64_2of7.zip

安裝數(shù)據(jù)庫軟件
重新開啟XQuartz,使用oracle用戶連接
ssh -X oracle@172.16.228.101
/oracle/11203_db_install/database/runInstaller
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC

  推薦使用SSH互信安裝,省去手工配置的過程
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
  此處的驗證錯誤可以忽略,不影響安裝

MAC Vmware Fusion+OracleLinux+Oracle11gRAC
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC
按照提示執(zhí)行腳本
[root@rac1 ~]# /oracle/product/11.2.0/dbhome_1/root.sh
[root@rac2 ~]# /oracle/product/11.2.0/dbhome_1/root.sh

MAC Vmware Fusion+OracleLinux+Oracle11gRAC

創(chuàng)建數(shù)據(jù)庫
  集群數(shù)據(jù)庫
MAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRACMAC Vmware Fusion+OracleLinux+Oracle11gRAC

數(shù)據(jù)庫安裝成功!

SQL> select INST_ID,INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,STATUS,THREAD# from gv$instance;

   INST_ID INSTANCE_NUMBER INSTANCE_NAME    HOST_NAME  STATUS          THREAD#
---------- --------------- ---------------- ---------- ------------ ----------
         1               1 PROD1            rac1       OPEN                  1
         2               2 PROD2            rac2       OPEN                  2
向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI