📄 ch16.htm
字号:
<P>RAID-0 is the base RAID level and is used to describe disk striping with no fault
Figure 16.2.</P>
<P><A NAME="02"></A><A HREF="02.htm"><B>Figure 16.2.</B></A></P>
<P><I>RAID level 0 has no fault tolerance.</I></P>
<P>tolerance. RAID-0 drives simply have data striped over all the drives, as shown
in Figure 16.2.</P>
<P>RAID-0 is the highest-performing and most economical of the RAID levels. The amount
of data in the logical volume is equal to the sum of the amount of data on each disk
drive. RAID-0 causes no additional I/O to be generated on behalf of the fault-tolerant
method.</P>
<P>The downside of RAID-0 is that if a disk were to fail, the entire volume would
become invalid. Because the data in the logical volume is striped across all the
disks, the loss of a single disk causes a loss of data throughout the logical volume.
If a 14-disk volume fails, you must restore the data for all 14 disk drives. There
is no way to back up and restore data for a single drive in a disk array.</P>
<P>If you are looking for the highest performance and the best value possible and
are not worried about fault tolerance, this is the RAID level you should use.</P>
<P><FONT COLOR="#000077"><B>RAID-1</B></FONT></P>
<P>The RAID-1 level is also known as <I>disk mirroring</I>. In RAID-1, all the data
stored on a disk drive is duplicated on another disk in the array. Each time a write
occurs to the logical disk, the data must be written to <I>both</I> physical disks
before the logical write is considered completed. With disk mirroring, a single disk
is mirrored to another disk; these disks can also be striped with other disks to
form a larger logical volume, as shown in Figure 16.3.</P>
<P><A NAME="03"></A><A HREF="03.htm"><B>Figure 16.3.</B></A></P>
<P><I>RAID level 1 is also called disk mirroring.</I></P>
<P>Because the mirroring is on a one-to-one basis, you can actually lose half the
disks in your system (depending on which disks they are) and still be operational.
With most disk array controllers, you can split the mirror across SCSI buses. This
arrangement allows for the failure of an entire SCSI bus (for example, a cabinet
failure) without affecting operation.</P>
<P>With disk mirroring, you can use only half the disks in the system (the other
half are used for the mirrors). In other words, if you use disk mirroring with two,
2.1GB disks, you can use only 2.1GB of space. When writing, you get the benefit of
only one disk in terms of performance, because a logical write invokes two physical
writes.</P>
<P>Under certain conditions, you will see a benefit from reading from mirrored drives.
Some disk array controllers support <I>split-reads</I>, in which reads can occur
simultaneously on different mirrored drives to different data. The disk with the
heads closest to the requested data retrieves the data. Depending on your data-access
methods, this feature might or might not provide any benefits to you.</P>
<P>If you can afford the cost of disk mirroring, RAID-1 is the best choice when fault
tolerance is required. With disk mirroring, you achieve the highest level of protection
as well as the fastest disk access possible for a fault-tolerant volume.</P>
<P><FONT COLOR="#000077"><B>RAID-2</B></FONT></P>
<P>RAID level 2 is data striping that is protected by a method known as <I>hamming
code</I> that is similar to the method used in error detection and correction in
RAM. Because of the difficulty in implementing RAID-2, it has not been widely accepted.</P>
<P><FONT COLOR="#000077"><B>RAID-3</B></FONT></P>
<P>RAID level 3 uses a parallel-access parity RAID configuration. RAID-3 stores data
and parity on a several disks using a bit-by-bit parity. RAID-3 uses a parallel access
method to achieve high performance but requires that the individual disk rotations
be synchronized, which may be difficult. RAID-3 is not widely used.</P>
<P><FONT COLOR="#000077"><B>RAID-4</B></FONT></P>
<P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>RAID level 4 is known as
<I>drive parity</I>, or <I>data guarding</I>. In RAID-4, one of four drives is used
for data parity. If any one of the four disks fails, the other three continue running.
Because the algorithms used in RAID-4 are considered obsolete, RAID-4 is not used
much. RAID-4 has essentially been replaced by RAID-5.</P>
<P>When you use RAID-4, a lot of I/O is generated. To calculate the parity, RAID-4
reads data from all the drives in the set. As you can imagine, the overhead involved
with RAID-4 is very high.</P>
<P><FONT COLOR="#000077"><B>RAID-5</B></FONT></P>
<P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>RAID-5 is also known as <I>distributed
data guarding</I>. In distributed data guarding, enough information is stored about
each drive so that any one drive in the set can fail; the data is restored by using
all the other drives. The space you get from RAID-5 is equal to the following:</P>
<P>Drive Space = (<I>N</I>-1) * Drive Size</P>
<P>In this equation, <I>N</I> is the number of drives in the logical volume. In other
words, if you are running 12 disk drives with RAID-5, you get the space of 11 disk
drives.</P>
<P>As with RAID-4, there is a penalty associated with RAID-5. For each write to disk,
two reads take place, a calculation of the parity is done, and then two writes are
done. Although a read generates only one I/O, a write generates four I/Os.</P>
<P><FONT COLOR="#000077"><B>RAID-6</B></FONT></P>
<P>RAID-6 is almost identical to RAID-5 but with the addition of an independently
computed data check. This makes the RAID-6 volume very secure, with extremely high
data availability because of the addition of one extra disk for this additional fault
tolerance. Thus, with RAID-6 the cost is</P>
<P>Drive Space = (<I>N</I>-2) * Drive Size</P>
<P><FONT COLOR="#000077"><B>Other RAID Levels</B></FONT></P>
<P>You might see other RAID levels mentioned that are a combination of these RAID
levels. Some vendors call a combination of RAID-0 (striping) and RAID-1 (mirroring)
a RAID-10 or RAID-0+1 array.
<H4><FONT COLOR="#000077"><B>Caching RAID Controllers</B></FONT></H4>
<P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>Write caches are designed
to cache the writes written to the controller and to post the I/O request to the
disk driver. <I>Posting the request</I> means that the device driver believes the
I/O is completed. Posting the write allows the overhead associated with queuing the
request and writing it to the individual disk to be masked. All the OS and the RDBMS
see is an incredibly fast write and can continue with their operations as though
the data had been completely written out to disk.
<BLOCKQUOTE>
<P>
<HR>
<FONT COLOR="#000077"><B>WARNING:</B></FONT><B> </B>Unless the write cache is protected,
it is not usually recommended that write-caching be enabled on the redo log volume.
If the RDBMS believes a write to have occurred to the redo log, and a controller
failure occurs before that data has actually been written to the disk drives, you
might not be able to recover the instance.
<HR>
</BLOCKQUOTE>
<P>Some disk array controllers have incorporated both mirroring or parity and a battery
backup into the write cache to ensure the data is protected even in the event of
a power outage. Use your own judgment about running a write cache on the redo log
volumes.
<H3><FONT COLOR="#000077"><B>Protecting the System</B></FONT></H3>
<P>If you use RAID technology, there are essentially three modes in which you can
run your database:
<UL>
<LI>No data protection--Fault tolerance is not used on any of the logical volumes.
<P>
<LI>Full data protection--Fault tolerance is used on all the volumes.
<P>
<LI>Partial data protection--Fault tolerance is used on some of the volumes and not
on others.
</UL>
<P>Although disk drives have become much more reliable in the past few years, they
are still the component most likely to fail. Disk drives are susceptible to failure
because they are mostly mechanical devices.</P>
<P>Disks are made up of sophisticated electronics and motors. Forces such as heat,
dust, and friction can cause even the most well-built disk drive to fail. No matter
how well you take care of your system, it is inevitable that you will one day see
a disk failure.
<BLOCKQUOTE>
<P>
<HR>
<FONT COLOR="#000077"><B>TIP:</B></FONT><B> </B>Depending on the size and critical
nature of your database, a failure of one disk can be devastating if you are not
protected. When taking into account your budget for fault-tolerant components, keep
in mind the cost of extended downtime that results from a failure.
<HR>
</BLOCKQUOTE>
<H4><FONT COLOR="#000077"><B>No Data Protection</B></FONT></H4>
<P>In No Data Protection mode, no fault tolerance is used and the data is completely
unprotected. Any disk failure causes you to reload all the affected files from the
last backup.</P>
<P>If the failure occurs on a data volume, you can restore the data (if you are running
in <TT>ARCHIVELOG</TT> mode, you can use the archive log files to restore the database
up to the point of failure). Even so, when a disk drive fails, you must restore the
entire <I>volume</I>, which might mean tens of gigabytes of data.</P>
<P>If the failure occurs on the volume containing your redo log files, you can recover
only up to the last good archived log file. At instance recovery, you can recover
only up to the point at which the LGWR started writing to the damaged log file(s).</P>
<P>If the failure occurs on the volume containing the OS and Oracle binaries, you
must restore from a backup or reinstall the operating system, reload Oracle, and
then restart Oracle.</P>
<P>As you can see, in each of these unprotected situations, the recovery interval
can be quite long. No failure of an unprotected system is easy to recover from.
<H4><FONT COLOR="#000077"><B>Full Data Protection</B></FONT></H4>
<P>Full Data Protection mode is by far the most secure option. If you have fault
tolerance on every disk drive in the system, any single failure does not cause a
system failure. Depending on the level of fault tolerance you run, many multidisk
failures can be tolerated. The level of fault tolerance you run depends on the performance
you require and the budget you have.</P>
<P>In the last few years, the cost of disk drives has dropped so dramatically that
it is not unusual to see entire systems run with disk mirroring. The cost of the
extra drives needed to support fault tolerance usually outweighs the cost incurred
by extended downtime.</P>
<P>In assessing the level of fault tolerance, look at your required I/O rates. If
possible, use RAID-1 because it gives the best performance. If RAID-1 is not in your
budget, perhaps you can use it for at least your OS and redo log volumes. (The redo
log volumes usually demand the highest protection available.)
<H4><FONT COLOR="#000077"><B>Partial Data Protection</B></FONT></H4>
<P>Another option for protecting your data is to apply fault tolerance to specific
pieces of critical data. This might be the best option if you have a limited budget
and require high performance.</P>
<P>Critical areas that should be protected are the OS, the redo logs, and the archive
logs. If these areas are protected and a drive volume fails, you will not have to
spend extra time restoring or reloading the operating system. If the redo log volumes
are not protected and a drive fails, you might not be able to recover your database
to the point of failure. If the archive files are not protected and a drive fails,
you will not be able to recover from a data loss failure if that archive log file
is needed for recovery.</P>
<P>By using partial fault tolerance, you might be able to reduce downtime in the
event of a failure and still keep within your budget. Protecting areas such as the
OS volumes and redo log volumes will help you reduce the amount of time needed to
recover.
<BLOCKQUOTE>
<P>
<HR>
<B>Fault Tolerance Summary</B>
</BLOCKQUOTE>
<DL>
<DD>The component in your system most likely to fail is a disk drive because it is
a heavily used mechanical device. To avoid extended downtime, it is wise to employ
some type of fault tolerance. The extent to which you protect your data depends on
your uptime requirements, performance requirements, and budget.
<P>Depending on your needs, you might not have to completely protect all your data,
but <I>some</I> fault tolerance is recommended. If it is too expensive to protect
all your disks, protect at least the critical areas. Depending on your needs, you
might want to use different data-protection modes on different volumes. Here are
a few suggestions about fault tolerance for you to consider:
</DL>
<UL>
<LI>Fully protect your OS and Oracle binaries using RAID-1 or RAID-5. This level
of protection is worth the cost of the extra disks because you avoid reloading the
OS and Oracle.
<LI>Fully protect the redo log files. If possible, put each redo log file on a separate
mirrored volume. By separating the redo log files, you maintain the sequential nature
of the I/Os generated by the LGWR even when archiving.
<LI>Fully protect the archive log files. This does not have to be high-performance
fault tolerance as you have with the redo logs; it can be done using RAID-5.
<LI>Use RAID-5 on read-intensive volumes. The performance degradation experienced
when using RAID-5 occurs only on writes. If the volume is mainly used for reads,
very good performance can be achieved with RAID-5.
</UL>
<DL>
<DD>The amount and type of fault tolerance you employ depends on your specific requirements.
If you cannot permit any downtime, you must protect yourself against disk failures.
<HR>
</DL>
<H3><FONT COLOR="#000077"><B>Configuration Recommendations</B></FONT></H3>
<P>I would recommend that you employ some sort of fault tolerance on your system.
At the very least, use mirroring on your OS volume as well as on the Oracle binaries,
control files, and redo log files. This will allow you to reduce the amount of downtime
that you would suffer in the event of a system failure. The worst-case scenario would
be to have to reinstall an operating system, reinstall Oracle, rebuild the database,
and then restore. This scenario calls for maximum downtime. By carefully configuring
your system, downtime can be reduced.
<H2><FONT COLOR="#000077"><B>Types of Backups</B></FONT></H2>
<P>There are a variety of options available for backing up the Oracle database. Each
option provides a different amount of protection and typically causes a different
amount of downtime. The options are as follows:
<UL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -