Install Oracle RAC 18c
Install Oracle RAC 18c
2 Install OS to VM 1
3 Configure OS 1
4 Create Group & User
5 Shutdown VM 1
6 Clone VM 1 to VM 2
7 Add shared disks to VM 1
8 Sperate Disk
9 Configure OS 2
10 Add shared disks to VM 2
11 Copy software to VM 1
12 Config DNS server
13 Snapshot Vmware & Disable Network & Configure DNS File
14 Install Grid
15 Instal Oracle
16 DBCA
CPU 1 Core
RAM 4GB
Storage 50GB Dynamic VMDK
Network 1 Bridged VMnet0
Network 2 NAT VMnet8
Network 3 Host-only VMnet1
Display 16MB
Software Selection
Minimum Install
Network
ens32 (eth0): DHCP (Connect Automatically)
ens33 (eth1): IP=192.168.80.101, Subnet=255.255.255.0, Gateway=192.168.80.1, DNS=192.168.80.100, Search=ora
ens34 (eth2): IP=192.168.10.101, Subnet=255.255.255.0, Gateway=<blank>, DNS=<blank>, Search=<blank> (Conne
hostname : rac1.oracledb.xyz
Add the following lines to the "/etc/sysctl.conf" file, or in a file called "/etc/sysctl.d/98-oracle.conf".
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
Check /sbin/sysctl -p
Apart form the localhost address, the "/etc/hosts" file can be left blank, but I prefer to put the addresses in for refe
# Public
192.168.80.101 rac1.oracledb.xyz rac1
192.168.80.102 rac2.oracledb.xyz rac2
192.168.80.103 rac3.oracledb.xyz rac3
# Private
192.168.10.101 rac1-priv.oracledb.xyz rac1-priv
192.168.10.102 rac2-priv.oracledb.xyz rac2-priv
192.168.10.103 rac3-priv.oracledb.xyz rac3-priv
# Virtual
192.168.80.104 rac1-vip.oracledb.xyz rac1-vip
192.168.80.105 rac2-vip.oracledb.xyz rac2-vip
192.168.80.106 rac3-vip.oracledb.xyz rac3-vip
# SCAN
#192.168.80.107 o18c-scan.oracledb.xyz o18c-scan
#192.168.80.108 o18c-scan.oracledb.xyz o18c-scan
#192.168.80.109 o18c-scan.oracledb.xyz o18c-scan
Make sure the "/etc/resolv.conf" file includes a nameserver entry that points to the correct nameserver. Also, if the
#domain oracledb.xyz
search oracledb.xyz
localdomain 192.168.80.100
The changes to the "resolv.conf" will be overwritten by the network manager, due to the presence of the NAT inter
ONBOOT=no
Change the setting of SELinux to permissive by editing the "/etc/selinux/config" file, making sure the SELINUX flag is
SELINUX=permissive
If you have the Linux firewall enabled, you will need to disable or configure it, as shown here or here. The following
systemctl stop firewalld
systemctl disable firewalld
eLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
OL7/latest/x86_64/getPackage/oracleasm-support-2.1.11-2.el7.x86_64.rpm
b/oracleasmlib-2.0.12-1.el7.x86_64.rpm
8-oracle.conf".
the presence of the NAT interface. For this reason, this interface should now be disabled on startup. You can enable it manually if you nee
n enable it manually if you need to access the internet from the VMs. Edit the "/etc/sysconfig/network-scripts/ifcfg-enp0s3" (eth0) file, ma
ts/ifcfg-enp0s3" (eth0) file, making the following change. This will take effect after the next restart.
RAC 3
curl -o oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPac
yum -y localinstall oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
curl -o oracleasm-support-2.1.11-2.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/ora
yum -y localinstall oracleasm-support-2.1.11-2.el7.x86_64.rpm
curl -o oracleasmlib-2.0.12-1.el7.x86_64.rpm https://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.12-1.el7.x86_6
yum -y localinstall oracleasmlib-2.0.12-1.el7.x86_64.rpm
yum -y install gcc-c++
vi /etc/hosts
# Public
#192.168.80.101 rac1.oracledb.xyz rac1
#192.168.80.102 rac2.oracledb.xyz rac2
#192.168.80.103 rac3.oracledb.xyz rac3
# Private
192.168.10.101 rac1-priv.oracledb.xyz rac1-priv
192.168.10.102 rac2-priv.oracledb.xyz rac2-priv
192.168.10.103 rac3-priv.oracledb.xyz rac3-priv
# Virtual
192.168.80.104 rac1-vip.oracledb.xyz rac1-vip
192.168.80.105 rac2-vip.oracledb.xyz rac2-vip
192.168.80.106 rac3-vip.oracledb.xyz rac3-vip
# SCAN
#192.168.80.107 o18c-scan.oracledb.xyz o18c-scan
#192.168.80.108 o18c-scan.oracledb.xyz o18c-scan
#192.168.80.109 o18c-scan.oracledb.xyz o18c-scan
vi /etc/hostname
Change the setting of SELinux to permissive by editing the "/etc/selinux/config" file, making sure the SELINUX flag is
SELINUX=permissive
vi /etc/fstab
rac1:/u03/data1 /u06/data1 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
rac1:/u04/data2 /u06/data2 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
rac1:/u05/data3 /u06/data3 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
chkconfig nfs on
service nfs restart
service nfs status
vi /etc/chrony.conf
systemctl enable chronyd
systemctl restart chronyd
chronyc -a 'burst 4/4'
chronyc -a makestep
oracleasm configure -i
grid
asmadmin
y
y
oracleasm init
oracleasm scandisks
oracleasm listdisks
RAC 1
cd /u02/grid
./gridSetup.sh
srvctl add instance -d DB01 -i DB013 -n rac3
RAC 1 oracle
./sshUserSetup.sh -user oracle -hosts "rac1 rac2 rac3" -noPromptPassphrase
cd /u01/oracle/addnote
sh addnote.sh
eLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
OL7/latest/x86_64/getPackage/oracleasm-support-2.1.11-2.el7.x86_64.rpm
b/oracleasmlib-2.0.12-1.el7.x86_64.rpm
768,actimeo=0 0 0
768,actimeo=0 0 0
768,actimeo=0 0 0
Make sure NTP (Chrony on OL7/RHEL7) is enabled.
Install NTP
yum -y install ntp
systemctl start ntpd
systemctl enable ntpd
systemctl status ntpd
NTP server
Trong W32Time -> Config -> AnnounceFlags . Thay đổi Value data = 5
Khởi động lại dịch vụ W32Time
NTP client
ntpdate 192.168.80.100
vi /etc/ntp.conf
server 192.168.80.100 iburst prefer
comment all other server
vi /etc/chrony.conf
server 192.168.80.100 iburst prefer
comment all other server
Test
chronyc sources
chronyc tracking
timedatectl status
fdisk /dev/sdb
fdisk /dev/sdc
fdisk /dev/sdd
mkfs.ext4 /dev/sdb1
mkfs.ext4 /dev/sdc1
mkfs.ext4 /dev/sdd1
vi /etc/fstab
/dev/sdb1 /u03 auto auto 0 0
/dev/sdc1 /u04 auto auto 0 0
/dev/sdd1 /u05 auto auto 0 0
Create NFS
mkdir /u03/data1
mkdir /u04/data2
mkdir /u05/data3
vi /etc/exports
/u03/data1 *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/u04/data2 *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/u05/data3 *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
chkconfig nfs on
service nfs restart
service nfs status
vi /etc/fstab
nas1:/u03/data1 /u06/data1 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
nas1:/u04/data2 /u06/data2 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
nas1:/u05/data3 /u06/data3 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
vi /etc/hosts
#NAS
192.168.80.101 nas1.oracledb.xyz nas1
mount /u06/data1
mount /u06/data2
mount /u06/data3
Node 2
mkdir /u06/data1
mkdir /u06/data2
mkdir /u06/data3
vi /etc/fstab
rac1:/u03/data1 /u06/data1 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
rac1:/u04/data2 /u06/data2 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
rac1:/u05/data3 /u06/data3 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
mount /u06/data1
mount /u06/data2
mount /u06/data3
hostname: rac2.oracledb.xyz
ens33 (eth0): DHCP (*Not* Connect Automatically)
ens34 (eth1): IP=192.168.56.102, Subnet=255.255.255.0, Gateway=192.168.56.1, DNS=192.168.80.100
ens35 (eth2): IP=192.168.20.102, Subnet=255.255.255.0, Gateway=<blank>, DNS=<blank>, Search=<bl
vi /etc/hostname
Edit the "/etc/sysconfig/network-scripts/ifcfg-enp0s8" (eth1), amending only the IPADDR settings as follo
IPADDR=192.168.56.102
Edit the "/etc/sysconfig/network-scripts/ifcfg-enp0s9" (eth2), amending only the IPADDR settings as follo
IPADDR=192.168.20.102
su - oracle
vi .bash_profile
export ORACLE_HOSTNAME=rac2.oracledb.xyz
export ORACLE_UNQNAME=DB01
export ORACLE_SID=DB012
oracleasm scandisks
oracleasm listdisks
nly the IPADDR settings as follows and deleting the UUID entry.
nly the IPADDR settings as follows and deleting the UUID entry.
Use the "fdisk" command to partition the disks sdb to sde. The following output shows the expected fdisk output fo
fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
oracleasm configure -i
grid
asmadmin
y
y
oracleasm init
oracleasm createdisk DATA1 /dev/sdb1
oracleasm createdisk DATA2 /dev/sdc1
oracleasm scandisks
oracleasm listdisks
In each case, the sequence of answers is "n", "p", "1", "Return", "Return" and "w".
ls -al /dev/sd*1
/usr/lib/udev/scsi_id -g -u -d /dev/sdb1
1ATA_VBOX_HARDDISK_VB189c7a69-689f61b0
/usr/lib/udev/scsi_id -g -u -d /dev/sdc1
1ATA_VBOX_HARDDISK_VBc4ae174e-fc756d12
/usr/lib/udev/scsi_id -g -u -d /dev/sdd1
1ATA_VBOX_HARDDISK_VBa4e03079-ae751cbd
Using these values, edit the "/etc/udev/rules.d/99-oracle-asmdevices.rules" file adding the following 4 entries. All p
/sbin/partprobe /dev/sdb1
/sbin/partprobe /dev/sdc1
/sbin/partprobe /dev/sdd1
The disks should now be visible and have the correct ownership using the following command. If they are not visibl
ls -al /dev/oracleasm/*
lrwxrwxrwx. 1 root root 7 Mar 6 17:41 /dev/oracleasm/asm-disk1 -> ../sdb1
lrwxrwxrwx. 1 root root 7 Mar 6 17:41 /dev/oracleasm/asm-disk2 -> ../sdc1
lrwxrwxrwx. 1 root root 7 Mar 6 17:41 /dev/oracleasm/asm-disk3 -> ../sdd1
The symbolic links are owned by root, but the devices they point to now have the correct ownership.
ls -al /dev/sd*1
s the expected fdisk output for the sdb disk.
Create the file if it doesn't already exist.
ng the following 4 entries. All parameters for a single entry must be on the same line.
ommand. If they are not visible, your UDEV configuration is incorrect and must be fixed before you proceed.
rect ownership.
OWNER="grid", GROUP="asmadmin", MODE="0660"
OWNER="grid", GROUP="asmadmin", MODE="0660"
OWNER="grid", GROUP="asmadmin", MODE="0660"
Disable Firewall
Add scan, rac1 ,rac2
Run on all nodes
cd /u02/grid/cv/rpm
rpm -Uvh cvuqdisk*
Pre check
/u02/grid/runcluvfy.sh stage -pre crsinst -n rac1,rac2 -verbose
Run on node 1
./gridSetup.sh
/u02/grid/gridSetup.sh
Click setup all node before click next
/dev/oracleasm/disks/
pass : oracle
/u01/grid/bin/asmca
alter system set asm_diskstring = '/u06/data1/' , '/u06/data2/' , '/u06/data3/' scope=both sid='*';
dd if=/dev/zero of=/u06/data2/data_disk1 bs=1k count=10000000
dd if=/dev/zero of=/u06/data2/data_disk2 bs=1k count=10000000
dd if=/dev/zero of=/u06/data3/data_disk3 bs=1k count=10000000
dd if=/dev/zero of=/u06/data4/data_disk3 bs=1k count=10000000
both sid='*';
run by oracle
Phân quyền oracle cho thư mục /u01
/u01/oracle/runInstaller
delete các thư mục con trong /u01 ở node 2
/u01/oracle/root.sh
/u01/oracle/bin/dbca
Cannot see ASM disk groups in DBCA from oracle
User oracle
/u01/app/oracle/product/11203/dbhome/bin
User grid
/u01/app/11203/bin
Cannot see ASM disk groups in Install Grid from grid
Main Node
/u01/apps/11.2.0/grid/oui/bin/runInstaller
./runInstaller -updateNodeList ORACLE_HOME=/u01/app/12.1.0/grid "CLUSTER_NODES={Db02BK}" CRS=TRUE -sile
HOSTNAMES={Db01BK-vip}"