Vmware linux redhat6.4 安裝11g(11.2.0.1) 雙節點RAC

記錄每一次錯誤發表於2019-04-29

Vmware linux redhat6.4 安裝 11g  雙節點 RAC

IP地址規劃:

192.168.0.180  rac01

10.10.0.180       rac01-priv

192.168.0.181  rac01-vip

------------------------------------

192.168.0.190  rac02

10.10.0.180       rac02-priv

192.168.0.191  rac02-vip

--------------------------------------

192.168.0.200  rac.scan-ip

安裝redhat 環境,需要注意的是安裝11g  rac的時候需要:

在引導介面的最後選擇Customize now 選項base system 選擇------iscsi storage client 

選項Desktop 選擇 Desktop和KDE Desktop

選項Servers 選擇 system administration tools oracle-rdbms*

選項Languages 選擇 Chinese Support

系統安裝完成以後,個人喜歡安裝個vmware tools,這樣可以複製貼上外面的檔案。

建立共享儲存,在window系統上使用cmd命令開啟DOS命令執行介面,(路徑根據實際情況做修改)

執行以下命令,建立共享磁碟:

cd C:\Program Files (x86)\VMware\VMware Workstation\

vmware-vdiskmanager.exe -c -s 30G -a lsilogic -t 2  E:\Sharedisk\ocr.vmdk

vmware-vdiskmanager.exe -c -s 30G -a lsilogic -t 2  E:\Sharedisk\votingdisk.vmdk

vmware-vdiskmanager.exe -c -s 40G -a lsilogic -t 2  E:\Sharedisk\data.vmdk

vmware-vdiskmanager.exe -c -s 100G -a lsilogic -t 2  D:\12c\Sharedisk\data1.vmdk

1.修改selinux,關閉防火牆(分別在節點一,節點二上執行)。

[root@rac1 ~]# setenforce 0

setenforce: SELinux is disabled

[root@rac1 ~]# vi /etc/sysconfig/selinux 

SELINUX=disabled

[root@rac1 ~]# service iptables stop

[root@rac1 ~]# chkconfig iptables off

然後在節點而上執行。

2.配置yum源,安裝所需要的軟體(分別在節點一,節點二上執行)。

可以用

yum install -y  binutils* 

yum install -y  compat-libcap1*

yum install -y       compat-libstdc*

yum install -y       gcc* 

yum install -y       glibc* 

yum install -y       ksh*

yum install -y     libiao*

yum install -y     compat*

yum install -y     elfutils*

yum install -y     libgcc*

yum install -y     libstdc*

yum install -y     unix*

yum install -y     pdksh*

yum install -y       libgcc*

yum install -y       libstdc++*

yum install -y       libXi*  

yum install -y       libXtst* 

yum install -y       make* 

yum install -y       sysstat*

yum install -y   unixODBC.x86_64 0:2.2.14-12.el6_3      

yum install -y    nscd

也可以用

yum install -y     binutils-2.20.51.0.2-5.11.el6 (x86_64)  

yum install -y     compat-libcap1-1.10-1 (x86_64)

yum install -y     compat-libstdc++-33-3.2.3-69.el6 (x86_64)

yum install -y     compat-libstdc++-33-3.2.3-69.el6 (i686)

yum install -y     gcc-4.4.4-13.el6 (x86_64)

yum install -y     gcc-c++-4.4.4-13.el6 (x86_64)

yum install -y     glibc-2.12-1.7.el6 (i686)      

yum install -y     glibc-2.12-1.7.el6 (x86_64)

yum install -y     glibc-devel-2.12-1.7.el6 (x86_64)  

yum install -y     glibc-devel-2.12-1.7.el6 (i686)     

yum install -y     ksh    

yum install -y     libgcc-4.4.4-13.el6 (i686)

yum install -y     libgcc-4.4.4-13.el6 (x86_64)

yum install -y     libstdc++-4.4.4-13.el6 (x86_64)      

yum install -y     libstdc++-4.4.4-13.el6 (i686)

yum install -y     libstdc++-devel-4.4.4-13.el6 (x86_64)

yum install -y     libstdc++-devel-4.4.4-13.el6 (i686)

yum install -y     libaio-0.3.107-10.el6 (x86_64)

yum install -y     libaio-0.3.107-10.el6 (i686)

yum install -y      libaio-devel-0.3.107-10.el6 (x86_64)

yum install -y      libaio-devel-0.3.107-10.el6 (i686)                     

yum install -y      libXext-1.1 (x86_64)

yum install -y      libXext-1.1 (i686)

yum install -y      libXtst-1.0.99.2 (x86_64)

yum install -y      libXtst-1.0.99.2 (i686)

yum install -y      libX11-1.3 (x86_64)

yum install -y      libX11-1.3 (i686)

yum install -y      libXau-1.0.5 (x86_64)       

 yum install -y      libXau-1.0.5 (i686)

 yum install -y      libxcb-1.5 (x86_64)

 yum install -y      libxcb-1.5 (i686)

 yum install -y      libXi-1.3 (x86_64)

 yum install -y      libXi-1.3 (i686)       

  yum install -y     make-3.81-19.el6       

  yum install -y     sysstat-9.0.4-11.el6 (x86_64)       

    yum install -y   unixODBC.x86_64 0:2.2.14-12.el6_3       

   yum install -y    nscd

兩個任選其一,
3.建立相應使用者,組,目錄,並修改使用者的許可權(分別在節點一,節點二上執行)。

groupadd -g 1006 oinstall

groupadd -g 1001 dba

groupadd -g 1002 oper

groupadd -g 1003 asmadmin

groupadd -g 1004 asmdba

groupadd -g 1005 asmoper

useradd -u 1001 -g oinstall -G asmadmin,asmdba,asmoper,dba,oper -d /home/grid -m grid

useradd -u 1002 -g oinstall -G asmadmin,asmdba,asmoper,dba,oper -d /home/oracle -m oracle

echo oracle | passwd --stdin root 

echo oracle | passwd --stdin oracle 

echo oracle | passwd --stdin grid

mkdir -p /u01/app/oracle

mkdir -p /u01/app/oracle/product/11.1.0/dbhome_1

chown oracle:oinstall /u01/app/oracle

chown oracle:oinstall /u01/app/oracle/product/11.1.0/dbhome_1

mkdir -p /u01/app/oraInventory

chown grid:oinstall   /u01/app/oraInventory

mkdir -p /u01/app/11.1.0/grid

chown grid:oinstall /u01/app/11.1.0/grid

mkdir -p /u01/app/grid

chown grid:oinstall /u01/app/grid

  4.

核心引數設定(分別在兩個節點執行): 

[root@rac1 ~]# vi /etc/sysctl.conf 

kernel.msgmnb = 65536 

kernel.msgmax = 65536 

kernel.shmmax = 68719476736 

kernel.shmall = 4294967296 

fs.aio-max-nr = 1048576 

fs.file-max = 6815744 

kernel.shmmni = 4096 

kernel.sem = 250 32000 100 128 

net.ipv4.ip_local_port_range = 9000 65500 

net.core.rmem_default = 262144 

net.core.rmem_max = 4194304 

net.core.wmem_default = 262144 

net.core.wmem_max = 1048586 

net.ipv4.tcp_wmem = 262144 262144 262144 

net.ipv4.tcp_rmem = 4194304 4194304 4194304

5.配置oracle、grid使用者的shell限制 (分別在節點一,節點二上執行)

[root@rac1 ~]# vi /etc/security/limits.conf 

grid soft nproc 2047 

grid hard nproc 16384 

grid soft nofile 1024 

grid hard nofile 65536 

oracle soft nproc 2047 

oracle hard nproc 16384 

oracle soft nofile 1024 

oracle hard nofile 65536

6.配置grid,oracle使用者的環境變數(分別在節點一,節點二上執行)

grid使用者的環境變數:

rac01

export TMP=/tmp

export TMPDIR=$TMP

export ORACLE_SID=+ASM1  # RAC1

