Sunday, November 18, 2012

Shared NFS mount point for Real application testing (RAT) on RAC

Hi All,

I was trying to test the DB replay process from my 2 node RAC (11gR2) test machine set up on Oracle virtualbox environment . I faced the issue that I don't have a shared mount point to store the capture files.Following points are to be noted.

1) You can't use ASM for storing the DB capture files.ASM was the only shared directory I had at that point.
2) If you run capture from one instance it will capture the workload of all the instances.

So the shared file system has to be on ext3 file system shared by both the instances.Fo this I did following.


Create the disk and associate it with VirtualBox machines rac1 and rac2.
$ VBoxManage createhd --filename nfs.vdi --size 5120 --format VDI --variant Fixed

# Connect it to the rac1 vm.
$ VBoxManage storageattach rac1 --storagectl "SATA Controller" --port 7 --device 0 --type hdd --medium nfs.vdi --mtype shareable

$ # Make shareable.
$ VBoxManage modifyhd nfs.vdi --type shareable


# Connect it to the rac2 vm.
VBoxManage storageattach rac2 --storagectl "SATA Controller" --port 7 --device 0 --type hdd --medium nfs.vdi --mtype shareable

You will see the new disk as /dev/sd* on rac1>i had formatted it wih ext3 format on rac1

1)Format the /dev/sdg using the ext3 format on rac1 .So you will get the /dev/sdg1

2)service nfs start on both the nodes

3)Create a directory to mount the newly created disk.For me it is /nfs on both the nodes.Add following line to the /etc/fstab on node 1

/dev/sdg1               /nfs                    ext3    defaults        1 1

 for the first time mount -t nfs  /dev/sdg1               /nfs 

4)Now you need to mount the disk from node 2 as well .for that  do the following.

mount 192.168.56.101:/nfs /nfs -o rsize=8192,wsize=8192

where 192.168.56.101 is the ip address of rac1 machine accessible from rac2.


Now if you create a directory with ownership oracle:oinstall in /nfs it should be visible from bot the nodes


[root@rac2 RAT]# cd /nfs
[root@rac2 nfs]# ls -lrt
total 20
drwx------ 2 root   root     16384 Nov 16 23:00 lost+found
-rw-r--r-- 1 root   root         0 Nov 17 03:19 1
drwxr-xr-x 4 oracle oinstall  4096 Nov 19 06:54 RAT


Now you can create a database directory on the shared nfs filesystem and  you are good to run the capture process .


DBMS_WORKLOAD_CAPTURE.START_CAPTURE (name => 'capture01',dir => 'RAT')





No comments: