Thursday, May 22, 2014

Steps for sharing the NFS drive to other linux systems for RMAN backups


        1. On the system where we are going to share, create a directory.
My source system is 10.10.1.20

Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p3      29G  3.5G   24G  13% /
/dev/cciss/c0d0p7     167G   86G   73G  54% /home
/dev/cciss/c0d0p6     9.5G  4.4G  4.7G  49% /var
/dev/cciss/c0d0p5      19G  173M   18G   1% /tmp
/dev/cciss/c0d0p1      99M   14M   80M  15% /boot
tmpfs                  16G     0   16G   0% /dev/shm
/dev/sda1             551G  257G  266G  50% /data1


      2. I am going to create a directory on /data1 and want this to be shared by the database server for RMAN backups.
[root@test data1]# pwd
/data1

[root@test data1]# mkdir icbrman_bkup

 [root@test data1]# ls -ltrh
total 104K
drwxrwxr-x 2 test test  16K Sep 28  2012 lost+found
drwxr-xr-x 2 test test 4.0K Nov 27 17:49 exp_bkp
-rw-r----- 1 test test  34M Nov 27 20:11 test_cf.ctl
-rw-r----- 1 test test  34M Nov 27 20:17 test1_cf.ctl
drwxrwxr-x 2 test test 4.0K May  9 02:53 ablrman_bkup
drwxrwxr-x 2 test test  20K May  9 10:04 rman_bkup
drwxr-xr-x 2 test   test   4.0K May  9 10:05 testrman_bkup

3.       Now the directory is created, now add the directory in /etc/exports file as “root” user.
/data1 <target_ip_address> (rw,async,no_root_squash)

/data1 10.10.1.10 (rw,async,no_root_squash)






4.       Now restart the NFS service on the source server.
Service nfs stop
Service nfs start

[root@test data1]# service nfs stop
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]


[root@test data1]# service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
[root@test data1]#


5.       Check with “exportfs” command to confirm the target server is updated.
[root@test data1]# exportfs
/data1          10.10.1.11
/data1          10.10.1.21
/data1          10.10.1.31
/data1          10.10.1.20
[root@test data1]#

6.       On the target as root user, create a directory on root directory.
Source 10.10.1.10
[root@primary ~]# mkdir testbackup
dr-xr-xr-x 295 root   root        0 Nov 11 02:59 proc
drwxr-xr-x  11 root   root        0 Nov 11 02:59 sys
drwxr-xr-x   4 root   root        0 Nov 11 02:59 selinux
drwxr-xr-x   2 root   root        0 Nov 11 03:37 misc
drwxr-xr-x   2 root   root        0 Nov 11 03:37 net
drwxr-xr-x   2 root   root     4.0K Nov 11 03:43 media
drwxr-xr-x  13 root   root     4.9K Nov 11 03:43 dev
drwxr-xr-x   7 root root 4.0K Nov 23 08:40 data7
drwxr-xr-x   2 root root 4.0K May  9 10:09 testbackup

7.       Now mount the directory with below options.
[root@primary /]#  mount -o rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600 10.10.1.20:/data1/testrman_bkup /testbackup

8.       Change the permission for the testbackup directory to oracle:oinstall.
Chown –R oracle:oinstall /testbackup
Chmod 775 –R /testbackup

9.       Now, check the filesystems mounted.

Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p3      29G  7.8G   20G  29% /
/dev/cciss/c0d0p7     167G   67G   92G  43% /home
/dev/cciss/c0d0p6     9.5G  686M  8.4G   8% /var
/dev/cciss/c0d0p5      19G  173M   18G   1% /tmp
/dev/cciss/c0d0p1      99M   15M   79M  16% /boot
tmpfs                  16G     0   16G   0% /dev/shm
/dev/mapper/mpath0p1  367G  256G   93G  74% /data1
/dev/mapper/mpath1p1  138G   40G   91G  31% /data2
/dev/mapper/mpath2p1  138G  116G   15G  89% /data3
/dev/mapper/mpath3p1  138G   83G   49G  63% /data6
/dev/mapper/mpath4p1  138G   66G   66G  51% /data7
/dev/mapper/mpath5p1  184G   79G   96G  46% /data4
/dev/mapper/mpath6p1  617G  513G   72G  88% /data5
10.10.1.20:/data1/testrman_bkup
                      551G  257G  266G  50% /testbackup

10.   Now, we can give the paths for backup in our rman scripts when allocating channels.
allocate channel ch2  type disk  FORMAT='/testbackup/rman_bkup/LVL0_%D_%M_%U';




No comments:

Post a Comment