export ORACLE_BASE=/u01/app/grid

export ORACLE_HOME=/u01/app/11.1.0/grid

export PATH=/usr/sbin:$PATH

export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

umask 022

-----------------------------------------------

rac01

export TMP=/tmp

export TMPDIR=$TMP

export ORACLE_SID=+ASM2  # RAC1

export ORACLE_BASE=/u01/app/grid

export ORACLE_HOME=/u01/app/11.1.0/grid

export PATH=/usr/sbin:$PATH

export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

umask 022

oracle使用者的環境變數(分別在節點一,節點二上執行)

export TMP=/tmp

export TMPDIR=$TMP

export ORACLE_SID=orcl1  # RAC1

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=/u01/app/oracle/product/11.1.0/dbhome_1

export TNS_ADMIN=$ORACLE_HOME/network/admin

export PATH=/usr/sbin:$PATH

export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

-------------------------------------------------------------------------

rac2:

export TMP=/tmp

export TMPDIR=$TMP

export ORACLE_SID=orcl2  # RAC1

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=/u01/app/oracle/product/11.1.0/dbhome_1

export TNS_ADMIN=$ORACLE_HOME/network/admin

export PATH=/usr/sbin:$PATH

export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

7.關閉兩個節點,配置共享儲存。

在兩個節點的安裝目錄分別找到以  .vmx  結尾的檔案,分別在檔案中新增:

disk.EnableUUID="TRUE"


disk.locking = "FALSE"


scsi1.shared = "TRUE"


diskLib.dataCacheMaxSize = "0"


diskLib.dataCacheMaxReadAheadSize = "0"


diskLib.dataCacheMinReadAheadSize = "0"


diskLib.dataCachePageSize= "4096"


diskLib.maxUnsyncedWrites = "0"  


scsi1.present = "TRUE"


scsi1.virtualDev = "lsilogic"


scsil.sharedBus = "VIRTUAL"


scsi1:0.present = "TRUE"


scsi1:0.mode = "independent-persistent"


scsi1:0.fileName = "E:\Sharedisk\ocr.vmdk"


scsi1:0.deviceType = "disk"


scsi1:0.redo = ""


scsi1:1.present = "TRUE"


scsi1:1.mode = "independent-persistent"


scsi1:1.fileName = "E:\Sharedisk\votingdisk.vmdk"


scsi1:1.deviceType = "disk"


scsi1:1.redo = ""


scsi1:2.present = "TRUE"


scsi1:2.mode = "independent-persistent"


scsi1:2.fileName = "E:\Sharedisk\data.vmdk"


scsi1:2.deviceType = "disk"


scsi1:2.redo = ""


scsi1:3.present = "TRUE"


scsi1:3.mode = "independent-persistent"


scsi1:3.fileName = "D:\12c\Sharedisk\data1.vmdk"


scsi1:3.deviceType = "disk"


scsi1:3.redo = ""


新增完成以後啟動兩個節點。

這是我啟動完成的結果

[root@rac01 ~]# fdisk -l

Disk /dev/sda: 107.4 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 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: 0x00058437


   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       13055   104344576   8e  Linux LVM


Disk /dev/sdb: 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: 0x00000000



Disk /dev/sdc: 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: 0x00000000



Disk /dev/sdd: 42.9 GB, 42949672960 bytes

255 heads, 63 sectors/track, 5221 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/sde: 107.4 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 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/mapper/vg_rac01-lv_root: 53.7 GB, 53687091200 bytes

255 heads, 63 sectors/track, 6527 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/mapper/vg_rac01-lv_swap: 4194 MB, 4194304000 bytes

255 heads, 63 sectors/track, 509 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/mapper/vg_rac01-lv_home: 49.0 GB, 48964304896 bytes

255 heads, 63 sectors/track, 5952 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

使用fdisk /dev/sdb分割槽

[root@rac01 ~]# fdisk /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0x3d1d4623.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won't be recoverable.


Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)


WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

         switch off the mode (command 'c') and change display units to

         sectors (command 'u').


Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 

Value out of range.

Partition number (1-4): 1

First cylinder (1-3916, default 1): 

Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-3916, default 3916): 

Using default value 3916


Command (m for help): 

Command (m for help): w

依次將/dev/sdc,dev/sdd,/dev/sde分割槽,分割槽的結果

[root@rac01 ~]# fdisk -l


Disk /dev/sda: 107.4 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 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: 0x00058437


   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       13055   104344576   8e  Linux LVM


Disk /dev/sdb: 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: 0x3d1d4623


   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1        3916    31455238+  83  Linux


Disk /dev/sdc: 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: 0x3e220d36


   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1               1        3916    31455238+  83  Linux


Disk /dev/sdd: 42.9 GB, 42949672960 bytes

255 heads, 63 sectors/track, 5221 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: 0x3a2ab2ba


   Device Boot      Start         End      Blocks   Id  System

/dev/sdd1               1        5221    41937651   83  Linux


Disk /dev/sde: 107.4 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 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: 0x461aed4c


   Device Boot      Start         End      Blocks   Id  System

/dev/sde1               1       13054   104856223+  83  Linux


Disk /dev/mapper/vg_rac01-lv_root: 53.7 GB, 53687091200 bytes

255 heads, 63 sectors/track, 6527 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/mapper/vg_rac01-lv_swap: 4194 MB, 4194304000 bytes

255 heads, 63 sectors/track, 509 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/mapper/vg_rac01-lv_home: 49.0 GB, 48964304896 bytes

255 heads, 63 sectors/track, 5952 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


[root@rac01 udev]# for i in b c d e  ;

 do

 echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"" /etc/udev/rules.d/99-oracle-asmdevices.rules

 done

 

 

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c296b5de78f14a17b99b32f9815c", NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29d45475586d19351cdaae9eba8", NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c2902ebe46f2b04da69744504e94", NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29dc2029b4e0a8c90f74140bf06", NAME="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"


[root@rac01 rules.d]# start_udev

Starting udev:  

[root@rac01 rules.d]# ll /dev/asm*

brw-rw---- 1 grid asmadmin 8, 16 Apr 23 12:43 /dev/asm-diskb

brw-rw---- 1 grid asmadmin 8, 32 Apr 23 12:43 /dev/asm-diskc

brw-rw---- 1 grid asmadmin 8, 48 Apr 23 12:43 /dev/asm-diskd

brw-rw---- 1 grid asmadmin 8, 64 Apr 23 12:43 /dev/asm-diske

將節點二一中/etc/udev/rules.d/99-oracle-asmdevices.rules檔案複製節點二/etc/udev/rules.d/下

[root@rac01 rules.d]# scp 99-oracle-asmdevices.rules    rac02:/etc/udev/rules.d/

root@rac02's password: 

99-oracle-asmdevices.rules                                                              100%  864     0.8KB/s   00:00    

[root@rac01 rules.d]# 

[root@rac02 ~]# start_udev

Starting udev:                                             [  OK  ]

[root@rac02 ~]# ll /dev/asm*

brw-rw---- 1 grid asmadmin 8, 16 Apr 23 12:47 /dev/asm-diskb

brw-rw---- 1 grid asmadmin 8, 32 Apr 23 12:47 /dev/asm-diskc

brw-rw---- 1 grid asmadmin 8, 48 Apr 23 12:47 /dev/asm-diskd

brw-rw---- 1 grid asmadmin 8, 64 Apr 23 12:47 /dev/asm-diske

在官方下載11.2.0.1版本的資料庫,我這安裝11.2.0.1的rac是為了以後升級到11.2.0.4。


Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

Vmware linux redhat6.4 安裝11g(11.2.0.1)  雙節點RAC

在執行root.sh指令碼的時候回出現

CRS-4124: Oracle High Availability Services startup failed. CRS-4000的相關報錯,

解決辦法請檢視:http://blog.itpub.net/31547066/viewspace-2642437/

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31547066/viewspace-2642907/,如需轉載,請註明出處,否則將追究法律責任。

相關文章