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

📄 ch16.htm

📁 Teach yourself Oracle8 in 21 day
💻 HTM
📖 第 1 页 / 共 5 页
字号:
you prefer.</I></P>
<P>From this screen, choose Oracle8 Recovery Manager. This will bring up the Oracle
Recovery Manager's graphical interface, known as Backup Manager (see Figure 16.5).
This is Backup Manager's main screen. You might notice that this screen is similar
to some of the other Enterprise Manager applications. Because of the nature of the
backup-and-recovery process, this screen allows you to browse many of the Oracle
schema objects, such as

<UL>
	<LI>Control files
	<P>
	<LI>Tablespaces
	<P>
	<LI>Datafiles
	<P>
	<LI>Redo log groups
	<P>
	<LI>Archived logs
	<P>
	<LI>Channels
	<P>
	<LI>Jobs
</UL>

<P>Backup Manager also allows you to change the state of the instance. This is useful
if you want to shut down the instance in order to perform an offline backup.</P>
<P>After you have invoked Backup Manager, you must change the database connection
to use the remote user you have just set up. First, select Change Database Connection
from the File menu.This will invoke the Target Database Login screen, shown in Figure
16.6. From here you should change the login to select the username, password, and
service necessary to connect into the database you will be backing up.</P>
<P><A NAME="05"></A><A HREF="05.htm"><B>Figure 16.5.</B></A></P>
<P><I>The main screen of Backup Manager.</I></P>
<P><A NAME="06"></A><A HREF="06.htm"><B>Figure 16.6.</B></A></P>
<P><I>Change the login in the Target Database Login screen to connect to the database
you will be backing up.</I></P>
<P>Be sure that you have selected to connect as <TT>SYSDBA</TT>.</P>
<P>It is also necessary to select the connection to the recovery catalog that you
created earlier in this section. To do this, select the Catalog Connect String option
from the Catalog menu. This will invoke the Recovery Catalog Login screen, which
is very similar to its counterpart in Figure 16.6. This is where you select the username,
password, and service for the recovery catalog database. Remember that in a production
environment, the recovery catalog should be in a database other than the one you're
backing up.</P>
<P>Once you have set up the connections for the database and the catalog, you should
register the recovery catalog. You do this by selecting Register from the Catalog
menu, which will invoke a job to register the recovery catalog. After you have registered
the recovery catalog, you are ready to use Oracle Backup Manager.
<H4><FONT COLOR="#000077"><B>Running Backup Manager</B></FONT></H4>
<P>To invoke Backup Manager, use the procedures described in Figures 16.4 and 16.5.
After you have invoked the Backup Manager, you should select the Backup Wizard option
from the Backup menu.</P>
<P>If this is the first time you have run the Backup Manager, you will be informed
that you do not have any channels defined, as shown in Figure 16.7.</P>
<P><A NAME="07"></A><A HREF="07.htm"><B>Figure 16.7.</B></A></P>
<P><I>You see this message if this is the first time you have used Backup Manager.</I></P>
<P>The channels are actually I/O channels. The more channels you have defined, the
more parallelism you will achieve. In my case, because I am running on a small, single-processor
system, I will create only one channel. Give the backup channel a name and a destination
if you want the data to be backed up to disk. (See Figure 16.8.)</P>
<P><A NAME="08"></A><A HREF="08.htm"><B>Figure 16.8.</B></A></P>
<P><I>The Create Channel screen is used to create a backup channel.</I></P>
<P>After you have created at least one channel, you can proceed with the Backup wizard.
The first screen in the Backup wizard is the introduction (see Figure 16.9). Here
you select what type of backup you want to perform. The options are

<UL>
	<LI>Database backup
	<P>
	<LI>Tablespace backup
	<P>
	<LI>Datafiles backup
	<P>
	<LI>Archived logs only backup
</UL>

<P><A NAME="09"></A><A HREF="09.htm"><B>Figure 16.9.</B></A></P>
<P><I>You can select from several options in the Introduction screen of the Backup
wizard.</I></P>
<P>In the figure, I have selected to perform a database backup. The appearance of
the next screen varies based on the selection of the backup type. If you have chosen
Database, you will be asked whether you want to back up the archived logs. If you
have chosen Tablespace, you will be presented with a list of tablespaces to select
from, and if you have chosen Datafiles, you will be presented with a list of datafiles
to choose from. If you have chosen Archived logs Only, you will be given a range
of archived logs to back up.</P>
<P>For this illustration, the Database option has been selected. The Backup wizard
then proceeds to the next screen, where you will be asked whether you want to back
up the archived logs. I prefer to handle those separately, so I chose to back up
none of the archived logs. This is shown in Figure 16.10.</P>
<P><A NAME="10"></A><A HREF="10.htm"><B>Figure 16.10.</B></A></P>
<P><I>In the Archived logs screen of the Backup wizard, you choose whether you want
to back up any of the archive log files.</I></P>
<P>In the next screen of the Backup wizard, you will be prompted to select one or
more channels to back up to. Using more than one channel will increase the parallelism
of the backup. The Channels screen is shown in Figure 16.11.</P>
<P><A NAME="11"></A><A HREF="11.htm"><B>Figure 16.11.</B></A></P>
<P><I>Here you choose the channels to which you want to back up.</I></P>
<P>The next screen gives you some options that should be set. You should set the
tag to a meaningful name for the backup. If you are doing an incremental backup,
you can set the level of the backup here. This is shown in Figure 16.12.</P>
<P><A NAME="12"></A><A HREF="12.htm"><B>Figure 16.12.</B></A></P>
<P><I>Backup wizard--Backup Options. Here you select a tag to identify the backup
set.</I></P>
<P>The next screen is the Parameters screen. Here you can set the maximum files per
backup set, as shown in Figure 16.13. By setting this number, you force multiple
channels to be used. The more files per backup set, the more channels that will be
used.</P>
<P><A NAME="13"></A><A HREF="13.htm"><B>Figure 16.13.</B></A></P>
<P><I>The Backup wizard--Parameters screen allows you to set the maximum number of
files per backup set.</I></P>
<P>The next screen is the Schedule screen, which is very similar to the one you saw
in yesterday's lesson on job scheduling. You can set the backup to begin immediately
or at some time in the future, as shown in Figure 16.14.</P>
<P><A NAME="14"></A><A HREF="14.htm"><B>Figure 16.14.</B></A></P>
<P><I>In the Schedule screen of the Backup wizard, you specify whether you want the
backup to begin immediately or at some later time.</I></P>
<P>The last configuration screen for the Backup wizard is the Save/Submit screen.
With this screen, you can select to submit the backup, to save these parameters to
the library, or both, as shown in Figure 16.15. Typically you will submit at this
point.</P>
<P><A NAME="15"></A><A HREF="15.htm"><B>Figure 16.15.</B></A></P>
<P><I>The Backup wizard--Save/Submit screen allows you to either submit the job or
save the settings for later use.</I></P>
<P>After you have completed all the screens of the Backup wizard and clicked the
Finish button, you are presented with a summary of your selections, as shown in Figure
16.16.</P>
<P>Click OK to submit the backup job. Depending on the scheduling parameters you
have set, the backup might begin to execute immediately. This screen allows you only
to view the settings. No changes are allowed. If you find that the settings are in
error, you can cancel the job and start the process over again.</P>
<P><A NAME="16"></A><A HREF="16.htm"><B>Figure 16.16.</B></A></P>
<P><I>The Backup wizard's Summary screen shows you the options you've chosen for
your backup.</I></P>


<BLOCKQUOTE>
	<P>
<HR>
<BR>
	<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>At this point the backup has been
	submitted and will be completed. You can click the Jobs icon (refer to Figure 16.5)
	if you want to view the current progress of the job. From the Jobs screen you can
	also view the status of previous jobs and look at the job library. 
<HR>


</BLOCKQUOTE>

<H3><FONT COLOR="#000077"><B>Backing Up with OS Facilities</B></FONT></H3>
<P>Performing a backup with your OS facilities is a very straightforward process.
As with Backup Manager, you can perform a full database backup or a tablespace backup.
The basic process is different, depending on whether you will be performing an offline
backup or an online backup.
<H4><FONT COLOR="#000077"><B>Offline Backup</B></FONT></H4>
<P>The offline backup is perhaps the most straightforward and simplest backup method.
You perform an offline database backup by following these steps:

<DL>
	<DD><B>1.</B> Shut down the database normally.
	<P><B>2.</B> Back up all the datafiles, the control files, and the parameter file,
	using OS or third-party utilities.</P>
	<P><B>3. </B>Restart the database.
</DL>

