Wednesday, February 3, 2016

Oracle and RAID

source1
source2

RAID LevelDescription
NoneAny RAID operation involves a certain management overhead so if your requirement is for optimum write speed and no data protection you may choose to avoid RAID.
0This RAID level provides automatic block level striping of data across multiple disks to balance the load across the disk array. It provides no protection from data loss!
1This RAID level is also known as disk mirroring. The RAID controller keeps a complete copy of each disk on at least one other disk. In the event of a disk failure the RAID controller switches to one of the mirrors to prevent system failure. Double or tripple mirroring can be used to provide increased levels of security.
0+1As the name suggests this is a combination of RAID 0 and RAID 1, providing the benefits of block level striping across the array and the security of disk mirroring. The striping occurs across disks and the entire set is mirrored. If you can't do 1+0, this is the best RAID option for Oracle.
1+0 or 10As the name suggests this is a combination of RAID 1 and RAID 0. This sounds like it should be the same as 0+1, but it is subtly different. Each disk is mirrored individually and striping occurs across all the mirrored pairs. This is the best RAID for Oracle.
5This RAID level stripes data and parity information across 3 or more disks. The parity information, which is always stored on a separate disk to its corresponding data, allows the contents of lost blocks to be derived. The significant write overhead associated with this RAID level make it slower than the previous methods, especially when a disk failure occurs, but it requires far fewer disks so it is very cost effective. In the past people have avoided RAID 5 for database applications but improvements in disk speed and controller performance mean that it is a viable solution for datafiles if performance is not a consideration.

Oracle RAID Usage

So we know what the different RAID levels do, but which level should be use for Oracle? The answers are not carved in stone but here are some suggestions, with the RAID levels listed in order of preference.
File TypePreferred RAID LevelComments
Control FilesRAID 1+0,
RAID 0+1,
RAID 0,
No RAID
Control files are updated constantly so the quicker they can be accessed the better. Multiple control files should always be used whether you use RAID or not. When using no RAID or RAID 0 it is up to you to make sure that at least one copy of the control file is always available.
Online Redo LogsRAID 1+0,
RAID 0+1,
RAID 0,
No RAID
Similar access requirements to control files. Once again, the redo logs should always be multiplexed whether you use RAID or not.
Temporary DatafilesNo RAID,
RAID 0
The main requirement here is rapid access, not reliability. If the datafile is lost it can simply be recreated as there is no data to restore.
Archived Redo LogsRAID 1+0,
RAID 0+1,
RAID 0,
No RAID
Always multiplex these, even when using RAID, if you can afford the space. If space is an issue, rely on RAID to provide redundancy. It's dangerous to use no RAID or RAID 0 without manually multiplexing them. If you lose archived redo logs you may have compromised your backup and recovery.
Rollback/Undo DatafilesRAID 1+0
RAID 0+1
These files require constant I/O and must be protected. They cannot be mutliplexed by Oracle so let the hardware do it for you.
DatafilesRAID 1+0
RAID 0+1
or RAID 5
Datafiles with heavy I/O requirements should use RAID 1+0 (or 0+1). It is the fastest and most secure option.
If price is more of a consideration than performance, you can consider RAID 5. Most I/O operations to datafiles are buffered, with the physical writes happening in the background. As a result RAID 5 can be used to reduce costs without a significant impact on low performance systems.

RAID and ASM

Automatic Storage Manager (ASM) is Oracle's preferred solution to provide Stripe And Mirror Everything (SAME) storage. Even though ASM can provide double or triple mirroring, Oracle recommend hardware RAID is used in preference to ASM mirroring. As such, all LUNs presented to ASM are protected by hardware RAID, so ASM disk groups are defined using external redundancy and no failure groups.
The Recommendations for Storage Preparation documentation provide some helpful pointers, including some of the following:
  • In most cases you will only need two disk groups (DATA and FRA), where DATA holds all database related files and FRA holds the fast recovery area, including multiplexed copies on online redo logs and controlfiles. Typically, the FRA disk group will be twice the size of the DATA disk group, since it must hold all backups.
  • Oracle recommend a minimum of 4 LUNs per disk group, with LUNs using hardware RAID and external redundancy if possible. In this case, ASM still stripes across all LUNS, but it relies on hardware RAID to provide the mirroring.
  • All LUNs within a disk group should be the same size and have the same performance characteristics. So don't mix LUNs of different RAID levels within a disk group.
  • LUNs should be made up from disks dedicated to Oracle, not shared with other applications.

Conclusion

As most Oracle DBAs know, rules of thumb can be misleading but here goes:

  • If you can afford it, use RAID 1+0 for all your Oracle files and you shouldn't run into too many problems. If you are using ASM, use this RAID level for all LUNs presented to ASM.
  • To reduce costs move datafiles with lower access rates to RAID 5. If you are using ASM, this may mean defining multiple disk groups to hold different files.
  • To reduce costs further move the other datafiles to RAID 5.
  • To reduce costs further experiment with moving redo logs and rollback/undo tablespaces to RAID 5. Pick the combinations that work best for your system.
  • If cost dictates it, move all your Oracle files on to RAID 5.

2 comments: