Saturday, October 19, 2013

Normal & High Redundancy in ASM


Usage of ASM Normal or High Redundancy.
--------------------------------------

1. Back up the database.


2. Current Size of diskgroups.


SQL> select name, total_mb, usable_file_mb from V$asm_Diskgroup;

NAME                             TOTAL_MB USABLE_FILE_MB
------------------------------ ---------- --------------
ACFDG                                9759            581
DATA                                 3871           1977
FRA                                  1918           1816
OCR_VOTING                           2868            436

 
SQL> select tablespace_name, file_name, bytes/1024/1024 "M" from dba_data_files order by 1;

TABLESPACE_NAME                FILE_NAME                                                   M
------------------------------ -------------------------------------------------- ----------
GOLDEN_GATE                    +DATA/layatest/datafile/golden_gate01.dbf                  50
MANZOOR                        +DATA/layatest/datafile/manzoor01.dbf                      50
SYSAUX                         +DATA/layatest/datafile/sysaux.257.810788857              600
SYSTEM                         +DATA/layatest/datafile/system.256.810788853              710
UNDOTBSONE                     +DATA/layatest/datafile/undotbsone.dbf                     50
UNDOTBSTWO                     +DATA/layatest/datafile/undotbstwo.dbf                     50
USERS                          +DATA/layatest/datafile/users.259.810788857                 5

7 rows selected.

SQL> select file_name, bytes/1024/1024 "M" from dba_temp_files;

FILE_NAME                                                   M
-------------------------------------------------- ----------
+DATA/layatest/tempfile/temp.263.810789031                 38


From ASM instance:-


SQL> select name, total_mb, usable_file_mb , state, type from V$asm_diskgroup;

NAME                             TOTAL_MB USABLE_FILE_MB STATE       TYPE
------------------------------ ---------- -------------- ----------- ------
ACFDG                                9759            581 MOUNTED     EXTERN
DATA                                 3871           1977 CONNECTED   EXTERN
FRA                                  1918           1816 CONNECTED   EXTERN
OCR_VOTING                           2868            436 MOUNTED     NORMAL


NAME                           FAILGROUP                      PATH                                       TOTAL_MB HEADER_STATU REDUNDA
------------------------------ ------------------------------ ---------------------------------------- ---------- ------------ -------
ACFSDISK                       ACFSDISK                       /dev/oracleasm/disks/ACFSDISK                  9759 MEMBER       UNKNOWN
FRA                            FRA                            /dev/oracleasm/disks/FRA                       1918 MEMBER       UNKNOWN
DATA                           DATA                           /dev/oracleasm/disks/DATA                      3871 MEMBER       UNKNOWN
OCR_VOTING_0002                OCR_VOTING_0002                /dev/oracleasm/disks/OCR_VOT_DISK_3             956 MEMBER       UNKNOWN
OCR_VOTING_0001                OCR_VOTING_0001                /dev/oracleasm/disks/OCR_VOT_DISK_2             956 MEMBER       UNKNOWN
OCR_VOTING_0000                OCR_VOTING_0000                /dev/oracleasm/disks/OCR_VOT_DISK_1             956 MEMBER       UNKNOWN




objective:-
---------

The database is using the diskgroup which is external redundancy, now we are going to conver that to normal redundany.


Stop the database.

[oracle@rhel11gr2rac1 software]$ srvctl stop database -d LAYATEST


Take the Metadata backup of the diskgroups.


ASMCMD> md_backup /software/asm_diskgrp_bkp -G DATA,FRA
Disk group metadata to be backed up: DATA
Disk group metadata to be backed up: FRA
Current alias directory path: LAYATEST/TEMPFILE
Current alias directory path: LAYATEST/DATAFILE
Current alias directory path: LAYATEST/ONLINELOG
Current alias directory path: LAYATEST
Current alias directory path: LAYATEST/CONTROLFILE
Current alias directory path: LAYATEST/PARAMETERFILE
Current alias directory path: LAYATEST/ARCHIVELOG
Current alias directory path: LAYATEST
Current alias directory path: LAYATEST/ARCHIVELOG/2013_10_18


Drop the diskgroups.

-- For droping a diskgorup it should be mounted only on one node. You can use sqlplus or asmcmd to drop the
diskgroups.


Node 2.


SQL> alter diskgroup data dismount;

Diskgroup altered.

SQL> alter diskgroup fra dismount;

Diskgroup altered.


Node 1
------

ASMCMD> dropdg -r data
ASMCMD> dropdg -r fra


here we dont have additional disk so as to create the new diskgroups with normal redundancy, hence we have dropped the disk
and we are going to parition the disk with different sizes and then we are going to create the normal redundancy diskgroup.


From the earlier data we know the disks of DATA and FRA diskgroup which are as below.


NAME                           FAILGROUP                      PATH                                       TOTAL_MB HEADER_STATU REDUNDA
------------------------------ ------------------------------ ---------------------------------------- ---------- ------------ -------
FRA                            FRA                            /dev/oracleasm/disks/FRA                       1918 MEMBER       UNKNOWN
DATA                           DATA                           /dev/oracleasm/disks/DATA                      3871 MEMBER       UNKNOWN


[root@rhel11gr2rac1 ~]# /etc/init.d/oracleasm listdisks
ACFSDISK
DATA
FRA
OCR_VOT_DISK_1
OCR_VOT_DISK_2
OCR_VOT_DISK_3

[root@rhel11gr2rac1 ~]# /etc/init.d/oracleasm querydisk /dev/s* | grep "DATA"

Device "/dev/sdi1" is marked an ASM disk with the label "DATA"

[root@rhel11gr2rac1 ~]# /etc/init.d/oracleasm querydisk /dev/s* | grep "FRA"

Device "/dev/sdk1" is marked an ASM disk with the label "FRA"

-- so the physical disk for DATA asm disk is /dev/sdi1 and for FRA asm disk is /dev/sdk1


[root@rhel11gr2rac1 ~]# /etc/init.d/oracleasm deletedisk DATA
Removing ASM disk "DATA":                                  [  OK  ]

[root@rhel11gr2rac1 ~]# /etc/init.d/oracleasm deletedisk FRA
Removing ASM disk "FRA":                                   [  OK  ]


Delete the paritiion on /dev/sdi and /dev/sdk


[root@rhel11gr2rac1 ~]# fdisk /dev/sdi

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): d
Selected partition 1

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.



[root@rhel11gr2rac1 ~]# fdisk /dev/sdk

Command (m for help): d
Selected partition 1

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.


[root@rhel11gr2rac1 ~]# fdisk -l /dev/sdi

Disk /dev/sdi: 4060 MB, 4060086272 bytes
125 heads, 62 sectors/track, 1023 cylinders
Units = cylinders of 7750 * 512 = 3968000 bytes

   Device Boot      Start         End      Blocks   Id  System

[root@rhel11gr2rac1 ~]# fdisk -l /dev/sdk

Disk /dev/sdk: 2013 MB, 2013265920 bytes
62 heads, 62 sectors/track, 1022 cylinders
Units = cylinders of 3844 * 512 = 1968128 bytes

   Device Boot      Start         End      Blocks   Id  System


Now the partitions are deleted, now we can create more partion on these devices.


