Sunteți pe pagina 1din 7

RMAN TUTORIALS An RMAN channel represents one stream of data to a device type and corresponds to one server session.

Allocation of one or more RMAN channels is necessary to execute most ac!up and recovery commands. As illustrated in "i#ure$ each channel esta lishes a connection from the RMAN executa le to a tar#et or auxiliary data ase instance y startin# a server session on the instance. The server session performs the ac!up$ restore$ and recovery operations. Only one RMAN session communicates %ith the allocated server sessions.

&ou can either allocate channels manually %ithin a RUN loc!$ or preconfi#ure channels for use in all RMAN sessions usin# automatic channel allocation. RMAN comes preconfi#ured %ith a DISK channel that you can use for ac!ups and copies to dis!. &ou can also run the CONFIGURE CHANNEL command RMAN to specify automatic channels to dis! or tape. In this %ay$ you do not have to allocate channels every time you perform a ac!up$ restore$ or recovery operation. 'hen you run a command that re(uires a channel$ and you do not allocate a channel manually$ then RMAN automatically allocates the channels usin# the options specified in the CONFIGURE command. "or the BACKUP command$ RMAN allocates only a sin#le type of channel$ such as DISK or sbt. "or the RESTORE command and the various maintenance commands )for example$ DELETE*$ RMAN determines %hich device types are re(uired$ and allocates all necessary channels. If you specify channels manually$ then the ALLOCATE CHANNEL command )executed only %ithin a RUN command* and ALLOCATE CHANNEL FOR MAINTENANCE command )executed only at the RMAN prompt* specify the

type of I+O device that the server session %ill use to perform the ac!up$ restore$ or maintenance operation. Unless you manually run an ALLOCATE CHANNEL command$ RMAN allocates automatic channels accordin# to the settin#s in these commands,

CONFIGURE DEVICE TYPE ... PARALLELISM CONFIGURE DEFAULT DEVICE TYPE CONFIGURE CHANNEL DEVICE TYPE CONFIGURE CHANNEL n DEVICE TYPE

"or example$ you can issue the follo%in# commands at the RMAN prompt, BACKUP DATAFILE 3; RUN { RESTORE TABLESPACE use s; ! RMAN automatically allocates channels accordin# to values set %ith the CONFIGURE command in the follo%in# cases,

&ou use commands such as BACKUP$ RESTORE$ or DELETE outside of a RUN loc!. &ou use commands %ithin a RUN loc! ut do not allocate any channels %ithin the RUN loc!.

&ou can override automatic channel allocation settin#s y manually allocatin# channels %ithin a RUN loc!. &ou cannot mix automatic and manual channels$ so manual channels al%ays override automatic channels. "or example$ you override automatic channel allocation %hen you issue a command as follo%s, RUN { ALLOCATE CHANNEL "# DEVICE TYPE sbt; BACKUP DATABASE PLUS ARCHIVELOG; ! RMAN internally handles paralleli-ation of BACKUP$ COPY$ and RESTORE commands. &ou only need to specify,

Multiple ALLOCATE CHANNEL commands

The o .ects that you %ant to ac! up$ copy$ or restore

