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

📄 ch16.htm

📁 Teach yourself Oracle8 in 21 day
💻 HTM
📖 第 1 页 / 共 5 页
字号:
	<LI>Archive log file backup--A backup of the archive log files.
	<P>
	<LI>Control file backup--A backup of the control files.
	<P>
	<LI>Datafile backup--A backup of a single datafile.
	<P>
	<LI>Full backup--A backup of all datafiles and control files.
	<P>
	<LI>Tablespace backup--A backup of a single tablespace.
</UL>

<P>In this section you will learn how these backup types differ, which you need to
run, and how they complement each other.
<H3><FONT COLOR="#000077"><B>Archive Log Backup</B></FONT></H3>
<P>Because archive log files are continually being created, they are typically backed
up to offline storage. Because the archive log information can be quite large, it
is usually not feasible to keep this data online, but if possible you should keep
the archive log files online until a complete database backup is performed.</P>
<P>Remember, once a datafile is restored from backup, the archive log files that
were created since that backup was taken are applied to roll-forward transactions.
Archive log files older than the last backup are needed only if the restore operation
fails and an older backup needs to be used.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>TIP:</B></FONT><B> </B>A good procedure would be to save
	archive log files until the next datafile backup, and then archive them to tape or
	other archival storage. 
<HR>


</BLOCKQUOTE>

<P>While online, these archive log files need to be protected. I recommend keeping
your online archive log files on a RAID-protected disk volume or backing up the archive
log files to tape as soon as they are created. The loss of an archive log file could
mean that you can't recover your database in the event of a failure.</P>
<P>Another way to protect your archive log file is to use the Oracle archive log
duplexing feature. If you set the Oracle parameter <TT>LOG_ARCHIVE_DUPLEX_DEST</TT>,
a second copy of each archive log file will be created in this directory. This protects
the archive log files against any single point of failure.
<H3><FONT COLOR="#000077"><B>Control File Backup</B></FONT></H3>
<P>The control files are very important to the operation of the Oracle RDBMS because
they contain information about the physical construction of the database. If the
control file is lost, it might still be possible to re-create it, but it will be
very difficult.</P>
<P>On Day 8, &quot;Administering Redo Logs, Control Files, and Rollback Segments,&quot;
you learned how to back up control files using the <TT>ALTER DATABASE</TT> command.
The two options for the <TT>ALTER DATABASE </TT>database<TT> BACKUP CONTROLFILE</TT>
command are as follows:

