gavinsoorma.com  · Web viewCreate the Linux VM’s for the Oracle 12c RAC Workshop. on...

116
1 Create the Linux VM’s for the Oracle 12c RAC Workshop on VirtualBox Notes on how to create an Oracle Linux 6.8 VM on VirtualBox for the Oracle RAC 12c Workshop

Transcript of gavinsoorma.com  · Web viewCreate the Linux VM’s for the Oracle 12c RAC Workshop. on...

1

Notes on how to create an Oracle Linux 6.8 VM on VirtualBox for the

Oracle RAC 12c Workshop

Create the Linux VM’s for the Oracle 12c RAC Workshop

2

Download and install VirtualBox https://www.virtualbox.org/wiki/Downloads

Create the Linux VM’s for the Oracle 12c RAC Workshop

3

Download the Linux 6 Update 8 software from the Oracle Software Delivery Cloud

https://edelivery.oracle.com

Create the Linux VM’s for the Oracle 12c RAC Workshop

4Create the Linux VM’s for the Oracle 12c RAC Workshop

5Create the Linux VM’s for the Oracle 12c RAC Workshop

6Create the Linux VM’s for the Oracle 12c RAC Workshop

7Create the Linux VM’s for the Oracle 12c RAC Workshop

8Create the Linux VM’s for the Oracle 12c RAC Workshop

9

Launch Oracle VirtualBox and create the VM rac01

The machine will be created with a 40 GB root partition and 4.3 GB memory allocation.

Create the Linux VM’s for the Oracle 12c RAC Workshop

10Create the Linux VM’s for the Oracle 12c RAC Workshop

11

Note: this assumes available machine memory to be 16 GB.

If 8 GB RAM is only available, set the VM memory size to 2500 MB.

Create the Linux VM’s for the Oracle 12c RAC Workshop

12Create the Linux VM’s for the Oracle 12c RAC Workshop

13Create the Linux VM’s for the Oracle 12c RAC Workshop

14Create the Linux VM’s for the Oracle 12c RAC Workshop

15Create the Linux VM’s for the Oracle 12c RAC Workshop

16Create the Linux VM’s for the Oracle 12c RAC Workshop

17

Check subnet for Host-Only adapter is 192.168.56

Create the Linux VM’s for the Oracle 12c RAC Workshop

18Create the Linux VM’s for the Oracle 12c RAC Workshop

19

Mount the Linux installation software using the .iso file we downloaded earlier

Create the Linux VM’s for the Oracle 12c RAC Workshop

20Create the Linux VM’s for the Oracle 12c RAC Workshop

21

Configure Network Adapters

We will use 3 network adapters for the VM network:

1) One to communicate with the host directly from client (like putty) 2) One for host to host internal communication (RAC Interconnect)3) One for external internet connectivity (to download RPMs via yum)

Create the Linux VM’s for the Oracle 12c RAC Workshop

22Create the Linux VM’s for the Oracle 12c RAC Workshop

23

Note – on some machines to get internet connectivity from VM we need to use NAT instead of Bridged Adapter.

Create the Linux VM’s for the Oracle 12c RAC Workshop

24

Configure shared folders

The shared folder will enable us to copy any downloaded files like software between our local machine and the VM. In this case I have shared the drive and directory C:\software. Files in this directory will be visible in the Linux VM in the /media/sf_software location. The share name is ‘software’.

Ensure it is set to Auto-mount.

Create the Linux VM’s for the Oracle 12c RAC Workshop

25Create the Linux VM’s for the Oracle 12c RAC Workshop

26

Install the Linux 6 Update 8 Operating System

Note – use the Right Ctrl key to navigate out of the VM installation screen if required.

Create the Linux VM’s for the Oracle 12c RAC Workshop

27Create the Linux VM’s for the Oracle 12c RAC Workshop

28Create the Linux VM’s for the Oracle 12c RAC Workshop

29Create the Linux VM’s for the Oracle 12c RAC Workshop

30Create the Linux VM’s for the Oracle 12c RAC Workshop

31Create the Linux VM’s for the Oracle 12c RAC Workshop

32Create the Linux VM’s for the Oracle 12c RAC Workshop

33

Click on Yes, discard any data

Create the Linux VM’s for the Oracle 12c RAC Workshop

34

Networks

Enter hostname rac01.localdomain and click on Configure Network

Create the Linux VM’s for the Oracle 12c RAC Workshop

35Create the Linux VM’s for the Oracle 12c RAC Workshop

36

Highlight System eth0 entry and click on Edit…

Create the Linux VM’s for the Oracle 12c RAC Workshop

37

Ensure to check the box Connect automatically and clink on the IPV4 Settings tab.

Create the Linux VM’s for the Oracle 12c RAC Workshop

38

Change the Method to Manual from Automatic (DHCP) and click on Add

Enter the IP address for the rac01 VM public network – 192.168.56.100.

Enter Netmask and Gateway as shown and click Apply…

Create the Linux VM’s for the Oracle 12c RAC Workshop

39

Highlight System eth1 entry and click on Edit…

Create the Linux VM’s for the Oracle 12c RAC Workshop

40

Change the Method to Manual from Automatic (DHCP) and click on Add

Enter the IP address for the rac01 VM private network – 192.168.10.100.

Enter Netmask and Gateway as shown and click Apply…

Create the Linux VM’s for the Oracle 12c RAC Workshop

41Create the Linux VM’s for the Oracle 12c RAC Workshop

42

Ensure to check the box Connect automatically

Create the Linux VM’s for the Oracle 12c RAC Workshop

43

Region and Time Zone Setting

Create the Linux VM’s for the Oracle 12c RAC Workshop

44

Root Password (keep a note!)

Create the Linux VM’s for the Oracle 12c RAC Workshop

45Create the Linux VM’s for the Oracle 12c RAC Workshop

46Create the Linux VM’s for the Oracle 12c RAC Workshop

47

Click Format

Create the Linux VM’s for the Oracle 12c RAC Workshop

48

Click Write changes to disk

Create the Linux VM’s for the Oracle 12c RAC Workshop

49Create the Linux VM’s for the Oracle 12c RAC Workshop

50

Click on Customize now

Create the Linux VM’s for the Oracle 12c RAC Workshop

51

Select all the options in the Desktops group

Create the Linux VM’s for the Oracle 12c RAC Workshop

52

Select option Internet Browser

Create the Linux VM’s for the Oracle 12c RAC Workshop

53

Select option Development tools

Create the Linux VM’s for the Oracle 12c RAC Workshop

54Create the Linux VM’s for the Oracle 12c RAC Workshop

55

Click Reboot

Create the Linux VM’s for the Oracle 12c RAC Workshop

56Create the Linux VM’s for the Oracle 12c RAC Workshop

57Create the Linux VM’s for the Oracle 12c RAC Workshop

58Create the Linux VM’s for the Oracle 12c RAC Workshop

59

Click No thanks, I’ll connect later.

Create the Linux VM’s for the Oracle 12c RAC Workshop

60Create the Linux VM’s for the Oracle 12c RAC Workshop

61Create the Linux VM’s for the Oracle 12c RAC Workshop

62Create the Linux VM’s for the Oracle 12c RAC Workshop

63Create the Linux VM’s for the Oracle 12c RAC Workshop

64Create the Linux VM’s for the Oracle 12c RAC Workshop

65Create the Linux VM’s for the Oracle 12c RAC Workshop

66

Install VirtualBox Guest Additions

Create the Linux VM’s for the Oracle 12c RAC Workshop

67Create the Linux VM’s for the Oracle 12c RAC Workshop

68Create the Linux VM’s for the Oracle 12c RAC Workshop

69Create the Linux VM’s for the Oracle 12c RAC Workshop

70

Run as root

# yum update

Create the Linux VM’s for the Oracle 12c RAC Workshop

71Create the Linux VM’s for the Oracle 12c RAC Workshop

72

Click OK

Create the Linux VM’s for the Oracle 12c RAC Workshop

73Create the Linux VM’s for the Oracle 12c RAC Workshop

74Create the Linux VM’s for the Oracle 12c RAC Workshop

75

Enable sharing of Clipboard and Drag and Drop

Create the Linux VM’s for the Oracle 12c RAC Workshop

76Create the Linux VM’s for the Oracle 12c RAC Workshop

77Create the Linux VM’s for the Oracle 12c RAC Workshop

78

Configure the rac01 VM for Oracle Grid Infrastructure 12c Installation

Create the Linux VM’s for the Oracle 12c RAC Workshop

79

Ensure internet connectivity

Install the oracle-rdbms-server-12cR2-preinstall RPM

[root@rac01 ~]# yum install oracle-database-server-12cR2-preinstall -yLoaded plugins: refresh-packagekit, security, ulninfoSetting up Install ProcessResolving Dependencies--> Running transaction check---> Package oracle-database-server-12cR2-preinstall.x86_64 0:1.0-3.el6 will be installed

Create the Linux VM’s for the Oracle 12c RAC Workshop

80

……

Installed: oracle-database-server-12cR2-preinstall.x86_64 0:1.0-3.el6

Dependency Installed: compat-libcap1.x86_64 0:1.10-1 compat-libstdc++-33.x86_64 0:3.2.3-69.el6 ksh.x86_64 0:20120801-37.el6_9 libaio-devel.x86_64 0:0.3.107-10.el6

Complete

Install the oracleasm-support RPM

# [root@rac01 ~]# yum install oracleasm-supportLoaded plugins: refresh-packagekit, security, ulninfoSetting up Install ProcessResolving Dependencies--> Running transaction check---> Package oracleasm-support.x86_64 0:2.1.10-4.el6 will be installed--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================== Package Arch Version Repository Size==============================================================================================================================================================Installing:

Create the Linux VM’s for the Oracle 12c RAC Workshop

81

oracleasm-support x86_64 2.1.10-4.el6 public_ol6_latest 76 k

Transaction Summary==============================================================================================================================================================Install 1 Package(s)

Total download size: 76 kInstalled size: 225 kIs this ok [y/N]: yDownloading Packages:oracleasm-support-2.1.10-4.el6.x86_64.rpm | 76 kB 00:00 Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction Installing : oracleasm-support-2.1.10-4.el6.x86_64 1/1 Verifying : oracleasm-support-2.1.10-4.el6.x86_64 1/1

Installed: oracleasm-support.x86_64 0:2.1.10-4.el6

Complete!

Create the Linux VM’s for the Oracle 12c RAC Workshop

82

Download and install the oracleasmlib RPM.

http://www.oracle.com/technetwork/server-storage/linux/asmlib/ol6-1709075.html

Create the Linux VM’s for the Oracle 12c RAC Workshop

83

[root@rac01 ~]# cd /media/sf_software/

[root@rac01 sf_software]# ls *asm*oracleasmlib-2.0.12-1.el6.x86_64.rpm

[root@rac01 sf_software]# rpm -ivh oracleasmlib-2.0.12-1.el6.x86_64.rpm Preparing... ########################################### [100%] 1:oracleasmlib ########################################### [100%][root@rac01 sf_software]#

Create the grid user

[root@rac01 sf_software]# /usr/sbin/groupadd -g 54331 asmadmin

[root@rac01 sf_software]# /usr/sbin/groupadd -g 54332 asmdba

[root@rac01 sf_software]# /usr/sbin/groupadd -g 54333 asmoper

[root@rac01 sf_software]# /usr/sbin/useradd -g oinstall -G asmdba,dba,asmadmin,asmdba,asmoper,vboxsf grid

Configure ASMlib

[root@rac01 sf_software]# /usr/sbin/oracleasm configure -i

Create the Linux VM’s for the Oracle 12c RAC Workshop

84

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 []: grid

Default group to own the driver interface []: asmadmin

Start Oracle ASM library driver on boot (y/n) [n]: y

Scan for Oracle ASM disks on boot (y/n) [y]:

Writing Oracle ASM library driver configuration: done

[root@rac01 sbin]# /usr/sbin/oracleasm initCreating /dev/oracleasm mount point: /dev/oracleasmLoading module "oracleasm": oracleasmConfiguring "oracleasm" to use device physical block sizeMounting ASMlib driver filesystem: /dev/oracleasm

Create the Linux VM’s for the Oracle 12c RAC Workshop

85

[root@rac01 sbin]# /usr/sbin/oracleasm statusChecking if ASM is loaded: yesChecking if /dev/oracleasm is mounted: yes

Create the directory for the 12c Grid Infrastructure installation

[root@rac01 sf_software]# cd /

[root@rac01 /]# mkdir u01

[root@rac01 /]# cd u01

[root@rac01 u01]# mkdir app

[root@rac01 u01]# chown grid:oinstall app

Configure the oracle and grid OS user accounts

[root@rac01 u01]# /usr/sbin/usermod -g oinstall -G dba,asmadmin,asmdba,vboxsf oracle

[root@rac01 u01]# passwd oracle

Changing password for user oracle.

New password:

Create the Linux VM’s for the Oracle 12c RAC Workshop

86

BAD PASSWORD: it is based on a dictionary word

BAD PASSWORD: is too simple

Retype new password:

passwd: all authentication tokens updated successfully.

[root@rac01 u01]# passwd grid

Changing password for user grid.

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.

Configure /etc/hosts file

[root@rac01 u01]# vi /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4192.168.56.100 rac01.localdomain rac01192.168.56.101 rac02.localdomain rac02

Create the Linux VM’s for the Oracle 12c RAC Workshop

87

Check the network IPs are correct via ifconfig

Note that the IP entry for eth2 will differ as this is the IP of your internet provider.

[root@rac01 u01]# ifconfigeth0 Link encap:Ethernet HWaddr 08:00:27:ED:5A:42 inet addr:192.168.56.100 Bcast:192.168.56.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:feed:5a42/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:32 errors:0 dropped:0 overruns:0 frame:0 TX packets:13 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2880 (2.8 KiB) TX bytes:1008 (1008.0 b)

eth1 Link encap:Ethernet HWaddr 08:00:27:1D:A8:8B inet addr:192.168.10.100 Bcast:192.168.10.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe1d:a88b/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:18 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:1308 (1.2 KiB)

eth2 Link encap:Ethernet HWaddr 08:00:27:EF:D8:C1 inet addr:10.1.1.24 Bcast:10.1.1.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:feef:d8c1/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2199 errors:0 dropped:0 overruns:0 frame:0 TX packets:68 errors:0 dropped:0 overruns:0 carrier:0

Create the Linux VM’s for the Oracle 12c RAC Workshop

88

collisions:0 txqueuelen:1000 RX bytes:368359 (359.7 KiB) TX bytes:11124 (10.8 KiB)

lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:12 errors:0 dropped:0 overruns:0 frame:0 TX packets:12 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:720 (720.0 b) TX bytes:720 (720.0 b)

Set Security Enhanced Linux (SELINUX) to disabled as we are not enabling any firewall traffic

[root@rac01 u01]# vi /etc/selinux/config

SELINUX=disabled

Stop NTP daemon(if they are running) as we will be using Cluster Time Synchronization Service instead

[root@rac01 u01]# service ntpd stopShutting down ntpd: [FAILED]

[root@rac01 u01]# chkconfig ntpd off

Create the Linux VM’s for the Oracle 12c RAC Workshop

89

[root@rac01 u01]# mv /etc/ntp.conf /etc/ntp.conf.orig

[root@rac01 u01]# rm /var/run/ntpd.pidrm: cannot remove `/var/run/ntpd.pid': No such file or directory

Disable Firewall

[root@rac01 ~]# service iptables stopiptables: Setting chains to policy ACCEPT: filter [ OK ]iptables: Flushing firewall rules: [ OK ]iptables: Unloading modules: [ OK ]

[root@rac01 ~]# chkconfig iptables off

Edit /etc/resolv.conf

[root@rac01 rpm]# cat /etc/resolv.conf # Generated by NetworkManagersearch localdomainnameserver 10.1.1.1

Change to

[root@rac01 rpm]# vi /etc/resolv.conf # Generated by NetworkManageroptions timeout:3 search localdomain rac.localdomainnameserver 192.168.56.102

Create the Linux VM’s for the Oracle 12c RAC Workshop

90

[root@rac01 rpm]# chattr +i /etc/resolv.conf

[root@rac01 app]# nslookup rac01Server: 192.168.56.102Address: 192.168.56.102#53

Name: rac01.localdomainAddress: 192.168.56.100

[root@rac01 app]# nslookup rac-gnsServer: 192.168.56.102Address: 192.168.56.102#53

Name: rac-gns.localdomainAddress: 192.168.56.150

Configure limits.conf file

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

oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536grid soft nproc 2047grid hard nproc 16384grid soft nofile 1024grid hard nofile 65536grid soft stack 10240

Create the Linux VM’s for the Oracle 12c RAC Workshop

91

oracle soft stack 10240

Shutdown the VM

[root@rac01 rpm]# shutdown -h now

Create a backup .ova file

Create the Linux VM’s for the Oracle 12c RAC Workshop

92Create the Linux VM’s for the Oracle 12c RAC Workshop

93Create the Linux VM’s for the Oracle 12c RAC Workshop

94

Click on Export

Create the Linux VM’s for the Oracle 12c RAC Workshop

95Create the Linux VM’s for the Oracle 12c RAC Workshop

96

Clone the rac01 VM and create the second VM rac02

Create the Linux VM’s for the Oracle 12c RAC Workshop

97

Ensure we do not check the box to Reinitialize the MAC address!

Create the Linux VM’s for the Oracle 12c RAC Workshop

98Create the Linux VM’s for the Oracle 12c RAC Workshop

99Create the Linux VM’s for the Oracle 12c RAC Workshop

100Create the Linux VM’s for the Oracle 12c RAC Workshop

101Create the Linux VM’s for the Oracle 12c RAC Workshop

102

Change the hostname

[root@rac01 ~]# vi /etc/sysconfig/networkNETWORKING=yesHOSTNAME=rac02.localdomain

Create the Linux VM’s for the Oracle 12c RAC Workshop

103

# oracle-rdbms-server-12cR1-preinstall : Add NOZEROCONF=yesNOZEROCONF=yes

[root@rac01 ~]# hostname rac02.localdomain

Edit and Update the Network IP addresses on the cloned VM

System > Preferences > Network Connections menu

Create the Linux VM’s for the Oracle 12c RAC Workshop

104Create the Linux VM’s for the Oracle 12c RAC Workshop

105

Original MAC address

Create the Linux VM’s for the Oracle 12c RAC Workshop

106

Change the original MAC address by replacing last two characters with ‘00’. Click Apply…

Create the Linux VM’s for the Oracle 12c RAC Workshop

107

Change the public IP address from 192.168.56.100 to 192.168.56.101.

Create the Linux VM’s for the Oracle 12c RAC Workshop

108

Similarly change the MAC address for eth1 and eth2 and also the private IP address for eth1 as shown.

Create the Linux VM’s for the Oracle 12c RAC Workshop

109Create the Linux VM’s for the Oracle 12c RAC Workshop

110Create the Linux VM’s for the Oracle 12c RAC Workshop

111

Rename 70-persistent-net.rules file as it will be regenerated on next VM start

[root@rac01 ~]# cd /etc/udev/rules.d

[oracle@rac01 rules.d]$ mv 70-persistent-net.rules 70-persistent-net.rules.old

Shutdown the cloned VM

[root@rac01 rules.d]# shutdown -h now

Create the Linux VM’s for the Oracle 12c RAC Workshop

112

Disable the 3rd network adapter as we will not need external internet connectivity from the cloned rac02 VM

Create the Linux VM’s for the Oracle 12c RAC Workshop

113

For Adapter 1 and Adapter 2 update the MAC address replacing the last two characters with ‘00’

Create the Linux VM’s for the Oracle 12c RAC Workshop

114Create the Linux VM’s for the Oracle 12c RAC Workshop

115

Disable the Adapter 3 for rac01 VM as well as we do not need any internet connectivity anymore

Create the Linux VM’s for the Oracle 12c RAC Workshop

116

Start both rac01 and rac02 VMs

Connect as root and check connectivity between both rac01 and rac02 for both the public as well as private networks

Create the Linux VM’s for the Oracle 12c RAC Workshop

117

Connect to rac02 and carry out the same ‘ping’ check to confirm connectivity with rac01.

Also confirm the network IPs on rac02.

Create the Linux VM’s for the Oracle 12c RAC Workshop

118Create the Linux VM’s for the Oracle 12c RAC Workshop