[root@rhel11gr2rac1 ~]# fdisk /dev/sdi

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1023, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-1023, default 1023): +2000M

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (506-1023, default 506):
Using default value 506
Last cylinder or +size or +sizeM or +sizeK (506-1023, default 1023): +2000M

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@rhel11gr2rac1 ~]# fdisk /dev/sdk

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1022, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1022, default 1022): +1000M

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (510-1022, default 510):
Using default value 510
Last cylinder or +size or +sizeM or +sizeK (510-1022, default 1022): 1000M

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.


Now list the partitions.

[root@rhel11gr2rac1 ~]# fdisk -l /dev/sdi

Disk /dev/sdi: 4060 MB, 4060086272 bytes
125 heads, 62 sectors/track, 1023 cylinders
Units = cylinders of 7750 * 512 = 3968000 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdi1               1         505     1956844   83  Linux
/dev/sdi2             506        1010     1956875   83  Linux
[root@rhel11gr2rac1 ~]# fdisk -l /dev/sdk

Disk /dev/sdk: 2013 MB, 2013265920 bytes
62 heads, 62 sectors/track, 1022 cylinders
Units = cylinders of 3844 * 512 = 1968128 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdk1               1         509      978267   83  Linux
/dev/sdk2             510        1000      943702   83  Linux

Now execute the below on the next node to make sync with the first node and check the new partitions.

[root@rhel11gr2rac2 ~]# partbrobe

[root@rhel11gr2rac2 ~]# fdisk -l /dev/sdi

Disk /dev/sdi: 4060 MB, 4060086272 bytes
125 heads, 62 sectors/track, 1023 cylinders
Units = cylinders of 7750 * 512 = 3968000 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdi1               1         505     1956844   83  Linux
/dev/sdi2             506        1010     1956875   83  Linux


[root@rhel11gr2rac2 ~]# fdisk -l /dev/sdk

Disk /dev/sdk: 2013 MB, 2013265920 bytes
62 heads, 62 sectors/track, 1022 cylinders
Units = cylinders of 3844 * 512 = 1968128 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdk1               1         509      978267   83  Linux
/dev/sdk2             510        1000      943702   83  Linux



Now create the asm disk on these physical devices.


[root@rhel11gr2rac1 ~]# /etc/init.d/oracleasm createdisk DATA1 /dev/sdi1
Marking disk "DATA1" as an ASM disk:                       [  OK  ]


[root@rhel11gr2rac1 ~]# /etc/init.d/oracleasm createdisk DATA2 /dev/sdi2
Marking disk "DATA2" as an ASM disk:                       [  OK  ]


[root@rhel11gr2rac1 ~]# /etc/init.d/oracleasm createdisk FRA1 /dev/sdk1
Marking disk "FRA1" as an ASM disk:                        [  OK  ]
[root@rhel11gr2rac1 ~]# /etc/init.d/oracleasm createdisk FRA2 /dev/sdk2
Marking disk "FRA2" as an ASM disk:                        [  OK  ]


[root@rhel11gr2rac1 ~]# /etc/init.d/oracleasm listdisks
ACFSDISK
DATA1
DATA2
FRA1
FRA2
OCR_VOT_DISK_1
OCR_VOT_DISK_2
OCR_VOT_DISK_3


Node 2

[root@rhel11gr2rac2 ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks:               [  OK  ]

[root@rhel11gr2rac2 ~]# /etc/init.d/oracleasm listdisks
ACFSDISK
DATA1
DATA2
FRA1
FRA2
OCR_VOT_DISK_1
OCR_VOT_DISK_2
OCR_VOT_DISK_3

Now connect to the asm instance and create the diskgroup.


SQL> create diskgroup DATA normal redundancy disk '/dev/oracleasm/disks/DATA1','/dev/oracleasm/disks/DATA2';

Diskgroup created.

SQL> create diskgroup FRA normal redundancy disk '/dev/oracleasm/disks/FRA1','/dev/oracleasm/disks/FRA2';

Diskgroup created.

Now restore the meta data using asmcmd.


ASMCMD> md_restore --nodg -G data --silent /software/asm_diskgrp_bkp
Current Diskgroup metadata being restored: DATA
ASMCMD-9360: ADD or ALTER ATTRIBUTE failed
ORA-15032: not all alterations performed
ORA-15242: could not set attribute _._DIRVERSION
ORA-15221: ASM operation requires compatible.asm of 11.1.0.0.0 or higher (DBD ERROR: OCIStmtExecute)
System template TEMPFILE modified!
System template CONTROLFILE modified!
System template XTRANSPORT modified!
System template DATAFILE modified!
System template ARCHIVELOG modified!
System template CHANGETRACKING modified!
System template DUMPSET modified!
System template PARAMETERFILE modified!
System template OCRFILE modified!
System template ONLINELOG modified!
System template FLASHBACK modified!
System template AUTOBACKUP modified!
System template DATAGUARDCONFIG modified!
System template ASMPARAMETERFILE modified!
System template FLASHFILE modified!
System template BACKUPSET modified!
Directory +DATA/LAYATEST re-created!
Directory +DATA/LAYATEST/DATAFILE re-created!
Directory +DATA/LAYATEST/CONTROLFILE re-created!
Directory +DATA/LAYATEST/ONLINELOG re-created!
Directory +DATA/LAYATEST/TEMPFILE re-created!
Directory +DATA/LAYATEST/PARAMETERFILE re-created!

ASMCMD> md_restore --nodg -G FRA --silent /software/asm_diskgrp_bkp
Current Diskgroup metadata being restored: FRA
ASMCMD-9360: ADD or ALTER ATTRIBUTE failed
ORA-15032: not all alterations performed
ORA-15242: could not set attribute _._DIRVERSION
ORA-15221: ASM operation requires compatible.asm of 11.1.0.0.0 or higher (DBD ERROR: OCIStmtExecute)
System template XTRANSPORT modified!
System template ONLINELOG modified!
System template DATAGUARDCONFIG modified!
System template AUTOBACKUP modified!
System template TEMPFILE modified!
System template OCRFILE modified!
System template ARCHIVELOG modified!
System template DUMPSET modified!
System template CONTROLFILE modified!
System template BACKUPSET modified!
System template ASMPARAMETERFILE modified!
System template FLASHBACK modified!
System template PARAMETERFILE modified!
System template FLASHFILE modified!
System template DATAFILE modified!
System template CHANGETRACKING modified!
Directory +FRA/LAYATEST re-created!
Directory +FRA/LAYATEST/ARCHIVELOG re-created!
Directory +FRA/LAYATEST/ARCHIVELOG/2013_10_18 re-created!

Now restore the database from the backup.

rman target /


RMAN> startup nomount

connected to target database (not started)
startup failed: ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA/layatest/spfilelayatest.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA/layatest/spfilelayatest.ora
ORA-15056: additional error message
ORA-17503: ksfdopn:2 Failed to open file +DATA/layatest/spfilelayatest.ora
ORA-15173: entry 'spfilelayatest.ora' does not exist in directory 'layatest'
ORA-06512: at line 4

starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started

Total System Global Area     158662656 bytes

Fixed Size                     2226456 bytes
Variable Size                104859368 bytes
Database Buffers              46137344 bytes
Redo Buffers                   5439488 bytes


RMAN> restore spfile from '/software/layatest_db_backup_20131019_19_0compio9_1_1';

Starting restore at 19-OCT-13
using channel ORA_DISK_1

channel ORA_DISK_1: restoring spfile from AUTOBACKUP /software/layatest_db_backup_20131019_19_0compio9_1_1
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 19-OCT-13

RMAN> restore controlfile from '/software/layatest_db_backup_20131019_19_0bompin3_1_1';

Starting restore at 19-OCT-13
using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:18
output file name=+DATA/layatest/controlfile/current.257.829179675
Finished restore at 19-OCT-13

RMAN> alter database mount;

database mounted


RMAN> restore database;

Starting restore at 19-OCT-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=39 instance=layatest1 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=28 instance=layatest1 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=23 instance=layatest1 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00006 to +DATA/layatest/datafile/golden_gate01.dbf
channel ORA_DISK_1: restoring datafile 00007 to +DATA/layatest/datafile/manzoor01.dbf
channel ORA_DISK_1: restoring datafile 00008 to +DATA/layatest/datafile/undotbstwo.dbf
channel ORA_DISK_1: reading from backup piece /software/layatest_db_backup_20131019_19_0aompim9_1_1
channel ORA_DISK_2: starting datafile backup set restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
channel ORA_DISK_2: restoring datafile 00001 to +DATA/layatest/datafile/system.256.810788853
channel ORA_DISK_2: reading from backup piece /software/layatest_db_backup_20131019_19_08ompim7_1_1
channel ORA_DISK_3: starting datafile backup set restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_DISK_3: restoring datafile 00002 to +DATA/layatest/datafile/sysaux.257.810788857
channel ORA_DISK_3: restoring datafile 00004 to +DATA/layatest/datafile/users.259.810788857
channel ORA_DISK_3: restoring datafile 00009 to +DATA/layatest/datafile/undotbsone.dbf
channel ORA_DISK_3: reading from backup piece /software/layatest_db_backup_20131019_19_09ompim7_1_1
channel ORA_DISK_1: piece handle=/software/layatest_db_backup_20131019_19_0aompim9_1_1 tag=TAG20131019T090302
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:32
channel ORA_DISK_3: piece handle=/software/layatest_db_backup_20131019_19_09ompim7_1_1 tag=TAG20131019T090302
channel ORA_DISK_3: restored backup piece 1
channel ORA_DISK_3: restore complete, elapsed time: 00:01:07
channel ORA_DISK_2: piece handle=/software/layatest_db_backup_20131019_19_08ompim7_1_1 tag=TAG20131019T090302
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:01:30
Finished restore at 19-OCT-13

RMAN> recover database;

Starting recover at 19-OCT-13
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3

starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=90
channel ORA_DISK_1: reading from backup piece /software/layatest_db_backup_20131019_19_0eompitc_1_1
channel ORA_DISK_2: starting archived log restore to default destination
channel ORA_DISK_2: restoring archived log
archived log thread=2 sequence=152
channel ORA_DISK_2: reading from backup piece /software/layatest_db_backup_20131019_19_0fompitc_1_1
channel ORA_DISK_3: starting archived log restore to default destination
channel ORA_DISK_3: restoring archived log
archived log thread=1 sequence=91
channel ORA_DISK_3: restoring archived log
archived log thread=2 sequence=153
channel ORA_DISK_3: reading from backup piece /software/layatest_db_backup_20131019_19_0gompitc_1_1
channel ORA_DISK_1: piece handle=/software/layatest_db_backup_20131019_19_0eompitc_1_1 tag=TAG20131019T090651
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
archived log file name=+FRA/layatest/archivelog/2013_10_19/thread_1_seq_90.256.829180679 thread=1 sequence=90
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=154
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=92
channel ORA_DISK_1: reading from backup piece /software/layatest_db_backup_20131019_19_0hompitc_1_1
channel ORA_DISK_2: piece handle=/software/layatest_db_backup_20131019_19_0fompitc_1_1 tag=TAG20131019T090651
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:04
archived log file name=+FRA/layatest/archivelog/2013_10_19/thread_2_seq_152.257.829180679 thread=2 sequence=152
channel ORA_DISK_2: starting archived log restore to default destination
channel ORA_DISK_2: restoring archived log
archived log thread=1 sequence=93
channel ORA_DISK_2: reading from backup piece /software/layatest_db_backup_20131019_19_0iompj26_1_1
channel ORA_DISK_1: piece handle=/software/layatest_db_backup_20131019_19_0hompitc_1_1 tag=TAG20131019T090651
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=155
channel ORA_DISK_1: reading from backup piece /software/layatest_db_backup_20131019_19_0jompj27_1_1
channel ORA_DISK_3: piece handle=/software/layatest_db_backup_20131019_19_0gompitc_1_1 tag=TAG20131019T090651
channel ORA_DISK_3: restored backup piece 1
channel ORA_DISK_3: restore complete, elapsed time: 00:00:06
archived log file name=+FRA/layatest/archivelog/2013_10_19/thread_1_seq_91.258.829180679 thread=1 sequence=91
archived log file name=+FRA/layatest/archivelog/2013_10_19/thread_2_seq_153.259.829180679 thread=2 sequence=153
archived log file name=+FRA/layatest/archivelog/2013_10_19/thread_2_seq_154.260.829180683 thread=2 sequence=154
archived log file name=+FRA/layatest/archivelog/2013_10_19/thread_1_seq_92.261.829180683 thread=1 sequence=92
channel ORA_DISK_1: piece handle=/software/layatest_db_backup_20131019_19_0jompj27_1_1 tag=TAG20131019T090926
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:00
channel ORA_DISK_2: piece handle=/software/layatest_db_backup_20131019_19_0iompj26_1_1 tag=TAG20131019T090926
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:01
archived log file name=+FRA/layatest/archivelog/2013_10_19/thread_1_seq_93.262.829180683 thread=1 sequence=93
archived log file name=+FRA/layatest/archivelog/2013_10_19/thread_2_seq_155.263.829180685 thread=2 sequence=155
unable to find archived log
archived log thread=2 sequence=156
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 10/19/2013 15:58:05
RMAN-06054: media recovery requesting unknown archived log for thread 2 with sequence 156 and starting SCN of 3317418

RMAN> alter database open resetlogs;

database opened


Asm instance.
=============

SQL> select path, name, total_mb, free_mb, failgroup from V$asm_disk;

PATH                                               NAME                             TOTAL_MB    FREE_MB FAILGROUP                    
-------------------------------------------------- ------------------------------ ---------- ---------- ------------------------------
/dev/oracleasm/disks/ACFSDISK                      ACFSDISK                             9759        581 ACFSDISK                      
/dev/oracleasm/disks/FRA2                          FRA_0001                              921        855 FRA_0001                      
/dev/oracleasm/disks/FRA1                          FRA_0000                              955        888 FRA_0000                      
/dev/oracleasm/disks/DATA2                         DATA_0001                            1911        824 DATA_0001                    
/dev/oracleasm/disks/DATA1                         DATA_0000                            1910        822 DATA_0000                    
/dev/oracleasm/disks/OCR_VOT_DISK_3                OCR_VOTING_0002                       956        608 OCR_VOTING_0002              
/dev/oracleasm/disks/OCR_VOT_DISK_2                OCR_VOTING_0001                       956        608 OCR_VOTING_0001              
/dev/oracleasm/disks/OCR_VOT_DISK_1                OCR_VOTING_0000                       956        612 OCR_VOTING_0000              


SQL> alter diskgroup data set attribute 'disk_repair_time' = '10h';
alter diskgroup data set attribute 'disk_repair_time' = '10h'
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15242: could not set attribute disk_repair_time
ORA-15283: ASM operation requires compatible.rdbms of 11.1.0.0.0 or higher


SQL> alter diskgroup data set attribute 'compatible.rdbms' = '11.1';

Diskgroup altered.

SQL> alter diskgroup data set attribute 'disk_repair_time' = '10h';

Diskgroup altered.


Since we have the normal redundancy so even when one disk goes (failgroup) goes offline still it will
serve the database with the other failgroup disk.

So for normal redundancy we required minimum 2 disk.

If we are using high redundancy we need minimum of 3 disk (i.e. even if two disk goes offline still
the databse will be serverd using the remaining disk.

ASM fast resync keeps track of pending changes to extents on an OFFLINE disk during an outage.
The extents are resynced when the disk is brought back online.

By default, ASM drops a disk in 3.6 hours after it is taken offline. You can set the DISK_REPAIR_TIME attribute
to delay the drop operation by specifying a time interval to repair the disk and bring it back online.
The time can be specified in units of minutes (m or M) or hours (h or H). If you omit the unit,
then the default unit is hours.

If the attribute is not set explicitly, then the default value (3.6h) applies to disks that have been
set to OFFLINE mode without an explicit DROP AFTER clause. Note that disks taken offline due to I/O
errors do not have a DROP AFTER clause.

The default DISK_REPAIR_TIME attribute value is an estimate that should be adequate for most environments.
However, make sure that the attribute value is set to the amount of time that you think is necessary in your
environment to fix any transient disk error and that you are willing to tolerate reduced data redundancy.

The elapsed time (since the disk was set to OFFLINE mode) is incremented only when the disk group containing
the offline disks is mounted. The REPAIR_TIME column of V$ASM_DISK shows the amount of time left (in seconds)
before an offline disk is dropped. After the specified time has elapsed, ASM drops the disk. You can override
this attribute with an ALTER DISKGROUP DISK OFFLINE statement and the DROP AFTER clause.


SQL> alter diskgroup data offline disk 'DATA_0001';

Diskgroup altered.


SQL> select path, name, total_mb, free_mb from V$asm_disk;

PATH                                               NAME                             TOTAL_MB    FREE_MB
-------------------------------------------------- ------------------------------ ---------- ----------
/dev/oracleasm/disks/DATA2                                                                 0          0
                                                   DATA_0001                            1911        824
/dev/oracleasm/disks/ACFSDISK                      ACFSDISK                             9759        581
/dev/oracleasm/disks/FRA2                          FRA_0001                              921        855
/dev/oracleasm/disks/FRA1                          FRA_0000                              955        888
/dev/oracleasm/disks/DATA1                         DATA_0000                            1910        822
/dev/oracleasm/disks/OCR_VOT_DISK_3                OCR_VOTING_0002                       956        608
/dev/oracleasm/disks/OCR_VOT_DISK_2                OCR_VOTING_0001                       956        608
/dev/oracleasm/disks/OCR_VOT_DISK_1                OCR_VOTING_0000                       956        612


SQL> select name, total_mb, usable_file_mb, state from V$asm_diskgroup;

NAME                             TOTAL_MB USABLE_FILE_MB STATE
------------------------------ ---------- -------------- -----------
ACFDG                                9759            581 MOUNTED
OCR_VOTING                           2868            436 MOUNTED
DATA                                 1910            411 MOUNTED
FRA                                  1876            871 MOUNTED

SQL> alter diskgroup data online disk 'DATA_0001';

Diskgroup altered.

SQL> select name, total_mb, usable_file_mb, state from V$asm_diskgroup;

NAME                             TOTAL_MB USABLE_FILE_MB STATE
------------------------------ ---------- -------------- -----------
ACFDG                                9759            581 MOUNTED
OCR_VOTING                           2868            436 MOUNTED
DATA                                 3821            823 MOUNTED
FRA                                  1876            871 MOUNTED



















Saturday, October 5, 2013

Steps to add Client to DNS Server ( RHEL 5)

Steps to Add client to the DNS server.
======================================

-- To setup the DNS Server Follow this Post

1) Update the client server details in the forward.zone file.

Here our clinet server is hostname is urac1rac2-scan.manzoor.com and the IP address for
this host is 192.168.0.27 / 192.168.0.28 and 192.168.0.29

-- Note in this eg. we are using three ip address for the same host beacuse we are
going to setup scan ip for the Oracle 11g grid.


2. Edit the forward zone file and add the client server hostname and ip address as below.

[root@standalone2 named]# vi forward.zone

$TTL    86400
@               IN SOA  standalone2.manzoor.com. root.standalone2.manzoor.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
                IN NS           standalone2.manzoor.com.
                IN NS           urac1rac2-scan.manzoor.com.
standalone2     IN A            192.168.0.30
urac1rac2-scan  IN A            192.168.0.27
urac1rac2-scan  IN A            192.168.0.28
urac1rac2-scan  IN A            192.168.0.29


-- Note
NS --  Denotes Named server
A  --  Denotes Address.

We have updated the NS and A for the client.

2) Update the clienter server details in the reverse.zone file.

[root@standalone2 named]# vi reverse.zone

$TTL    86400
@       IN      SOA     standalone2.manzoor.com. root.standalone2.manzoor.com.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      standalone2.manzoor.com.
        IN      NS      urac1rac2-scan.manzoor.com.
30      IN      PTR     standalone2.manzoor.com.
27      IN      PTR     urac1rac2-scan.manzoor.com.
28      IN      PTR     urac1rac2-scan.manzoor.com.
29      IN      PTR     urac1rac2-scan.manzoor.com.

-- Note

PTR -- Here the PTR denotes the last pointer of the IP address.

4)  Now Test this

[root@standalone2 named]# nslookup urac1rac2-scan.manzoor.com
Server:         192.168.0.30
Address:        192.168.0.30#53

** server can't find urac1rac2-scan.manzoor.com: NXDOMAIN


[root@standalone2 named]# service named restart
Stopping named:                                            [  OK  ]
Starting named:    


-- We have assigned three ips for urac1rac2-scan.manzoor.com so it should listen is round robin fashion.


[root@standalone2 named]# nslookup urac1rac2-scan.manzoor.com
Server:         192.168.0.30
Address:        192.168.0.30#53

Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.27
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.28
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.29

[root@standalone2 named]# nslookup urac1rac2-scan.manzoor.com
Server:         192.168.0.30
Address:        192.168.0.30#53

Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.28
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.29
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.27

[root@standalone2 named]# nslookup urac1rac2-scan.manzoor.com
Server:         192.168.0.30
Address:        192.168.0.30#53

Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.29
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.27
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.28


Update the /etc/resovl.conf file in the client to update the DNS server address.

----- Client Configuration in DNS Server is Completed ------------------------------------



Setup DNS Server in RHEL 5


DNS Server Configuration
========================

-- To setup yum installer Follow this Post

1) Install the necessary rpm (bind packages)  which are required to configure DNS Server.


[root@standalone2 ~]# yum install -y *bind* caching-nameserver


2) Notedown the Public IP address of the Server.

[root@standalone2 ~]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0C:29:86:F8:24
          inet addr:192.168.0.30  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe86:f824/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:26338 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40786 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1764870 (1.6 MiB)  TX bytes:8763994 (8.3 MiB)


IP Address - 192.168.0.30

3) Modify the named.conf coniguration files

[root@standalone2 ~]# cd /var/named/chroot/etc/

[root@standalone2 etc]# ls -lrt
total 16
-rw-r----- 1 root named  955 Dec  2  2010 named.rfc1912.zones
-rw-r----- 1 root named 1230 Dec  2  2010 named.caching-nameserver.conf
-rw-r--r-- 1 root root  2819 Oct 13  2012 localtime
-rw-r----- 1 root named  113 Oct  4 21:52 rndc.key


[root@standalone2 etc]# cp named.caching-nameserver.conf named.conf

[root@standalone2 etc]# vi named.conf

# edit the named.conf file...


Modify the below lines...


Before Modification
===================

        listen-on port 53 { 127.0.0.1; };
        listen-on-v6 port 53 { ::1; };

        allow-query     { localhost; };
        allow-query-cache { localhost; };

        match-clients      { localhost; };
        match-destinations { localhost; };


After Modificaton
=================



        listen-on port 53 { 192.168.0.30; };
#       listen-on-v6 port 53 { ::1; };


        allow-query     { any; };
        allow-query-cache { any; };

        match-clients      { any; };
        match-destinations { 192.168.0.30; };



[root@standalone2 etc]# ls -lrt
total 20
-rw-r----- 1 root named  955 Dec  2  2010 named.rfc1912.zones
-rw-r----- 1 root named 1230 Dec  2  2010 named.caching-nameserver.conf
-rw-r--r-- 1 root root  2819 Oct 13  2012 localtime
-rw-r----- 1 root named  113 Oct  4 21:52 rndc.key
-rw-r----- 1 root root  1219 Oct  4 22:46 named.conf


4. Edit the zones files.


[root@standalone2 etc]# vi named.rfc1912.zones

# Now edit the zone file


Mofiy the below lines.


Before Modification.
====================