RMAN executes commands se(uentially/ that is$ it completes the current command efore startin# the next one. 0arallelism is exploited only %ithin the context of a sin#le command. 1onse(uently$ to create three ac!ups of a datafile$ issue a sin#le BACKUP command specifyin# all three datafiles rather than three separate BACKUP commands. In Oracle2i$ the ALLOCATE CHANNEL command causes RMAN to contact the media mana#er %henever the type specified is other than DISK. In releases efore Oracle2i$ the ALLOCATE CHANNEL command does not cause RMAN to contact the media mana#er/ RMAN does not call the media mana#er unless a BACKUP$ RESTORE$ or RECOVER command is issued. Note: 'hen you specify DEVICE TYPE DISK %ith any version of RMAN$ RMAN does not allocate operatin# system resources other than for the creation of the server session and does not call the media mana#er. 'hen you execute the BACKUP command$ you create one or more ac!up sets. A ac!up set$ %hich is a lo#ical o .ect$ contains one or more physical ac!up pieces. 3y default$ one ac!up set contains one ac!up piece. 3ac!up pieces are operatin# system files that contain the ac!ed up datafiles$ control files$ or archived redo lo#s. "or example$ you can ac! up ten datafiles into a sin#le ac!up set containin# a sin#le ac!up piece )that is$ a sin#le output file*. &ou cannot split a file across different ac!up sets or mix archived lo#s and datafiles into one ac!up set. A ac!up set is a complete set of ac!up pieces that ma!e up a full or incremental ac!up of the o .ects specified in the BACKUP command. 3ac!up sets are in an RMAN4specific format. An ima#e copy$ %hich is a complete ima#e of a sin#le datafile$ control file$ or archived lo#$ is not in an RMAN4specific format. BACKUP BACKUP BACKUP BACKUP BACKUP DATABASE; TABLESPACE use s$ t%%&s; 'SPFILE( 'CURRENT CONTROL FILE(; BACKUPSET #); DATAFILECOPY *+t,-+s.ste,/#.0b1*;

'hen ac!in# up datafiles$ the tar#et data ase must e mounted or open. If the data ase is in ARCHIVELOG mode$ then the tar#et can e open or closed, you do not need to close the data ase cleanly. If the data ase

is in NOARCHIVELOG mode$ then you must close it cleanly efore ma!in# a ac!up. RMAN -e 1% ,s compression %2 3ts b4"5u-s$ 673"7 ,e42s t74t 04t413&e b&%"5s t74t 748e 2e8e bee2 use0 4 e 2%t b4"5e0 u-. I,49e "%-3es %1 4 04t413&e$ 7%6e8e $ 4&64.s "%2t432 4&& 04t413&e b&%"5s. Table Backup Types Backup Type "ull

Definition A ac!up that is not incremental. A full ac!up includes all used data loc!s in the datafiles. "ull ac!ups of control files and archived lo#s al%ays include all loc!s in the files. Note, A full ac!up is different from a %hole data ase ac!up$ %hich is a ac!up of all datafiles and the current control file.

Incremental A ac!up of datafiles that includes only the loc!s that have chan#ed since a previous incremental ac!up. Incremental ac!ups re(uire a full or incremental level 5 ac!up to serve as a asis. Online A ac!up of online$ read+%rite datafiles %hen the data ase is open. Note, 6o not put a ta lespace in ac!up mode %ith the ALTER TABLESPACE BEGIN BACKUP statement. RMAN uses a different method to #uarantee consistency in online ac!ups. 1losed A ac!up of any part of the tar#et data ase %hen it is mounted ut not open. 1losed ac!ups can e consistent or inconsistent. A ac!up ta!en %hen the data ase is mounted ) ut not open* and %as not crashed or shut do%n %ith the ABORT option prior to mountin#. The chec!point S1Ns in the

1onsistent

Backup Type

Definition datafile headers match the header information in the control file and none of the datafiles has chan#es eyond its chec!point. 1onsistent ac!ups can e restored %ithout recovery.

Inconsistent

A ac!up of any part of the tar#et data ase %hen


It is open. It crashed or a SHUTDO:N ABORT %as run prior to mountin#.

An inconsistent ac!up re(uires recovery to ecome consistent. How Incremental Backups Work 7ach data loc! in a datafile contains a system chan#e num er )S1N*$ %hich is the S1N at %hich the most recent chan#e %as made to the loc!. 6urin# an incremental ac!up$ RMAN reads the S1N of each data loc! in the input file and compares it to the chec!point S1N of the parent incremental ac!up. RMAN reads the entire file every time %hether or not the loc!s have een used. The parent ac!up is the ac!up that RMAN uses for comparin# the S1Ns. If the current incremental is a differential ac!up at level n$ then the parent is the most recent incremental of level n or less. If the current incremental is a cumulative ac!up at level n$ then the parent is the most recent incremental of level n48 or less. If the S1N in the input data loc! is #reater than or e(ual to the chec!point S1N of the parent$ then RMAN copies the loc!. The BACKUP command can ac! up the follo%in# types of files,

6ata ase$ %hich includes all datafiles as %ell as the current control file and current server parameter file Ta lespaces )except for locally4mana#ed temporary ta lespaces* 1urrent datafiles 1urrent control file Archived redo lo#s

1urrent server parameter file 3ac!up sets

RMAN does not ac! up the follo%in#,


Online redo lo#s Transported ta lespaces efore they have een made read+%rite 1lient4side initiali-ation parameter files or noncurrent server parameter files.

If CONFIGURE CONTROLFILE AUTOBACKUP is ON ) y default it is OFF*$ then RMAN automatically ac!s up the control file and the current server parameter file )if used* in the follo%in# circumstances,

After every BACKUP or COPY command issued at the RMAN prompt. 'henever a BACKUP or COPY command %ithin a RUN loc! is follo%ed y a command that is neither BACKUP nor COPY. At the end of every RUN loc! if the last command in the loc! %as either BACKUP or COPY. After data ase structural chan#es such as addin# a ne% ta lespace$ alterin# the state of a ta lespace or datafile )for example$ rin#in# it online*$ addin# a ne% online redo lo#$ renamin# a file$ addin# a ne% redo thread$ and so forth. This type of auto ac!up$ unli!e auto ac!ups that occur in the precedin# circumstances$ is only on dis!. &ou can run CONFIGURE CONTROLFILE AUTOBACKUP FOR DEVICE TYPE DISK to set a nondefault dis! location. Note that the auto ac!up never causes the associated structural chan#e to fail. "or example$ if you add a datafile$ and if the resultin# auto ac!up fails$ then the datafile addition is still successful.

Test Backups Using RMAN ou can run t!e BACKUP ... VALIDATE comman" to "o t!e following:

1hec! datafiles for physical and lo#ical corruption 1onfirm that all data ase files exist and are in the correct locations

S-ar putea să vă placă și