<UL>
	<LI><TT>TO `</TT>filename<TT>'</TT> --This will create a new control file with the
	name specified by filename. If the file already exists, the optional <TT>REUSE</TT>
	qualifier must be used in order to overwrite it; otherwise you will get an error.
	<P>
	<LI><TT><BR>
	TO TRAC</TT>--The <TT>TO TRACE</TT> parameter optionally writes SQL to a trace file
	that can be used to re-create the control files. The SQL statements are complete
	enough to start up the database, re-create the control files, and recover and open
	the database appropriately.
</UL>

<P>Another option is to simply back up the control file(s) when performing operating-system
backups. If a control file is lost, it can be restored from that backup. The control
file(s) needs to be backed up any time there is a structural change to the database,
because such changes alter the control file.
<H3><FONT COLOR="#000077"><B>Full Backup</B></FONT></H3>
<P>A full backup occurs when the entire database and its associated control files
are backed up. A full backup can occur either offline or online. The best type of
backup to perform is the full offline backup because you get a consistent view of
the entire database, but for many systems this is not an option because little or
no downtime is allotted for backups.
<H4><FONT COLOR="#000077"><B>Full Offline Backup</B></FONT></H4>
<P>The full offline backup is sometimes called a <I>consistent whole database</I>
backup. The full offline backup is done when the database instance has been shut
down cleanly. With the database shut down, you back up the datafiles and control
files using OS or third-party backup software and hardware. If you have the downtime
available to you, the full offline backup is the best backup solution.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>Even though you have backed up the
	datafiles and the control files, you should only restore the control files if necessary.
	Never overwrite a newer control file with an older one unless there is no other alternative.
	
<HR>


</BLOCKQUOTE>

<H4><FONT COLOR="#000077"><B>Full Online Backup</B></FONT></H4>
<P>In many cases where systems need to be up and running 7 days a week, 24 hours
a day, the offline backup is not an option. In this situation, the online backup
is your only choice.</P>
<P>A full online backup is really just a combination of tablespace backups and control
file backups. With the full online backup, the control files and, in turn, each tablespace
are backed up using the online tablespace backup facility.


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>Online backups are valid only if
	you are running in <TT>ARCHIVELOG</TT> mode. If you are not running in <TT>ARCHIVELOG</TT>
	mode, your only choice is an offline backup. 
<HR>


</BLOCKQUOTE>

<H3><FONT COLOR="#000077"><B>Tablespace and Datafile Backups</B></FONT></H3>
<P>The tablespace backup allows you to back up a single tablespace while the database
is online and running. When the administrator signals the Oracle instance that a
backup will be performed on that tablespace, special actions are taken. Once the
tablespace has been marked for backup, one or more of the datafiles that make up
the tablespace are backed up using OS or third-party utilities.</P>
<P>When you mark the tablespace for backup, the Oracle RDBMS will know that this
online backup has occurred, and it will know how to recover the database if recovery
is necessary. In the next section you will learn the actual mechanics of how to perform
this type of backup.
<H2><FONT COLOR="#000077"><B>How to Back Up the Database</B></FONT></H2>
<P>With Oracle8 there are several different ways that the Oracle database can be
backed up. You can use any of the following:

<UL>
	<LI>Backup Manager/Recovery Manager
	<P>
	<LI>OS facilities
	<P>
	<LI>Export
	<P>
	<LI>The NT Backup utility
</UL>



<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>The new Oracle8 utility for backup
	and recovery is called <I>Recovery Manager</I>. The graphical utility provided with
	Enterprise Manager that uses Recovery Manager is called <I>Backup Manager</I>. You
	will see references to both Backup Manager and Recovery Manager. Keep in mind that
	both are essentially the same utility. 
<HR>


</BLOCKQUOTE>

<P>Each of these utilities can perform an effective backup. It is usually your own
personal preference that can help you decide which one to use.
<H3><FONT COLOR="#000077"><B>Backing Up with Backup Manager</B></FONT></H3>
<P>Backup Manager is invoked and runs through Enterprise Manager, and therefore can
be run either locally or remotely. Backup Manager is a graphical utility and fairly
easy to use.
<H4><FONT COLOR="#000077"><B>Setting Up Backup Manager</B></FONT></H4>
<P>Before Backup Manager can be used, the recovery catalog must be created. This
catalog can be created by using the following SQL statements:</P>
<PRE><FONT COLOR="#0066FF">SPOOL recovery.log
CREATE USER rman IDENTIFIED BY rman
TEMPORARY TABLESPACE temporary
DEFAULT TABLESPACE rcvcat QUOTA unlimited ON rcvcat;
GRANT recovery_catalog_owner TO rman;
CONNECT rman/rman
@d:\orant\rdbms80\admin\catrman
</FONT></PRE>


<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>The recovery catalog should be created
	in its own database. If the database you are backing up is damaged and contains the
	recovery catalog, the catalog will also be damaged. 
<HR>


</BLOCKQUOTE>

<P>The next step is to set up Oracle for remote administration so that Backup Manager
can connect in. The following steps must be taken to allow this to happen:

<DL>
	<DD><B>1.</B> Change directories to the <TT>orant\dbs</TT> directory.
	<P><B>2.</B> Save your existing password file (if you have one). It will be named
	<TT>orawp</TT>SID (where SID is your SID name).</P>
	<P><B>3.</B> Create a new password file with the following syntax:
</DL>



<BLOCKQUOTE>
	<PRE><FONT COLOR="#0066FF">ORAPWD80 file=orapwSID password=password entries=10</FONT></PRE>

</BLOCKQUOTE>

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

<DL>
	<DD><B>4.</B> Change or add this line to your <TT>init.ora</TT> file:
</DL>



<BLOCKQUOTE>
	<PRE><FONT COLOR="#0066FF">remote_login_passwordfile=exclusive</FONT></PRE>

</BLOCKQUOTE>

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

<DL>
	<DD><B>5.</B> Create the remote user with this syntax:
</DL>

<PRE></PRE>


<BLOCKQUOTE>
	<PRE><FONT COLOR="#0066FF">CREATE USER remote IDENTIFIED BY remote</FONT></PRE>

</BLOCKQUOTE>

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

<DL>
	<DD><B>6.</B> Grant the following to the remote user:
</DL>

<PRE></PRE>


<BLOCKQUOTE>
	<PRE><FONT COLOR="#0066FF">GRANT connect, resource TO remote;
GRANT sysdba TO remote;</FONT></PRE>

</BLOCKQUOTE>

<PRE><FONT COLOR="#0066FF"></FONT></PRE>
<P>After you have created the remote user, you must set up Backup Manager to use
these accounts. The first step is to start up Backup Manager. From Enterprise Manager,
select the Oracle Backup Manager. The first screen you will see is the Backup Manager--Subsystem
screen, as shown in Figure 16.4.</P>
<P><A NAME="04"></A><A HREF="04.htm"><B>Figure 16.4.</B></A></P>
<P><I>The Backup Manager--Subsystem screen allows you to choose which method of backup

⌨️ 快捷键说明

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