zone "localdomain" IN {
file "localdomain.zone";



zone "0.0.127.in-addr.arpa" IN {
file "named.local";



After Modification
===================

zone "manzoor.com" IN {
file "forward.zone";

zone "0.168.192.in-addr.arpa" IN {
file "reverse.zone";


[root@standalone2 etc]# chgrp named named.conf

[root@standalone2 etc]# ls -lrt
total 20
-rw-r----- 1 root named 1230 Dec  2  2010 named.caching-nameserver.conf
-rw-r--r-- 1 root root  2819 Oct 13  2012 localtime
-rw-r----- 1 root named  113 Oct  4 21:52 rndc.key
-rw-r----- 1 root named 1219 Oct  4 22:46 named.conf
-rw-r----- 1 root named  954 Oct  4 23:20 named.rfc1912.zones


[root@standalone2 etc]# cd /var/named/chroot/var/named

[root@standalone2 named]# ls -lrt
total 36
drwxrwx--- 2 named named 4096 Jul 27  2004 slaves
drwxrwx--- 2 named named 4096 Aug 25  2004 data
-rw-r----- 1 root  named  427 Dec  2  2010 named.zero
-rw-r----- 1 root  named  426 Dec  2  2010 named.local
-rw-r----- 1 root  named  424 Dec  2  2010 named.ip6.local
-rw-r----- 1 root  named 1892 Dec  2  2010 named.ca
-rw-r----- 1 root  named  427 Dec  2  2010 named.broadcast
-rw-r----- 1 root  named  195 Dec  2  2010 localhost.zone
-rw-r----- 1 root  named  198 Dec  2  2010 localdomain.zone


-- Before in the zone file we have changed the localdoamin.zone to forward.zone and named.local to reverse.zone
   so copy the below files with the mentioned name and edit it

[root@standalone2 named]# cp localdomain.zone forward.zone
[root@standalone2 named]# cp named.local reverse.zone


[root@standalone2 named]# vi forward.zone


# Whole file before modification.
================================

$TTL    86400
@               IN SOA  localhost root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
                IN NS           localhost
localhost       IN A            127.0.0.1



# whole file after modification.
================================

$TTL    86400
@               IN SOA  standalone2.manzoor.com. root.standalone2.manzoor.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
                IN NS           standalone2.manzoor.com.
standalone2     IN A            192.168.0.30


[root@standalone2 named]# vi reverse.zone

# Whole file before modification.
================================

$TTL    86400
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      localhost.
1       IN      PTR     localhost.


# whole file after modification.
================================

$TTL    86400
@       IN      SOA     standalone2.manzoor.com. root.standalone2.manzoor.com.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      standalone2.manzoor.com.
30      IN      PTR     standalone2.manzoor.com.



-- in the above 30 is the last pointer in the ip address 192.168.0.30


-- Change the group of forward.zone and reverse.zone files to named group.

[root@standalone2 named]# chgrp named forward.zone
[root@standalone2 named]# chgrp named reverse.zone


[root@standalone2 named]# ls -lrt
total 44
drwxrwx--- 2 named named 4096 Jul 27  2004 slaves
drwxrwx--- 2 named named 4096 Aug 25  2004 data
-rw-r----- 1 root  named  427 Dec  2  2010 named.zero
-rw-r----- 1 root  named  426 Dec  2  2010 named.local
-rw-r----- 1 root  named  424 Dec  2  2010 named.ip6.local
-rw-r----- 1 root  named 1892 Dec  2  2010 named.ca
-rw-r----- 1 root  named  427 Dec  2  2010 named.broadcast
-rw-r----- 1 root  named  195 Dec  2  2010 localhost.zone
-rw-r----- 1 root  named  198 Dec  2  2010 localdomain.zone
-rw-r----- 1 root  named  258 Oct  4 23:25 forward.zone
-rw-r----- 1 root  named  482 Oct  4 23:28 reverse.zone


[root@standalone2 named]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1                     localhost6.localdomain6 localhost6
##################################################
#### Public ips #################################
192.168.0.30    standalone2.manzoor.com         standalone2



5) Edit the resolv.conf file modify the localdomain to your domain name
and the nameserver ip address to the public ip of this server.


[root@standalone2 named]# vi /etc/resolv.conf

# Edit file as per below details.


search manzoor.com
nameserver 192.168.0.30


-- Host name should be updated in network file as below

[root@standalone2 named]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=standalone2.manzoor.com


-- Restart the named service


[root@standalone2 named]# service named restart
Stopping named:                                            [  OK  ]
Starting named:                                            [  OK  ]

-- Test the dns

[root@standalone2 named]# dig standalone2.manzoor.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> standalone2.manzoor.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- 6354="" id:="" noerror="" opcode:="" p="" query="" status:="">;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;standalone2.manzoor.com.       IN      A

;; ANSWER SECTION:
standalone2.manzoor.com. 86400  IN      A       192.168.0.30

;; AUTHORITY SECTION:
manzoor.com.            86400   IN      NS      standalone2.manzoor.com.

;; Query time: 4 msec
;; SERVER: 192.168.0.30#53(192.168.0.30)
;; WHEN: Fri Oct  4 23:32:47 2013
;; MSG SIZE  rcvd: 71


- We got the answer without error.

[root@standalone2 named]# nslookup standalone2.manzoor.com
Server:         192.168.0.30
Address:        192.168.0.30#53

Name:   standalone2.manzoor.com
Address: 192.168.0.30

[root@standalone2 named]# nslookup 192.168.0.30
Server:         192.168.0.30
Address:        192.168.0.30#53

30.0.168.192.in-addr.arpa       name = standalone2.manzoor.com.



== DNS Configuration for the server has been completed =====================

Setup Yum Installer in Linux 5

Prepare Yum Install.
===================


1. Mount the RHEL 5 ISO DVD on the server.

2. [root@standalone2 media]# mount /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@standalone2 media]# cd /mnt

3. Install the FTP Server.

[root@standalone2 Server]# ls -lrt vsf*
-r--r--r-- 75 root root 143483 May 24  2011 vsftpd-2.0.5-21.el5.x86_64.rpm
[root@standalone2 Server]# rpm -ivh vsftpd-2.0.5-21.el5.x86_64.rpm
warning: vsftpd-2.0.5-21.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:vsftpd                 ########################################### [100%]


4. Copy the files under Server / images directory and RPM-GPG-KEY files to /var/ftp/pub directory.


[root@standalone2 Server]# cp -av /mnt/Server /var/ftp/pub/

[root@standalone2 Server]# cp -av /mnt/images /var/ftp/pub/

[root@standalone2 Server]# cp -av /mnt/RPM-GPG-KEY* /var/ftp/pub/


5. Install the create repository package.

[root@standalone2 ~]# cd /var/ftp/pub/Server/
[root@standalone2 Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:createrepo             ########################################### [100%]


6. Create a Repository for the /var/ftp/pub directory

[root@standalone2 Server]# createrepo -v /var/ftp/pub

[root@standalone2 Server]# createrepo -g /var/ftp/pub/Server/repodata/comps-rhel5-server-core.xml /var/ftp/pub/

[root@standalone2 Server]# yum clean all
Loaded plugins: rhnplugin, security
Cleaning up Everything

7. Create an Repository file with below contents.

[root@standalone2 Server]# vi /etc/yum.repos.d/Server.repo

[ser]
name=standalone2.manzoor.com
baseurl=file:///var/ftp/pub
enabled=1
gpgcheck=0

8. Check yum installer tool by uninsalling and reinstalling a package


[root@standalone2 Server]# yum remove telnet
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package telnet.x86_64 1:0.17-39.el5 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                            Arch                               Version                                   Repository                             Size
=============================================================================================================================================================
Removing:
 telnet                             x86_64                             1:0.17-39.el5                             installed                             105 k

Transaction Summary
=============================================================================================================================================================
Remove        1 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing        : telnet                                                                                                                                1/1

Removed:
  telnet.x86_64 1:0.17-39.el5

Complete!


[root@standalone2 Server]# yum install telnet
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Server                                                                                                                                | 1.1 kB     00:00
Server/primary                                                                                                                        | 1.1 MB     00:00
Server                                                                                                                                             3261/3261
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package telnet.x86_64 1:0.17-39.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                            Arch                               Version                                      Repository                          Size
=============================================================================================================================================================
Installing:
 telnet                             x86_64                             1:0.17-39.el5                                Server                              60 k

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

Total download size: 60 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : telnet                                                                                                                                1/1

Installed:
  telnet.x86_64 1:0.17-39.el5

Complete!


[root@standalone2 Server]# yum update




======= yum configuration completed =========================

Setup up DNS Server for SCAN IP for 11gr2 Grid (11.2)


Setup DNS Server and configure scan ips and modify the scan details in 11g grid (11.2)
======================================================================================

In this post we are going to discuss about below

 *  How to setup the yum installer.
 *  How to Configure DNS server.
 *  How to add the Client server details in the DNS Server.
 *  How to Modify the SCAN IP details in the 11gr2 Grid Infrastructure.

OS -  RHEL 5.7

Prepare Yum Install.
===================


1. Mount the RHEL ISO DVD on the server.

2. [root@standalone2 media]# mount /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@standalone2 media]# cd /mnt

3. Install the FTP Server.

[root@standalone2 Server]# ls -lrt vsf*
-r--r--r-- 75 root root 143483 May 24  2011 vsftpd-2.0.5-21.el5.x86_64.rpm
[root@standalone2 Server]# rpm -ivh vsftpd-2.0.5-21.el5.x86_64.rpm
warning: vsftpd-2.0.5-21.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:vsftpd                 ########################################### [100%]


4. Copy the files under Server / images directory and RPM-GPG-KEY files to /var/ftp/pub directory.


[root@standalone2 Server]# cp -av /mnt/Server /var/ftp/pub/

[root@standalone2 Server]# cp -av /mnt/images /var/ftp/pub/

[root@standalone2 Server]# cp -av /mnt/RPM-GPG-KEY* /var/ftp/pub/


5. Install the create repository package.

[root@standalone2 ~]# cd /var/ftp/pub/Server/
[root@standalone2 Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:createrepo             ########################################### [100%]


6. Create a Repository for the /var/ftp/pub directory

[root@standalone2 Server]# createrepo -v /var/ftp/pub

[root@standalone2 Server]# createrepo -g /var/ftp/pub/Server/repodata/comps-rhel5-server-core.xml /var/ftp/pub/

[root@standalone2 Server]# yum clean all
Loaded plugins: rhnplugin, security
Cleaning up Everything

7. Create an Repository file with below contents.

[root@standalone2 Server]# vi /etc/yum.repos.d/Server.repo

[ser]
name=standalone2.manzoor.com
baseurl=file:///var/ftp/pub
enabled=1
gpgcheck=0

8. Check yum installer tool by uninsalling and reinstalling a package


[root@standalone2 Server]# yum remove telnet
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package telnet.x86_64 1:0.17-39.el5 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                            Arch                               Version                                   Repository                             Size
=============================================================================================================================================================
Removing:
 telnet                             x86_64                             1:0.17-39.el5                             installed                             105 k

Transaction Summary
=============================================================================================================================================================
Remove        1 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing        : telnet                                                                                                                                1/1

Removed:
  telnet.x86_64 1:0.17-39.el5

Complete!


[root@standalone2 Server]# yum install telnet
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Server                                                                                                                                | 1.1 kB     00:00
Server/primary                                                                                                                        | 1.1 MB     00:00
Server                                                                                                                                             3261/3261
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package telnet.x86_64 1:0.17-39.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                            Arch                               Version                                      Repository                          Size
=============================================================================================================================================================
Installing:
 telnet                             x86_64                             1:0.17-39.el5                                Server                              60 k

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

Total download size: 60 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : telnet                                                                                                                                1/1

Installed:
  telnet.x86_64 1:0.17-39.el5

Complete!


[root@standalone2 Server]# yum update




======= yum configuration completed =========================



DNS Server Configuration
========================


1) Install the necessary rpm (bind packages)  which are required to configure DNS Server.


[root@standalone2 ~]# yum install -y *bind* caching-nameserver


2) Notedown the Public IP address of the Server.

[root@standalone2 ~]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0C:29:86:F8:24
          inet addr:192.168.0.30  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe86:f824/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:26338 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40786 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1764870 (1.6 MiB)  TX bytes:8763994 (8.3 MiB)


IP Address - 192.168.0.30

3) Modify the named.conf coniguration files

[root@standalone2 ~]# cd /var/named/chroot/etc/

[root@standalone2 etc]# ls -lrt
total 16
-rw-r----- 1 root named  955 Dec  2  2010 named.rfc1912.zones
-rw-r----- 1 root named 1230 Dec  2  2010 named.caching-nameserver.conf
-rw-r--r-- 1 root root  2819 Oct 13  2012 localtime
-rw-r----- 1 root named  113 Oct  4 21:52 rndc.key


[root@standalone2 etc]# cp named.caching-nameserver.conf named.conf

[root@standalone2 etc]# vi named.conf

# edit the named.conf file...


Modify the below lines... 


Before Modification
===================

        listen-on port 53 { 127.0.0.1; };
        listen-on-v6 port 53 { ::1; };

        allow-query     { localhost; };
        allow-query-cache { localhost; };

        match-clients      { localhost; };
        match-destinations { localhost; };


After Modificaton
=================



        listen-on port 53 { 192.168.0.30; };
#       listen-on-v6 port 53 { ::1; };


        allow-query     { any; };
        allow-query-cache { any; };

        match-clients      { any; };
        match-destinations { 192.168.0.30; };



[root@standalone2 etc]# ls -lrt
total 20
-rw-r----- 1 root named  955 Dec  2  2010 named.rfc1912.zones
-rw-r----- 1 root named 1230 Dec  2  2010 named.caching-nameserver.conf
-rw-r--r-- 1 root root  2819 Oct 13  2012 localtime
-rw-r----- 1 root named  113 Oct  4 21:52 rndc.key
-rw-r----- 1 root root  1219 Oct  4 22:46 named.conf


4. Edit the zones files.


[root@standalone2 etc]# vi named.rfc1912.zones

# Now edit the zone file


Mofiy the below lines.


Before Modification.
====================


zone "localdomain" IN {
file "localdomain.zone";



zone "0.0.127.in-addr.arpa" IN {
file "named.local";



After Modification
===================

zone "manzoor.com" IN {
file "forward.zone";

zone "0.168.192.in-addr.arpa" IN {
file "reverse.zone";


[root@standalone2 etc]# chgrp named named.conf

[root@standalone2 etc]# ls -lrt
total 20
-rw-r----- 1 root named 1230 Dec  2  2010 named.caching-nameserver.conf
-rw-r--r-- 1 root root  2819 Oct 13  2012 localtime
-rw-r----- 1 root named  113 Oct  4 21:52 rndc.key
-rw-r----- 1 root named 1219 Oct  4 22:46 named.conf
-rw-r----- 1 root named  954 Oct  4 23:20 named.rfc1912.zones


[root@standalone2 etc]# cd /var/named/chroot/var/named

[root@standalone2 named]# ls -lrt
total 36
drwxrwx--- 2 named named 4096 Jul 27  2004 slaves
drwxrwx--- 2 named named 4096 Aug 25  2004 data
-rw-r----- 1 root  named  427 Dec  2  2010 named.zero
-rw-r----- 1 root  named  426 Dec  2  2010 named.local
-rw-r----- 1 root  named  424 Dec  2  2010 named.ip6.local
-rw-r----- 1 root  named 1892 Dec  2  2010 named.ca
-rw-r----- 1 root  named  427 Dec  2  2010 named.broadcast
-rw-r----- 1 root  named  195 Dec  2  2010 localhost.zone
-rw-r----- 1 root  named  198 Dec  2  2010 localdomain.zone


-- Before in the zone file we have changed the localdoamin.zone to forward.zone and named.local to reverse.zone
   so copy the below files with the mentioned name and edit it 

[root@standalone2 named]# cp localdomain.zone forward.zone
[root@standalone2 named]# cp named.local reverse.zone


[root@standalone2 named]# vi forward.zone


# Whole file before modification.
================================

$TTL    86400
@               IN SOA  localhost root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
                IN NS           localhost
localhost       IN A            127.0.0.1



# whole file after modification.
================================

$TTL    86400
@               IN SOA  standalone2.manzoor.com. root.standalone2.manzoor.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
                IN NS           standalone2.manzoor.com.
standalone2     IN A            192.168.0.30


[root@standalone2 named]# vi reverse.zone

# Whole file before modification.
================================

$TTL    86400
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      localhost.
1       IN      PTR     localhost.


# whole file after modification.
================================

$TTL    86400
@       IN      SOA     standalone2.manzoor.com. root.standalone2.manzoor.com.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      standalone2.manzoor.com.
30      IN      PTR     standalone2.manzoor.com.



-- in the above 30 is the last pointer in the ip address 192.168.0.30


-- Change the group of forward.zone and reverse.zone files to named group.

[root@standalone2 named]# chgrp named forward.zone
[root@standalone2 named]# chgrp named reverse.zone


[root@standalone2 named]# ls -lrt
total 44
drwxrwx--- 2 named named 4096 Jul 27  2004 slaves
drwxrwx--- 2 named named 4096 Aug 25  2004 data
-rw-r----- 1 root  named  427 Dec  2  2010 named.zero
-rw-r----- 1 root  named  426 Dec  2  2010 named.local
-rw-r----- 1 root  named  424 Dec  2  2010 named.ip6.local
-rw-r----- 1 root  named 1892 Dec  2  2010 named.ca
-rw-r----- 1 root  named  427 Dec  2  2010 named.broadcast
-rw-r----- 1 root  named  195 Dec  2  2010 localhost.zone
-rw-r----- 1 root  named  198 Dec  2  2010 localdomain.zone
-rw-r----- 1 root  named  258 Oct  4 23:25 forward.zone
-rw-r----- 1 root  named  482 Oct  4 23:28 reverse.zone


[root@standalone2 named]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1                     localhost6.localdomain6 localhost6
##################################################
#### Public ips #################################
192.168.0.30    standalone2.manzoor.com         standalone2



5) Edit the resolv.conf file modify the localdomain to your domain name
and the nameserver ip address to the public ip of this server.


[root@standalone2 named]# vi /etc/resolv.conf

# Edit file as per below details.


search manzoor.com
nameserver 192.168.0.30


-- Host name should be updated in network file as below

[root@standalone2 named]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=standalone2.manzoor.com


-- Restart the named service


[root@standalone2 named]# service named restart
Stopping named:                                            [  OK  ]
Starting named:                                            [  OK  ]

-- Test the dns

[root@standalone2 named]# dig standalone2.manzoor.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> standalone2.manzoor.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- 6354="" div="" id:="" noerror="" opcode:="" query="" status:="">
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;standalone2.manzoor.com.       IN      A

;; ANSWER SECTION:
standalone2.manzoor.com. 86400  IN      A       192.168.0.30

;; AUTHORITY SECTION:
manzoor.com.            86400   IN      NS      standalone2.manzoor.com.

;; Query time: 4 msec
;; SERVER: 192.168.0.30#53(192.168.0.30)
;; WHEN: Fri Oct  4 23:32:47 2013
;; MSG SIZE  rcvd: 71


- We got the answer without error.

[root@standalone2 named]# nslookup standalone2.manzoor.com
Server:         192.168.0.30
Address:        192.168.0.30#53

Name:   standalone2.manzoor.com
Address: 192.168.0.30

[root@standalone2 named]# nslookup 192.168.0.30
Server:         192.168.0.30
Address:        192.168.0.30#53

30.0.168.192.in-addr.arpa       name = standalone2.manzoor.com.



== DNS Configuration for the server has been completed =====================



Steps to Add client to the DNS server.
======================================


1) Update the client server details in the forward.zone file.

Here our clinet server is hostname is urac1rac2-scan.manzoor.com and the IP address for
this host is 192.168.0.27 / 192.168.0.28 and 192.168.0.29

-- Note in this eg. we are using three ip address for the same host beacuse we are 
going to setup scan ip for the Oracle 11g grid.


2. Edit the forward zone file and add the client server hostname and ip address as below.

[root@standalone2 named]# vi forward.zone

$TTL    86400
@               IN SOA  standalone2.manzoor.com. root.standalone2.manzoor.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
                IN NS           standalone2.manzoor.com.
                IN NS           urac1rac2-scan.manzoor.com.
standalone2     IN A            192.168.0.30
urac1rac2-scan  IN A            192.168.0.27
urac1rac2-scan  IN A            192.168.0.28
urac1rac2-scan  IN A            192.168.0.29


-- Note
NS --  Denotes Named server
A  --  Denotes Address. 

We have updated the NS and A for the client.

2) Update the clienter server details in the reverse.zone file.

[root@standalone2 named]# vi reverse.zone

$TTL    86400
@       IN      SOA     standalone2.manzoor.com. root.standalone2.manzoor.com.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      standalone2.manzoor.com.
        IN      NS      urac1rac2-scan.manzoor.com.
30      IN      PTR     standalone2.manzoor.com.
27      IN      PTR     urac1rac2-scan.manzoor.com.
28      IN      PTR     urac1rac2-scan.manzoor.com.
29      IN      PTR     urac1rac2-scan.manzoor.com.

-- Note

PTR -- Here the PTR denotes the last pointer of the IP address.

4)  Now Test this 

[root@standalone2 named]# nslookup urac1rac2-scan.manzoor.com
Server:         192.168.0.30
Address:        192.168.0.30#53

** server can't find urac1rac2-scan.manzoor.com: NXDOMAIN


[root@standalone2 named]# service named restart
Stopping named:                                            [  OK  ]
Starting named:      


-- We have assigned three ips for urac1rac2-scan.manzoor.com so it should listen is round robin fashion.


[root@standalone2 named]# nslookup urac1rac2-scan.manzoor.com
Server:         192.168.0.30
Address:        192.168.0.30#53

Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.27
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.28
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.29

[root@standalone2 named]# nslookup urac1rac2-scan.manzoor.com
Server:         192.168.0.30
Address:        192.168.0.30#53

Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.28
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.29
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.27

[root@standalone2 named]# nslookup urac1rac2-scan.manzoor.com
Server:         192.168.0.30
Address:        192.168.0.30#53

Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.29
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.27
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.28


Update the /etc/resovl.conf file in the client to update the DNS server address.

----- Client Configuration in DNS Server is Completed ------------------------------------


Updating the SCAN IP in 11gr2 Grid.
===================================


Currently we have a two node rac setup running with one scan since we dont have dns, 
and have used the /etc/hosts file for resolving the SCAN ip. 

Now we have setup the DNS server and have updated three ips for scan (urac1rac2-scan.manzoor.com).


Current scan detail in Grid.

[oracle@rhel11gr2rac1 bin]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rhel11gr2rac2

[oracle@rhel11gr2rac1 bin]$ ./srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rhel11gr2rac2



[oracle@rhel11gr2rac1 bin]$ srvctl config scan
SCAN name: urac1rac2-scan.manzoor.com, Network: 1/192.168.0.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /urac1rac2-scan.manzoor.com/192.168.0.28


-- As we see currently its running with 1 ip 192.168.0.28


1) Update the DNS server ip details on both the rac nodes.

[root@rhel11gr2rac1 ~]# vi /etc/resolv.conf

search manzoor.com
nameserver 192.168.0.30

[root@rhel11gr2rac2 ~]# vi /etc/resolv.conf

; generated by /sbin/dhclient-script
search manzoor.com
nameserver 192.168.0.30


2) Check whether the nslookup is returning the details properly.

[root@rhel11gr2rac2 ~]# nslookup urac1rac2-scan.manzoor.com
Server:         192.168.0.30
Address:        192.168.0.30#53

Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.28
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.29
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.27

[root@rhel11gr2rac2 ~]# nslookup urac1rac2-scan.manzoor.com
Server:         192.168.0.30
Address:        192.168.0.30#53

Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.29
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.27
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.28

[root@rhel11gr2rac2 ~]# nslookup urac1rac2-scan.manzoor.com
Server:         192.168.0.30
Address:        192.168.0.30#53

Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.27
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.28
Name:   urac1rac2-scan.manzoor.com
Address: 192.168.0.29

3) Remove the Scan entry from /etc/hosts file on all the nodes.

4) Stop the scan listener and scan.

[oracle@rhel11gr2rac1 bin]$ ./srvctl stop scan_listener
[oracle@rhel11gr2rac1 bin]$ ./srvctl stop scan


5) Modify scan as root user.

[root@rhel11gr2rac1 bin]# ./srvctl modify scan -n urac1rac2-scan.manzoor.com


[oracle@rhel11gr2rac1 bin]$ ./srvctl modify scan_listener -u

6) Start the Scan listener.

[oracle@rhel11gr2rac1 bin]$ ./srvctl start scan_listener

6) Check the status of the scan.

[oracle@rhel11gr2rac1 bin]$ ./srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rhel11gr2rac1
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node rhel11gr2rac2
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node rhel11gr2rac1

[oracle@rhel11gr2rac1 bin]$ ./srvctl config scan
SCAN name: urac1rac2-scan.manzoor.com, Network: 1/192.168.0.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /urac1rac2-scan.manzoor.com/192.168.0.28
SCAN VIP name: scan2, IP: /urac1rac2-scan.manzoor.com/192.168.0.29
SCAN VIP name: scan3, IP: /urac1rac2-scan.manzoor.com/192.168.0.27

[oracle@rhel11gr2rac1 bin]$ ./srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rhel11gr2rac1
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node rhel11gr2rac2
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node rhel11gr2rac1


-- Scan configuration has been completed.


Reference:- 

How to Modify SCAN Setting or SCAN Listener Port after Installation (Doc ID 972500.1)
Linux: How to Configure the DNS Server for 11gR2 SCAN (Doc ID 1107295.1)
How To Convert an 11gR2 GNS Configuration To A Standard Configuration Using DNS Only[Article ID 1489121.1
http://www.youtube.com/watch?v=XLcryY6Ndlg