In this article , I have described each and every step required for setting up a 2 node rac 12c database using virtual box for testing purpose.

Softwares Required:

1. Virtual box :

2. Linux 

3. Oracle 12c home:

4. Oracle 12c Grid:

Virtual Machine setup:

Here we have to setup 2 nodes inside virtual box. So reduce our work, we will build one node and then clone the same to other node.

1. Open virtual box

1

2

3

4

5

6

7

8

 

 

9

 

3. Choose the linux iso file for installation:

10

11

12

 

4.Start the linux installation:

13

14

15

16

17

18

19

20

21

22

23

24

25

26

28

29

30

31

32

33

34

35

 

 

After selecting Server administrative tools, click on OPTIONAL PACKAGES.  Make sure you select oracle rdbms and oracleasm packages.

 

36 37

38

39

40

41

42

 

Now your linux installation is done .

5. Install guest addition 

Guest addition  helps in keyboard and mouse integration.

 

43

44

 

 

45

46

 

6. Configure oracleasm lib.

47

 

7.Go to settings and change both to bidirectional.

48

8.Now create user groups and set password for oracle user:

9.Now disable the firewall:

Go to SYSTEM – > ADMINISTRATION -> FIREWALL

 

49

50

 

10.Disable selinux mode to disable from enabled in config file.

11.Stop ntpd services:

 

 

Now we have to make the grid and oracle home software shareable with the virtual box. Shutdown the node1.

51

52

53

 

Once done start the node1 and login with oracle user.

 

[oracle@riyadh1 ~]$ su – root
Password:
[root@riyadh1 ~]# cd /media/sf_oracle_sw/
[root@riyadh1 sf_oracle_sw]# pwd
/media/sf_oracle_sw
[root@riyadh1 sf_oracle_sw]# ls -ltr
total 8
drwxrwx— 1 root vboxsf 4096 Jul 7 2014 grid
drwxrwx— 1 root vboxsf 4096 Mar 1 10:14 database
[root@riyadh1 sf_oracle_sw]#

 

Install cvfudisk:

Without cvuqdisk, Cluster Verification Utility is unable to discover shared disks, and you receive the error message “Package cvuqdisk not installed” when you run Cluster Verification Utility. Use the cvuqdisk rpm for your hardware (for example, x86_64, or i386).

 

Clone the existing node:

Now we will clone the existing node. i.e we will create node2 ( riyadh2 from riyadh1)

Shutdown the VM.

Go to MACHINE – > CLONE

 

54

55

56

 

Now for riyadh2 (node 2) , we have to change the MAC address . Because MAC address is unique for each machine.

Just change the MAC address, by changing the last character of the address.

if it is 080027B7A349 . Then change it to 080027B7A34A. Do the same for both network adapters.

57

58

 

 

Now start both the nodes.

In node2 : change the hostname to riyadh2 in the network file.

 

[root@riyadh1 sysconfig]# vi /etc/sysconfig/network

change riyadh1 to riyadh2

In VM2(riyadh2) go to SYSTEM – PREFERNCE – NETWORK CONNECTION. You will see something like this.

 

59

 

Remove Auto eth2 and Auto eth3.

60

 

Now edit the mac adress to (080027B7A34A) which we set in the previous setup

 

61

 

 

Set the new ips for node 2:

62

 

Do the same change ( mac address change and ip address change ) for other adapter ( eth1) also.

Lets change the ethernet port names.

The existing file will look like this.

Remove the entries for eth0 and eth1  and rename eth2 to eth0 and eth3 to eth1.

Now the file should look like below.

Reboot the VM2 to reflect the changes.

To confirm whether changes are done or not , we can run ifconfig.

 

 

Add public, private,vip,scan host entries in /etc/hosts file of both node1 and node2.

So hosts file should look like below.

 

 

Now we will create a shared disk , which will be shared between both node1 and node2.

63

64

65

66

67

68

69

 

Now go to FILE – > VIRTUAL MEDIA MANAGER

70

71

 

Now add the shared disk to node 2 also.

 

72 73

74

 

Now we will partition the shared storage to create asmdisks.

Start both the nodes and login to any of the  nodes as root user.

 

Now we can see the asm disk is visible to both the nodes.

Lets configure the ssh connectivity between both the nodes.

 click on this link for ssh connectivity establishment.

 

Lets proceed with GRID INSTALLATION:

Login to node 1 as oracle user

[oracle@riyadh1 ~]$ cd /media/sf_oracle_sw/grid/

[oracle@riyadh1 grid]$ ./runInstaller

Starting Oracle Universal Installer…

Checking Temp space: must be greater than 415 MB.   Actual 24517 MB    Passed

Checking swap space: must be greater than 150 MB.   Actual 8999 MB    Passed

Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-03-18_02-42-21PM. Please wait …

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

 

With this now our grid installation is done.   Lets proceed with oracle binary installation.

Oracle rdbms installation:

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

 

Now create a database.

Database creation

cd $ORACLE_HOME/bin

./dbca

122

123

124

125

127

128

129

130

131

132

133

134

135

136

137

 

Now your oracle database with 2 node RAC is ready.