<P>This is all there is to performing an offline database backup using OS facilities.
You can do this using either OS or third-party facilities. There are a number of
very good third-party backup utilities that include bar coding, catalog management,
and other features.
<H4><FONT COLOR="#000077"><B>Online Backup</B></FONT></H4>
<P>The online backup is not actually a full backup because each tablespace is backed
up separately. You can think of it as a set of online tablespace backups that make
up the entire database. To perform an online tablespace backup, follow this procedure:

<DL>
	<DD><B>1.</B> Mark the beginning of the tablespace backup using the SQL command
</DL>



<BLOCKQUOTE>
	<PRE><FONT COLOR="#0066FF">ALTER TABLESPACE tsname BEGIN BACKUP;</FONT></PRE>

</BLOCKQUOTE>

<PRE><FONT COLOR="#0066FF"></FONT></PRE>

<DL>
	<DD><B>2. </B>Back up the datafiles that constitute that tablespace using OS or third-party
	utilities.<BR>
	<B><BR>
	3.</B> Mark the end of the tablespace backup using the SQL command
</DL>



<BLOCKQUOTE>
	<PRE><FONT COLOR="#0066FF">ALTER TABLESPACE tsname END BACKUP;</FONT></PRE>

</BLOCKQUOTE>

<PRE><FONT COLOR="#0066FF"></FONT></PRE>
<P>When you mark the beginning of the backup, Oracle will divert writes from those
datafiles to the SGA until the backup has completed and you have marked the end of
the backup. This is all that is necessary to perform the online tablespace backup.
<H3><FONT COLOR="#000077"><B>Backing Up with Export</B></FONT></H3>
<P>The Export utility can also be used to perform system backups. Because this utility
is covered in the lesson on Day 9, &quot;Managing Data,&quot; it is not covered here.
<H3><FONT COLOR="#000077"><B>Backing Up with the NT Backup Utility</B></FONT></H3>
<P>Yet another way to back up the Oracle database (if you are running on an NT server)
is via the NT Backup utility. This utility comes with the Oracle8 Server for NT and
can only be used to back up the local database--you cannot use it to back up databases
remotely. The NT Backup utility is very easy to use. It is invoked through the Oracle
for NT program group.</P>
<P>Upon invoking the NT Backup Manager, you will be prompted to supply the <TT>INTERNAL</TT>
password.</P>
<P>The internal account will be used to perform the backup. Specifying this password
is all that is necessary to connect to the Oracle instance on your system. If you
are running in <TT>NOARCHIVELOG</TT> mode (which is not recommended), you will see
the screen shown in Figure 16.17, where a full offline backup is the only option.
This is because the full offline backup is the only option for a system running in
<TT>NOARCHIVELOG</TT> mode.</P>
<P><A NAME="17"></A><A HREF="17.htm"><B>Figure 16.17.</B></A></P>
<P><I>NT Backup Manager with only the option for a full offline backup.</I></P>
<P>When running in <TT>NOARCHIVELOG</TT> mode, the only option is to specify the
destination for the backup, either by typing it in or by using the Browse option.
If you are running in <TT>ARCHIVELOG</TT> mode (which is recommended because it makes
your system more recoverable), you will see the screen shown in Figure 16.18 where
a full offline backup, online tablespace backup, and online control file backup are
the available options.</P>
<P><A NAME="18"></A><A HREF="18.htm"><B>Figure 16.18.</B></A></P>
<P><I>NT Backup Manager with multiple options, because the system is running in <TT>ARCHIVELOG</TT>
mode.</I></P>
<P>Again you have the option to specify the destination for the backup, either by
typing it in or by using the Browse button. When you have selected the options you
want, simply click the Backup button and the backup will be performed.</P>
<P>The NT Backup Manager does not have the flexibility and performance of the Recovery
Manager and its graphical interface, Backup Manager, but for a small database it
is the ideal utility because of its simplicity and ease of use.</P>
<P>So far in this lesson, you have seen how to back up your system. Equally as important
is determining what to back up and how to schedule those backups. In the next section
you will learn how to develop a backup strategy and how to implement it.
<H2><FONT COLOR="#000077"><B>Backup Strategies</B></FONT></H2>
<P>Knowing how to back up a system is only one part of the process. Putting together
a backup-and-recovery plan or strategy is also very important. Many times you are
limited in the time allotted for backups and must be very creative. Remember that
your highest priority is to protect the data in your database.</P>
<P>In developing a backup-and-recovery strategy, you must first look at the parameters
of your system. Many variables affect the backup strategy and the backup process,
including

⌨️ 快捷键说明

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