Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 5

-- Kiem tra network may ben ngoai

Ethernet adapter VirtualBox Host-Only Network #3:


IPv4 Address. . . . . . . . . . . : 192.168.197.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Ethernet adapter VirtualBox Host-Only Network #4:
IPv4 Address. . . . . . . . . . . : 192.168.42.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
-- Nhu vay tao cac node RAC1 va RAC2 voi IP nhu sau:
adapter 1 briged adapter
adapter 1 host only adapter #3
adapter 1 host only adapter #4
+ Public:
rac1 192.168.197.131
rac2 192.168.197.132
+ Private
rac1 192.168.42.131
rac2 192.168.42.132
--shared disk
5 disk
-- install OS
[root@rac1 network-scripts]# yum install oracle-rdbms-server-12cR1-preinstall -y
-- Install DNS server
[root@rac1 network-scripts]# yum install dnsmasq
-- Stop firewall
[root@rac1 network-scripts]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[root@rac1 network-scripts]# chkconfig iptables off
-- selinux
--
[root@rac1 ~]# vi /etc/selinux/config
SELINUX=disabled
--
[root@rac1 network-scripts]# chkconfig dnsmasq on
Note: Forwarding request to 'systemctl enable dnsmasq.service'.
Created symlink from /etc/systemd/system/multi-user.target.wants/dnsmasq.service to
/usr/lib/systemd/system/dnsmasq.service.
--
[root@rac1 network-scripts]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain
192.168.197.131 rac1.oracle.com rac1
192.168.197.132 rac2.oracle.com rac2
192.168.197.133 rac3.oracle.com rac3
192.168.42.131 rac1-priv.oracle.com rac1-priv
192.168.42.132 rac2-priv.oracle.com rac2-priv
192.168.42.133 rac3-priv.oracle.com rac3-priv
192.168.197.31 rac1-vip.oracle.com rac1-vip
192.168.197.32 rac2-vip.oracle.com rac2-vip
192.168.197.33 rac3-vip.oracle.com rac3-vip
192.168.197.231 rac-scan.oracle.com rac-scan
192.168.197.232 rac-scan.oracle.com rac-scan
192.168.197.233 rac-scan.oracle.com rac-scan

--
[root@rac1 network-scripts]# vi /etc/resolv.conf
# Generated by NetworkManager
search oracle.com
nameserver 192.168.197.131
--
[root@rac1 network-scripts]# vi /etc/dnsmasq.conf
local=/oracle.com/
-- vi /etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT=no
--
root@rac1 Desktop]# service NetworkManager stop
Stopping NetworkManager daemon: [ OK ]
[root@rac1 Desktop]# chkconfig NetworkManager off
[root@rac1 Desktop]#
--
# service ntpd stop
Shutting down ntpd: [ OK ]
# chkconfig ntpd off
# mv /etc/ntp.conf /etc/ntp.conf.orig
# rm /var/run/ntpd.pid
--
mkdir -p /u01/app/12.1.0.2/grid
mkdir -p /u01/app/oracle/product/12.1.0.2/dbhome_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01/
--
[root@rac1 ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.

-- su - oracle
vi .bash_profile
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac1.oracle.com
export ORACLE_UNQNAME=orcl
export ORACLE_BASE=/u01/app/oracle
export GRID_HOME=/u01/app/12.1.0.2/grid
export DB_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=orcl1
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

-- Restart
[root@rac1 network-scripts]# service dnsmasq stop
Redirecting to /bin/systemctl stop dnsmasq.service
[root@rac1 network-scripts]# service dnsmasq start
Redirecting to /bin/systemctl start dnsmasq.service
[root@rac1 ~]# nslookup rac-scan
Server: 192.168.197.131
Address: 192.168.197.131#53

Name: rac-scan.oracle.com
Address: 192.168.197.233
Name: rac-scan.oracle.com
Address: 192.168.197.231
Name: rac-scan.oracle.com
Address: 192.168.197.232

--clone
C:\Users\Admin>cd C:\Program Files\Oracle\VirtualBox

C:\Program Files\Oracle\VirtualBox>VBoxManage clonehd D:\RAC_LAB\rac3\rac3.vdi D:\


RAC_LAB\rac4\rac3.vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone medium created in format 'VDI'. UUID: 8c6f58d3-c91e-48fa-9242-5959f2c39dc3
-- Doi ten node
/etc/sysconfig/network
-- Doi dia chi
-- Sua file .bash_profile
-- Sua lai MAC address cac card mang
[root@rac2 network-scripts]# ifconfig -a | grep eth
eth3 Link encap:Ethernet HWaddr 08:00:27:D3:E6:BA
eth4 Link encap:Ethernet HWaddr 08:00:27:B3:AC:D3
eth5 Link encap:Ethernet HWaddr 08:00:27:4B:EE:F0
-- Cap nhat cac file ifcfg-eth0, . . .
-- Xoa file /etc/udev/rules.d/70-persistent-net.rules
-- install asmlib
[root@rac1 ~]# cd /mnt
[root@rac1 mnt]# rpm -ivh oracleasmlib-2.0.4-1.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:oracleasmlib ########################################### [100%]
--
[root@rac1 mnt]# scp oracleasmlib-2.0.4-1.el6.x86_64.rpm root@rac2:/tmp
The authenticity of host 'rac2 (192.168.197.132)' can't be established.
RSA key fingerprint is 3c:a6:18:0d:c0:ba:48:51:c3:7b:33:66:b1:0d:00:91.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rac2,192.168.197.132' (RSA) to the list of known hosts.
root@rac2's password:
oracleasmlib-2.0.4-1.el6.x86_64.rpm 100% 13KB
13.0KB/s 00:00
[root@rac1 mnt]# ssh rac2
root@rac2's password:
Last login: Mon Sep 6 13:31:59 2021 from 192.168.197.1
[root@rac2 ~]# cd /tmp
[root@rac2 tmp]# rpm -ivh oracleasmlib-2.0.4-1.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:oracleasmlib ########################################### [100%]
--
[root@rac1 ~]# 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.

Device does not contain a recognized partition table


Building a new DOS disklabel with disk identifier 0x561e88f7.

Command (m for help): n


Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-25165823, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-25165823, default 25165823):
Using default value 25165823
Partition 1 of type Linux and of size 12 GiB is set

Command (m for help): w


The partition table has been altered!

Calling ioctl() to re-read partition table.


Syncing disks.
-- cau hinh asm lib tren ca 2 node rac1 va rac2
[root@rac1 mnt]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: oracle


Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
-- rac2
[root@rac2 ~]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: oracle


Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
--
[root@rac1 mnt]# /usr/sbin/oracleasm init
[root@rac1 mnt]# ssh rac2 /usr/sbin/oracleasm init
root@rac2's password:
--
[root@rac1 mnt]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
Marking disk "VOL1" as an ASM disk: [ OK ]
[root@rac1 mnt]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdc1
Marking disk "VOL2" as an ASM disk: [ OK ]
[root@rac1 mnt]# /etc/init.d/oracleasm createdisk VOL3 /dev/sdd1
Marking disk "VOL3" as an ASM disk: [ OK ]
[root@rac1 mnt]# /etc/init.d/oracleasm createdisk VOL4 /dev/sde1
Marking disk "VOL4" as an ASM disk: [ OK ]
[root@rac1 mnt]# /etc/init.d/oracleasm createdisk VOL5 /dev/sdf1
Marking disk "VOL5" as an ASM disk: [ OK ]
--
[root@rac1 mnt]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@rac1 mnt]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
VOL5
-- Kiem tra RAC2
[root@rac1 mnt]# ssh rac2
root@rac2's password:
Last login: Mon Sep 6 14:34:12 2021 from rac1.oracle.com
[root@rac2 ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@rac2 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
VOL5
--
[root@rac1 mnt]# cd /home/oracle/grid/
[root@rac1 grid]# ls
install response rpm runcluvfy.sh runInstaller sshsetup stage welcome.html
[root@rac1 grid]# cd rpm/
[root@rac1 rpm]# ls
cvuqdisk-1.0.9-1.rpm
[root@rac1 rpm]# rpm -ivh cvuqdisk-1.0.9-1.rpm
Preparing... ########################################### [100%]
Using default group oinstall to install package
1:cvuqdisk ########################################### [100%]
[root@rac1 rpm]# scp cvuqdisk-1.0.9-1.rpm root@rac2:/tmp
root@rac2's password:
cvuqdisk-1.0.9-1.rpm 100% 8976
8.8KB/s 00:00
[root@rac1 rpm]# ssh rac2
root@rac2's password:
Last login: Mon Sep 6 15:38:57 2021 from rac2.oracle.com
[root@rac2 ~]# cd /tmp
[root@rac2 tmp]# rpm -ivh cvuqdisk-1.0.9-1.rpm
Preparing... ########################################### [100%]
package cvuqdisk-1.0.9-1.x86_64 is already installed

Cause - Either proper permissions were not granted to create the directory or there
was no space left in the volume. Action - Check your permission on the selected
directory or choose another directory.

chown -R oracle:oinstall /u01/app/oracle


[root@rac2 ~]# chmod -R 775 /u01/app/oracle

You might also like