⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch17.htm

📁 Teach yourself Oracle8 in 21 day
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<DL>
	<DD><B>1.</B> As with NT Backup Manager, the first step in invoking NT Recovery Manager
	is to supply the password for the internal account.
	<P><B>2.</B> After you supply the password for the internal account and connect with
	the instance, you will see NT Recovery Manager's first screen. This screen, shown
	in Figure 17.7, lists the following recovery options:
</DL>


<UL>
	<LI>Automatic recovery
	<P>
	<LI>Restore from full database backup
	<P>
	<LI>Restore datafile, then do recovery (supply the name of the datafile)
	<P>
	<LI>Restore control file, then do recovery
</UL>

<P><A NAME="07"></A><A HREF="07.htm"><B>Figure 17.7.</B></A></P>
<P><I>Oracle Recovery Manager offers a variety of recovery options.</I></P>

<DL>
	<DD><B>3. </B>The screen you see after selecting an option and clicking Recover depends
	on what option you select. In this case, I have selected the Restore datafile option
	and specified the filename <TT>\DATABASE\DOGS\DBF</TT>. Consequently, I am presented
	with the Data File Recovery screen shown in Figure 17.8.
	<P><B>4. </B>After you specify which datafiles to recover, NT Recovery Manager automatically
	recovers them for you. If instance recovery is necessary, it is performed as well.
</DL>

<P><A NAME="08"></A><A HREF="08.htm"><B>Figure 17.8.</B></A></P>
<P><I>The Data File Recovery screen of NT Recovery Manager.</I></P>
<P>
<H3><FONT COLOR="#000077"><B>The Log File Recovery</B></FONT></H3>
<P>You cannot restore from the loss of a log file. If a log file is damaged and the
system is still functional, you can drop the log file, re-create it, and immediately
perform a full backup. The backup is necessary because you will not be able to use
the archive and redo log files for any recovery on this database. That is why I always
recommend that redo log files reside on fault-tolerant disk volumes.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>I recommend using RAID mirroring
	on the redo log files to protect them in the event of a disk failure. 
<HR>


</BLOCKQUOTE>

<H3><FONT COLOR="#000077"><B>The Point-in-Time Recovery</B></FONT></H3>
<P>The point-in-time recovery allows you to recover a database back to a specified
point in time, allowing you to recover from user errors or software problems that
caused a failure to occur. However, because of the potential side effects, the point-in-time
recovery, a somewhat complex operation, should be performed only on rare occasions.
When you recover back to a point in time, the entire database will be recovered to
that point. If a table is deleted by accident and the point-in-time recovery is being
used to recover to a point just before that deletion, you must keep in mind that
all other work to other tables that occurred after that point will be lost.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>WARNING:</B></FONT><B> </B>The point-in-time recovery can
	be dangerous to use, because you are restoring to a point in time in the past. Always
	perform a full backup of your current database before attempting the point-in-time
	recovery. A point-in-time recovery recovers the entire database to that point in
	time. There is no way to recover a single tablespace or table, so all work done after
	that point to other tables will be lost. 
<HR>
</P>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>I have mentioned the point-in-time
	recovery only so that you will know it exists. If you plan to use the point-in-time
	recovery, you should study the Oracle documentation and carefully plan a restore
	before you attempt it. 
<HR>


</BLOCKQUOTE>

<P>The point-in-time recovery can be performed via Recovery Manager or via the <TT>RECOVER</TT>
administrative SQL command. In either case, the syntax for performing the point-in-time
recovery is entered through the command-line interface; there is no GUI option for
the point-in-time recovery.</P>
<P>What method you use to restore your data depends on what type of error necessitated
the recovery. In the event of a media failure, you must restore the datafile, then
perform the media recovery with the point-in-time recovery option. In the event of
a user error, follow these steps:

<DL>
	<DD><B>1.</B> Create a temporary copy of the database.
	<P><B>2.</B> Restore this temporary database from a previous backup.</P>
	<P><B>3. </B>Specify a point in time immediately before the failure, then perform
	the point-in-time recovery on this temporary database.</P>
	<P><B>4.</B> Export the table that has been damaged, which now is in a state just
	before the damage.</P>
	<P><B>5. </B>Import that undamaged table to the real database.
</DL>

<P>This task can be time consuming and dangerous. If you confuse the temporary and
real copies of the database, you might destroy valuable data.
<H4><FONT COLOR="#000077"><B>Point-in-Time Recovery Using Recovery Manager</B></FONT></H4>
<P>Recovery Manager can be used to perform a point-in-time recovery via its command-line
syntax. Because of the complexity of the command-line interface to Recovery Manager
and the rarity of its use, I will not go into great detail on how to use it here.
You can find very complete documentation in the Oracle Backup and Recovery manual.</P>
<P>When using the command-line interface to Recovery Manager, you must specify this
additional parameter:</P>
<PRE><FONT COLOR="#0066FF">SET UNTIL
</FONT></PRE>
<P>This parameter takes the following qualifiers:</P>
<PRE><FONT COLOR="#0066FF">TIME date
LOG SEQ number THREAD number
SCN scn
</FONT></PRE>
<P>With this syntax, you can specify the exact time you want the recovery to stop
by specifying the time, the log sequence, or the system change number. By using the
<TT>SET UNTIL</TT> parameter when performing a recovery via Recovery Manager, you
restore until the specified time.
<H4><FONT COLOR="#000077"><B>Point-in-Time Recovery Using the </B>RECOVER<B> Command</B></FONT></H4>
<P>When you perform a recovery with the <TT>RECOVER</TT> command, you can restore
to any point in time by using the <TT>RECOVER UNTIL</TT> syntax. The <TT>RECOVER</TT>
command has a number of options, but the important ones for the point-in-time recovery
are

<UL>
	<LI><TT>RECOVER UNTIL CANCEL</TT>
	<P>
	<LI><TT>RECOVER UNTIL TIME</TT>date
	<P>
	<LI><TT>RECOVER UNTIL CHANGE</TT>scn
</UL>

<P>Like Recovery Manager, the <TT>RECOVER</TT> command can be used to recover a database,
a tablespace, or a datafile, and can include a parallel clause. If you increase the
degree of parallelism, you might see a performance benefit.
<H2><FONT COLOR="#000077"><B>Developing a Recovery Strategy</B></FONT></H2>
<P>It is important that you plan your recovery strategy so that in the event of a
system failure you will be ready. Several scenarios must be planned for, depending
on the type of failure.
<H3><FONT COLOR="#000077"><B>Instance Failure: Planning for Instance Recovery</B></FONT></H3>
<P>Except for requiring you to set the degree of parallelism, the instance-recovery
process is automatic; it requires no operator intervention. Therefore, your planning
should concentrate on the parallel recovery option. Evaluate your system to determine
the degree of parallelism for the recovery process. This is set as the Oracle initialization
parameter <TT>RECOVERY_PARALLELISM</TT>.</P>
<P>The number of disk drives and CPUs typically determines the degree of parallelism
in your system. My rule of thumb is to use one process (thread) for every two disk
drives, up to 20. Try starting with a number like this, and adjust it to suit your
system. Because every system is different, it is difficult to make across-the-board
recommendations. If you set this number too high, you might cause additional overhead.
<H3><FONT COLOR="#000077"><B>Hardware Failure: Planning for Media Recovery</B></FONT></H3>
<P>When you plan for media recovery, you must consider not only the steps required
to recover the damaged media, but the restoration of data as well. Some of the key
items necessary for quick media recovery include

<UL>
	<LI>Hardware availability--Most system vendors offer hot-swappable disk drives. A
	failed disk drive need only be replaced with the same type disk in order to start
	automatic recovery. For this reason, you should keep spares available.
	<P>
	<LI>Backup files--Backup files should be kept until subsequent backups have been
	completed and verified. If you make these files available on the system or on a network
	drive, you can perform quick media recovery.
	<P>
	<LI>Archived log files--Any archived log files created since the last backup should
	be kept available on the system itself or on a network server until the next backup
	occurs.
</UL>

<P>If downtime is not an option, consider using a fault-tolerant disk subsystem.
You can avoid considerable downtime by protecting your disk drives with a RAID disk
array.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>TIP:</B></FONT><B> </B>The component in your system that
	is most likely to fail is probably a disk drive. The more disk drives you have in
	your system, the more likely one will fail. By protecting your disk drives with hardware
	or software RAID, you can avoid considerable downtime. 
<HR>


</BLOCKQUOTE>

<H3><FONT COLOR="#000077"><B>Planning for Operator Error Recovery</B></FONT></H3>
<P>Recovering from operator error is similar to recovering from media failure, except
with operator error recovery you might need a large amount of disk space to temporarily
recover your database. Fortunately, users can typically continue working on the permanent
database unless their duties require them to access the table(s) that was deleted
or corrupted. To recover, you need the following components:

<UL>
	<LI>Backup files
	<P>
	<LI>Archived log files
	<P>
	<LI>Large temporary space
</UL>

<H2><FONT COLOR="#000077"><B>Summary</B></FONT></H2>
<P>Today you learned how to recover from various types of system failures. You learned
how instance, media, and point-in-time recoveries work. You also learned how to recover
from an operator error. You learned the importance of planning ahead to reduce downtime;
in most businesses, downtime can be very expensive.
<H2><FONT COLOR="#000077"><B>What's Next?</B></FONT></H2>
<P>On Day 18, &quot;Administering Oracle Replication,&quot; you will learn how to
use Oracle replication to increase performance and quicken recovery. You will also
learn about other Oracle options for quick recovery, including the standby database
option. These features do not provide fault tolerance, but do help you to come back
online quickly.
<H2><FONT COLOR="#000077"><B>Q&amp;A</B></FONT></H2>

<DL>
	<DD><B>Q What is the difference between restoring and recovering?</B>
	<P><B>A</B> Restoring involves copying a backup file to replace a damaged datafile,
	whereas recovery involves Oracle using the transaction log to roll forward transactions.</P>
	<P><B>Q What is the difference between instance recovery and media recovery?</B></P>
	<P><B>A</B> With instance recovery, Oracle automatically rolls forward committed
	transactions to bring the database up to date; media recovery requires a damaged
	datafile to be replaced with a backup copy before commencing.</P>
	<P><B>Q What is an in-flight transaction?</B></P>
	<P><B>A</B> This term is sometimes used to describe a transaction that was in the
	process of execution when a failure occurred.</P>
	<P><B>Q What Oracle utility is needed to restore from an export file?</B></P>
	<P><B>A</B> An export file can only be restored with the Import utility.
</DL>

<H2><FONT COLOR="#000077"><B>Workshop</B></FONT></H2>
<P>The workshop provides quiz questions to help you solidify your understanding of
the material covered and exercises to provide you with experience in using what you've
learned. See Appendix A, &quot;Answers,&quot; for the answers to quiz questions.
<H3><FONT COLOR="#000077"><B>Quiz</B></FONT></H3>

<DL>
	<DD><B>1.</B> What types of recovery operations are there?
	<P><B>2.</B> What transactions are recovered from an instance failure?</P>
	<P><B>3.</B> What transactions can be recovered from media failure?</P>
	<P><B>4. </B>What is <TT>ARCHIVELOG</TT> mode?</P>
	<P><B>5. </B>What is a dirty buffer?</P>
	<P><B>6.</B> What is a checkpoint?</P>
	<P><B>7. </B>What files are necessary for instance recovery?</P>
	<P><B>8.</B> What files are necessary for media recovery?</P>
	<P><B>9.</B> What is a point-in-time recovery?</P>
	<P><B>10.</B> What is a point-in-time recovery used for?
</DL>

<H3><FONT COLOR="#000077"><B>Exercises</B></FONT></H3>

<DL>
	<DD><B>1.</B> Using Backup Manager, restore the tablespace you backed up yesterday.
	<P><B>2.</B> Using NT Recovery Manager, restore the tablespace you backed up yesterday.</P>
	<P><B>3. </B>On a small test system, use the <TT>SHUTDOWN ABORT</TT> command to abort
	an Oracle instance. (Do not do this on a production system or one that others are
	using.)</P>
	<P><B>4.</B> Restart the instance and observe the recovery process; try this again
	with a larger degree of parallelism. (<FONT COLOR="#000077"><I>NOTE:</I></FONT> You
	must perform some transactions for recovery to have activity.)
</DL>

<CENTER>
<P>
<HR>
<A HREF="../ch16/ch16.htm"><IMG SRC="../buttonart/previous.gif" WIDTH="128" HEIGHT="28"
ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch18/ch18.htm"><IMG
SRC="../buttonart/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"
BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../buttonart/contents.gif" WIDTH="128"
HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> <BR>
<BR>
<BR>
<IMG SRC="../buttonart/corp.gif" WIDTH="284" HEIGHT="45" ALIGN="BOTTOM" ALT="Macmillan Computer Publishing USA"
BORDER="0"></P>

<P>&#169; <A HREF="../copy.htm">Copyright</A>, Macmillan Computer Publishing. All
rights reserved.
</CENTER>


</BODY>

</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -