Anda di halaman 1dari 17

Recovery Manager Concepts

This chapter describes the basic concepts for the Oracle Recovery Manager utility, and includes the following topics: Introduction to Recovery Manager Backing Up to e!uential Media Recovery Manager Backup Types "orruption #etection $aralleli%ation Report &eneration User Tags for Recovery Manager Backups Backup "onstraints Restore "onstraints Integrity "hecking 'ractured Block #etection #uring Open #atabase Backups in Recovery Manager "ataloging I(age "opies and )rchive *ogs

Introduction to Recovery Manager


Recovery Manager is an Oracle utility you use to back up, restore, and recover database files+ Recovery Manager starts Oracle server processes on the database to be backed up or restored ,called the target database-+ These Oracle server processes actually perfor( the backup and restore+ 'or e.a(ple, during a backup, the server process reads the files to be backed up, and writes out the files out to your target storage device+ Recovery Manager perfor(s i(portant backup and recovery procedures, and greatly si(plifies the tasks ad(inistrators perfor( during these processes+ 'or e.a(ple, Recovery Manager provides a way to: "onfigure fre!uently e.ecuted backup operations &enerate a printable log of all backup and recovery actions Use the recovery catalog to auto(ate both restore and recovery operations $erfor( auto(atic paralleli%ation of backups and restores 'ind datafiles that re!uire a backup based on user/specified li(its on the a(ount of redo that (ust be applied Back up the whole database, selected tablespaces, or selected datafiles

Figure 7-1 Recovery Manager


Recovery Manager has a co((and language interpreter ,"*I-, and can be e.ecuted in interactive or batch (ode+ 0ou (ay also specify a log file on the co((and line to record significant Recovery Manager actions+0ou can also use Recovery Manager via the 1nterprise Manager Recovery Manager application+

2hen running in batch (ode, Recovery Manager reads input fro( a co((and file and writes output (essages to a log file ,if specified-+ The co((and file is parsed in its entirety before any co((ands are co(piled and e.ecuted+ Batch (ode is (ost suitable for perfor(ing regularly scheduled backups via an operating syste( 3ob control facility+ Recovery Manager provides the following categories of co((ands: backup, restore, copy and recover Recovery catalog (aintenance co((ands tored script (aintenance co((ands report and list co((ands

Backing Up to Sequential Media


If you use Recovery Manager to perfor( backups to se!uential (edia, such as tape, you (ust have (edia (anage(ent software integrated with your Oracle software+

Figure 7-2 MML Architecture


In 'igure 4/5, the Oracle e.ecutable is the sa(e e.ecutable that is started when a user connects to the database+ MML is the Media Manage(ent *ibrary, which is (edia (anage(ent, vendor/supplied software+ oftware routines in the MM* are called by Oracle to back up and restore+ In the following e.a(ple, a Recovery Manager script perfor(s a datafile backup: run { allocate channel t1 type `SBT_TAPE'; backup format `df_% _%t' !dataf"le 1#$; % 2hen Recovery Manager e.ecutes this co((and, it sends the backup re!uest to the Oracle server process that will be perfor(ing the backup+ The Oracle server process identifies the output channel as the type 6 BT7T)$18, and re!uests the MM* to load the tape and write the output, a(ong other things+ If the channel type was disk, Oracle would not have connected to the MM* software because Oracle can write to disk without the assistance of third/party integration software+ See Also: 'or infor(ation about vendors offering software integrated with Recovery Manager, see your Oracle representative+

Backing Up Using Enterprise Manager


0ou can perfor( Recovery Manager backups using Oracle 1nterprise Manager/Backup Manager software, which is a graphical user interface to Recovery Manager+ See Also: ee your operating syste(/specific docu(entation for (ore infor(ation+

The Recovery Catalog


The recovery catalog is a repository of infor(ation that is used and (aintained by Recovery Manager+ Recovery Manager uses the infor(ation in the recovery catalog to deter(ine how to e.ecute re!uested backup and restore actions+ The recovery catalog contains infor(ations about the following: datafile and archivelog backup sets and backup pieces datafile copies archived redo logs and copies of the( tablespaces and datafiles at the target database na(ed user/created se!uences of Recovery Manager and 9* co((ands called stored scripts

Operating with a Recovery Catalog


Oracle reco((ends you use Recovery Manager with a recovery catalog, especially if you have 5: ,or (oredatafiles+ 0ou (ust fre!uently resynchroni%e the recovery catalog with the target database control file to keep it up to date+ The (ore up/to/date the recovery catalog is, the easier it will be to recover+ 'or e.a(ple, if you have 5; archive logs that have been created subse!uent to the last resynchroni%ation, and you e.perience a failure re!uiring that you restore the entire database and control file, you (ust first catalog these files with the recovery catalog before you can use the(+ The recovery catalog is (aintained solely by Recovery Manager, and the target database never accesses it directly+ Recovery Manager propagates infor(ation about the database structure, archived redo logs, backup sets and datafile copies into the recovery catalog fro( the target database8s control file+ 0ou do not need an additional database which is solely for the recovery catalog+ 0ou can put the recovery catalog in an e.isting database+ It is the database ad(inistrator8s responsibility to (ake the recovery catalog database available to Recovery Manager+ #atabase ad(inistrators are also responsible for taking backups of the recovery catalog+ ince the recovery catalog resides in an Oracle database, ad(inistrators can use Recovery Manager to back it up by reversing the roles of the recovery catalog database and the target database+ In other words, the target database can beco(e the recovery catalog database and the recovery catalog database can be treated as a target database+ ) single recovery catalog is able to store infor(ation for (ultiple target databases+ If the recovery catalog is destroyed and no backups are available, then you can partially reconstruct the catalog fro( the current control file or control file backups+ <owever, you should always ai( to have a valid, recent backup of your recovery catalog+

Propagating Information from the Control File


The si%e of the target database8s control file will grow, depending on the nu(ber of: backups perfor(ed archive logs created days ,(ini(u( nu(ber- this infor(ation is stored in the control file 0ou can specify the (ini(u( nu(ber of days this infor(ation is kept in the control file using the para(eter "O=TRO*7'I*17R1"OR#7>11$7TIM1+ 1ntries older than the nu(ber of days are candidates for overwrites by newer infor(ation+ The larger the "O=TRO*7'I*17R1"OR#7>11$7TIM1 setting is, the larger the control file will be+

)t a (ini(u(, you should resynchroni%e your recovery catalog at intervals less than the "O=TRO*7'I*17R1"OR#7>11$7TIM1 setting, because after this nu(ber of days, the infor(ation in the control file will be overwritten with the (ost recently created infor(ation? if you have not resynchroni%ed, and infor(ation has been overwritten, this infor(ation can not be propagated to the recovery catalog+ Note: The (a.i(u( si%e of the control file is port specific+ ee your see your operating syste(/ specific Oracle docu(entation+

See Also: 'or (ore infor(ation about the "O=TRO*7'I*17R1"OR#7>11$7TIM1 para(eter, see the Oracle@ Reference+

Operating without a Recovery Catalog Note: You are not required to maintain a recovery catalog with Recovery Manager; however, Oracle recommends that you use one.

Because (ost infor(ation in the recovery catalog is also available in the target database8s control file, Recovery Manager supports an operational (ode where it uses the target database control file instead of a recovery catalog+ This operational (ode is appropriate for s(all databases where installation and ad(inistration of another database for the sole purpose of (aintaining the recovery catalog would be burdenso(e+ =ote that the following features are not supported in this operational (ode: tablespace point/in/ti(e recovery stored scripts restore and recovery when the control file is lost or da(aged To restore and recover your database without using a recovery catalog, Oracle reco((ends that you: Use (ultiple.ed control files ,(ini(u( of two-, and have each control file on separate disks to protect against (edia failure+ >eep e.cellent record of what files were backed up, the date they were backed up, and also the na(es of the backup pieces each file was written to+ >eep all Recovery Manager backup logs+ warning: It is difficult to restore and recover if you lose your control files and do not use a recovery catalog. The only way to restore and recover when you have lost all control files and need to restore and recover datafiles, is to call Oracle WorldWide Support WWS!. WWS will need to know the following: current sche"a of the database

which files were backed up what ti"e the files were backed up na"es of the backup pieces containing the files

Keeping Information in the Control File


The si%e of the target database8s control file will grow, depending on the nu(ber of: backups perfor(ed archive logs created days ,(ini(u(- this infor(ation is stored in the control file 0ou can specify the (ini(u( nu(ber of days this infor(ation is kept in the control file using the para(eter "O=TRO*7'I*17R1"OR#7>11$7TIM1+ 1ntries older than this nu(ber of days are candidates to be overwritten by newer infor(ation+ The larger the "O=TRO*7'I*17R1"OR#7>11$7TIM1 is, the larger the control file will be+ If you do not use a recovery catalog, you (ay wish to set the "O=TRO*7'I*17R1"OR#7>11$7TIM1 para(eter to the duration ,in days- you intend to keep your backups+ This way, the backup infor(ation in the control file will not be overwritten before the backups beco(e obsolete+ Note: The (a.i(u( si%e of the control file is port specific+ ee your see your operating syste(/ specific Oracle docu(entation+

See Also: 'or (ore infor(ation about the "O=TRO*7'I*17R1"OR#7>11$7TIM1 para(eter, see the Oracle@ Reference+

Snapshot Control File


Recovery Manager generates a snapshot control file, which is a te(porary backup control file each ti(e it refreshes the recovery catalog+ This snapshot control file ensures that Recovery Manager has a consistent view of the control file either when refreshing the recovery catalog or when !uerying the control file ,if you are not using a recovery catalog-+ Because the snapshot control file is for Recovery Manager8s short ter( use, it is not registered in the recovery catalog+ Recovery Manager records the snapshot control file checkpoint in the recovery catalog to indicate precisely how current the recovery catalog is+ The Oracle@ server ensures only one Recovery Manager session accesses a snapshot control file at any point in ti(e+ This is necessary to ensure that two Recovery Manager sessions do not interfere with each other8s use of the snapshot control file+ Note: It is possible to specify the na(e and location of a snapshot control file+ 'or infor(ation on how to do this, see A"onfiguring the napshot "ontrol 'ile *ocationAch@+ht( / B5B4C5+

Stored Scripts
#atabase ad(inistrators can store a se!uence of Recovery Manager co((ands, called a stored script, in the recovery catalog for e.ecution at a later ti(e+ This allows the ad(inistrator to plan, develop and test a set of co((ands for backing up, restoring, and recovering the database+ tored scripts also (ini(i%e the potential for operator errors+ 1ach stored script relates to only one database+

Figure 7-3 Recovery Manager Stored Scripts

Recovery Manager Backup Types


Recovery Manager supports two basic types of backups: Backup ets I(age "opies

Backup Sets
) backup set contains one or (ore datafiles or archivelogs? however, it cannot contain both datafiles and archivelogs+ #atafile backup sets can also contain a control file backup+ Backup sets are in an Oracle proprietary for(at ,si(ilar to 1.port files-+ 0ou (ust perfor( a restore operation to e.tract a file fro( a backup set+ ) backup set is also co(plete set of backup pieces that constitute a full or incre(ental backup of the ob3ects specified in the backup co((and+ The pieces of a backup set are written serially+ , triping a backup set across (ultiple output devices is not supported+- If (ultiple output devices are available, you can partition your backups so that (ultiple backup sets are created in parallel+ Recovery Manager perfor(s this backup partitioning auto(atically, if desired+ ) backup set can: be written to disk or tertiary storage be full or incre(ental span (ultiple OD files ,each file is a piece of the set//typically, one set is co(prised of only one piece0ou can write backup sets to either nor(al operating syste( disk files or to se!uential output (edia ,for e.a(ple, (agnetic tape- using a se!uential output device or (edia (anage(ent syste( that is available and supported by Oracle on your operating syste(+ To deter(ine which device types are supported by your operating syste( or Media Manager, !uery the EFB)">U$7#1EI"1 view+

) backup set containing archived logs is called an archivelog backup set+ 0ou cannot archive directly to tape+ <owever, Recovery Manager allows you to back up archived logs fro( disk to tape+ )lso, during recovery Recovery Manager auto(atically stages the re!uired archived logs fro( tape to disk+ See Also: 'or details about EFB)">U$7#1EI"1, see the Oracle@ Reference+

Backup Pieces
) backup set is co(posed of one or (ore backup pieces, each piece being a single output file+ 0ou should restrict the si%e of a backup piece to whatever is the (a.i(u( file si%e supported by your Media Manager or OD ,if writing to disk-+ If you do not restrict this si%e, a backup set will be co(prised of only one file+ 1ach backup piece contains control and checksu( infor(ation that allows the Oracle server process to validate the correctness of the backup piece during a restore+

Backup Set Compression


#atafile blocks that have never been used are not written out to backup sets+ I(age copy backups of a datafile always contain all datafile blocks+

File Multiplexing
#atafile blocks included in the sa(e backup set are (ultiple.ed together+ This (eans that the blocks fro( all of the files in the set are interspersed with all the other blocks+ 0ou can control the nu(ber of datafiles that are backed up concurrently to a backup set using the filesperset para(eter+ "ontrolling concurrency is helpful if you want to keep a tape device strea(ing without saturating a single datafile with too (any read re!uests ,which can subse!uently degrade online perfor(ance-+ 0ou can li(it the read rate by using the set li"it readrate channel co((and+ See Also: 'or a detailed description, see AMultiple.ed Backup etsAch4+ht( / B54;:5+

Full and Incremental Backup Sets


#atafile backup sets can be full or incre(ental+ ) full backup is a backup of one or (ore datafiles that contain all blocks of the datafile,s-+ )n incre(ental backup is a backup of one or (ore datafiles that contain only those blocks that have been (odified since a previous backup+ These concepts are described in (ore detail in the following sections+

Full Backup Sets


) full backup copies all blocks into the backup set, skipping only datafile blocks that have never been used+ =o blocks are skipped when backing up archivelogs or control files+ ) full backup is not the same as a whole database/ backup? full is an indicator that the backup is not incre(ental+ )lso, a full backup has no effect on subse!uent incre(ental backups, and is not considered part of the incre(ental strategy ,in other words, a full backup does not affect which blocks are included in subse!uent incre(ental backups-+

Oracle allows you to create and restore full backups of the following: datafile datafile copy tablespace control file ,current or backup database )rchivelog backup sets are always full backups+

Incremental Backup Sets


)n incremental backup is a backup of one or (ore datafiles that contain only those blocks that have been (odified since a previous backup at the sa(e or lower level? unused blocks are not written out+ ) control file (ay be included in an incre(ental backup set? however, it is always included in its entirety ,in other words, the full control file is always included? no blocks are skipped-+ Oracle allows you to create and restore incre(ental backups of the following: datafile tablespace database The multi-level incremental backup feature allows you to create different levels of incre(ental backups+ 1ach level is denoted by an integer+ By default, an incre(ental backup at any particular level consists of those blocks that have been (odified since the last backup at that level or lower+ ) level : incre(ental backup copies all blocks containing data? a level : incre(ental backup is the base for subse!uent incre(ental backups+ )n incre(ental backup at a level greater than : copies only those blocks that have changed since a previous incre(ental backup at the sa(e or lower level+ <ence, the benefit of perfor(ing incre(ental backups is that you don8t back up all of the blocks all of the ti(e+ Incre(ental backups at levels greater than : only copy blocks that were (odified+ This (eans the backup si%e (ay be significantly s(aller, and re!uire (uch less ti(e+ The si%e of the backup file depends solely upon the nu(ber of blocks (odified, as well as the incre(ental backup level chosen by the #B)+ The (ulti/level incre(ental backup feature allows you to devise a backup sche(e that enables you to restore the database within a given ti(e constraint+ 'or e.a(ple, you could i(ple(ent a three/level backup sche(e so that a level : backup was a (onthly full backup? a level G backup was a weekly incre(ental, and a level 5 was a daily incre(ental+

Cumulative Incremental Backup Sets


Oracle provides an option to (ake cumulative incre(ental backups at level G or greater+ "u(ulative incre(ental backups reduce the work needed for a restore by ensuring that you only need one incre(ental backup fro( any particular level at restore ti(e+ <owever, cu(ulative backups re!uire (ore space and ti(e because they duplicate the work done by previous backups at the sa(e level+ ) cu(ulative incre(ental backup copies all blocks that have changed since a previous incre(ental backup at a lower level+

Figure 7-4 Non-cumulative Incremental Backups(default type of incremental)


In the e.a(ple above: unday )n incre(ental level : backup occurs+ This backs up all blocks that have ever been in use in this database+ Monday )n incre(ental level 5 backup occurs+ This backs up all blocks that have changed since the (ost recent incre(ental backup at level n or less? in this case the (ost recent incre(ental backup at level 5 or less is the level : unday backup, so only the blocks changed since unday will be backed up+ Tuesday )n incre(ental level 5 backup occurs+ This backs up all blocks that have changed since the (ost recent incre(ental backup at level n or less? in this case the (ost recent incre(ental backup at level 5 or less is the level 5 Monday backup, so only the blocks changed since Monday will be backed up+ 2ednesday )n incre(ental level 5 backup occurs+ This backs up all blocks that have changed since the (ost recent incre(ental backup at level n or less? in this case the (ost recent incre(ental backup at level 5 or less is the level 5 Tuesday backup, so only the blocks changed since Tuesday will be backed up+ Thursday )n incre(ental level G backup occurs+ This backs up all blocks that have changed since the (ost recent incre(ental backup at level n or less? in this case the (ost recent incre(ental backup at level G or less is the level : unday backup, so only the blocks changed since the unday level : backup will be backed up+ 'riday )n incre(ental level 5 backup occurs+ This backs up all blocks that have changed since the (ost recent incre(ental backup at level n or less? in this case the most recent incre(ental backup at level 5 or less is the level G Thursday backup, so only the blocks changed since the Thursday level G backup will be backed up+ aturday )n incre(ental level 5 backup occurs+ This backs up all blocks that have changed since the (ost recent incre(ental backup at level n or less? in this case the most recent incre(ental backup at level 5 or less is the level 5 Thursday backup, so only the blocks changed since the 'riday level 5 backup will be backed up+ The cycle is repeated+

Figure 7-5 Cumulative Incremental Backups


In the e.a(ple above: unday )n incre(ental level : backup occurs+ This backs up all blocks that have ever been in use in this database+ Monday ) cu(ulative incre(ental level 5 backup occurs+ This backs up all blocks that have changed since the (ost recent incre(ental backup at level n/G or less? in this case the (ost recent incre(ental backup at level 5/G or less is the level : unday backup, so only the blocks changed since unday will be backed up+ Tuesday

) cu(ulative incre(ental level 5 backup occurs+ This backs up all blocks that have changed since the (ost recent incre(ental backup at level n/G or less? in this case the (ost recent incre(ental backup at level 5/G or less is the level : unday backup, so all the blocks changed since unday will be backed up+ ,This includes those which were copied on Monday, as this backup is Acu(ulativeA and includes the blocks copied at backups taken at the sa(e incre(ental level as the current backup-+ 2ednesday ) cu(ulative incre(ental level 5 backup occurs+ This backs up all blocks that have changed since the (ost recent incre(ental backup at level n/G or less? in this case the (ost recent incre(ental backup at level 5/G or less is the level : unday backup, so all the blocks changed since unday will be backed up+ ,This includes those which were copied on Monday H Tuesday, as this backup is cu(ulative and includes the blocks copied at backups taken at the sa(e incre(ental level as the current backup-+ Thursday ) cu(ulative incre(ental level G backup occurs+ This backs up all blocks that have changed since the (ost recent incre(ental backup at level n/G or less? in this case the (ost recent incre(ental backup at level G/G or less is the level : unday backup, so all the blocks changed since unday will be backed up+ 'riday ) cu(ulative incre(ental level 5 backup occurs+ This backs up all blocks that have changed since the (ost recent incre(ental backup at level n/G or less? in this case the (ost recent incre(ental backup at level 5/G or less is the level G Thursday backup, so all the blocks changed since Thursday will be backed up+ aturday ) cu(ulative incre(ental level 5 backup occurs+ This backs up all blocks that have changed since the (ost recent incre(ental backup at level n/G or less? in this case the (ost recent incre(ental backup at level 5/G or less is the level G Thursday backup, so all the blocks changed since unday will be backed up+ The cycle is repeated+

Image Copies
)n image copy contains a single file ,datafile, archivelog, or control file- that you can use as/is to perfor( recovery+ )n i(age copy backup is si(ilar to an OD copy of a single file, e.cept it is produced by an Oracle server process, which perfor(s additional actions like validating the blocks in the file, and registering the copy in the control file+ )n i(age copy differs fro( a backup set because it is not (ultiple.ed, nor is there any additional header or footer control infor(ation stored in the copy+ Image copy backups (ay be written only to disk+ If the i(age copy is of a datafile, then no restore operation is re!uired? a switch co((and is provided to point the control file at the copy and update the recovery catalog to indicate that the copy has been Aconsu(ed?A this is e!uivalent to the 9* state(ent )*T1R #)T)B) 1 R1=)M1 #)T)'I*1+ 0ou can then perfor( (edia recovery to (ake the copy current+ )n i(age copy can be restored to another location to prevent the Aconsu(ptionA of the copy, but a restore is not strictly necessary because the datafile can be rena(ed to the i(age copy+

User-Created Image Copies


I(age copies ,also known as OD copies- created by (echanis(s other than Recovery Manager are supported+ <owever, database ad(inistrators (ust catalog such OD copies with Recovery Manager before using the( in a restore or switch. upport for both closed and open OD copies is provided for users who have other (echanis(s for creating i(age copies of datafiles+ 'or e.a(ple, so(e sites store their datafiles on (irrored disk volu(es+ This per(its the creation of i(age copies by si(ply breaking the (irrors+ )fter the (irror has been broken, Recovery Manager can be notified of the e.istence of a new copy, thus (aking it a candidate for use in a restore+ The database ad(inistrator

(ust notify Recovery Manager when the copy is no longer available for restore ,using the change ... uncatalog co((and-+ In this e.a(ple, if the (irror is resilvered ,not including other copies of the broken (irror-, you (ust use a change ... uncatalog to update the recovery catalog and indicate that this copy is no longer available+

Corruption Detection
)s it is an Oracle server process which is perfor(ing a backup or copy, the server process is able to detect (any types of corrupt blocks+ 1ach new corrupt block not previously encountered in a backup or copy operation is recorded in the control file and in the alert log+ Recovery Manager !ueries this infor(ation at the co(pletion of a backup and stores it in the recovery catalog+ 0ou can !uery this infor(ation fro( the control file using the views EFB)">U$7"ORRU$TIO= and EF"O$07"ORRU$TIO=+ If you encounter a datafile block during a backup that has already been identified as corrupt by the database, then the corrupt block is copied into the backup and the corruption is reported to the control file as either a logical or (edia corruption+ If a datafile block is encountered with a corrupt header that has not already been identified as corrupt by the database, then the block is written to the backup with a refor(atted header indicating the block is (edia corrupt+ Note: #ot all types of corruptions can be detected at this ti"e.

Channel Control
) channel (ust be allocated before issuing a backup, copy, restore, or recover co((and+ 1ach allocate channel co((and establishes a connection fro( Recovery Manager to a target database instance by starting a server process on the target instance+ The allocate channel co((and also specifies the type of IDO device that the server process will use to perfor( the backup or restore operation+ 1ach channel usually corresponds to one output device, unless your MM* ,Media Manage(ent *ibrary- is capable of hardware (ultiple.ing+ Oracle does not reco((end hardware (ultiple.ing of Oracle backups+ =ote that there is only one Recovery Manager process co((unicating with one or (any server processes attached to the target database+ 0ou can allocate (ultiple channels, thus allowing (ultiple backup sets or file copies to be read or written in parallel by a single Recovery Manager co((and+ Thus, the degree of parallelis( within a co((and is affected by the nu(ber of channels ,connections- that are allocated+ 1ach allocate channel co((and uses a separate connection to the target database+ 0ou can specify a different connect string for each channel, to connect to different instances of the target database+ This is useful in an Oracle $arallel erver configuration for distributing the workload across different nodes+ "hannel control co((ands can be used to: control the OD resources Recovery Manager uses when perfor(ing backup, copy, restore, and recover co((ands affect the degree of parallelis( ,in con3unction with filesperset specify li(its on IDO bandwidth consu(ption ,set li"it read rate specify li(its on the si%e of backup pieces ,set li"it kbytes-

specify li(its on the nu(ber of concurrently open files ,set li"it "a$openfiles-

On so(e platfor(s, these co((ands specify the na(e or type of IDO device to use+ On other platfor(s, these co((ands specify which OD access (ethod or IDO driver to use+ =ot all platfor(s support the selection of IDO device through this interface? on so(e platfor(s, IDO device selection is controlled through platfor(/specific (echanis(s+ 2hether or not the allocate channel co((and actually causes OD resources to be allocated is OD dependent+ o(e operating syste(s allocate resources at the ti(e the co((and is issued? others do not allocate resources until a file is opened for reading or writing+ 'urther(ore, when type disk is specified, no OD resources are allocated, other than for the creation of the server process+ ) channel (ust be allocated before issuing a change ... delete co((and, which calls the OD to delete a file+ ) channel which is allocated in this way is useful only for deleting files+ It cannot be used as an input or output channel for a 3ob+ Only one such channel can be allocated at a ti(e+

Parallelization
Recovery Manager (ay paralleli%e its operations, establishing (ultiple logon sessions and conducting (ultiple backup sets or file copies in parallel+ "oncurrent backup sets or i(age copies (ust operate on dis3oint sets of database files+

Factors Affecting Degree of Parallelization


$aralleli%ation of backup, copy, and restore co((ands is handled internally by the Recovery Manager+ 0ou only need to specify: (ore than one allocate channel co((ands the ob3ects to be backed up, copied, or restored

Parallelizing Backup Set Creation


0ou typically (ust specify the nu(ber of files per set for backup sets+ 'or e.a(ple, if you allocate 5: channels, but perfor( a si(ple backup database! of a database containing 5: files without any other options specified, only one channel will be used, even though 5: are allocated+ If you add 6filesperset B8, then Recovery Manager will use ; channels ,li(iting each channel to B files-+ pecifying 8filesperset G8 indicates that each channel can operate on only G file? thus all 5: channels will be used+ In the e.a(ple above, if you back up the sa(e database ,5: files- and each file corresponds one/to/one with a tablespace, and you write the backup co((and as follows, you do not need to use filesperset to paralleli%e: backup !table pace 1 table pace & ''' table pace &#$ Recovery Manager e.ecutes co((ands serially, that is, it co(pletes the current co((and before starting the ne.t co((and+ $arallelis( is e.ploited only within the conte.t of a single co((and+ Thus, if you want G: datafile copies, it is better to issue a single copy co((and specifying all G: copies rather than G: separate copy co((ands

Parallelizing File Copies


'or file copies, specify (ultiple datafiles to copy in a single copy co((and+ 'or e.a(ple, the following Recovery Manager script serializes the file copies+ Only one channel is active at any one ti(e+

run { allocate channel allocate channel allocate channel allocate channel allocate channel allocate channel allocate channel allocate channel allocate channel allocate channel copy dataf"le && copy dataf"le &( copy dataf"le &) copy dataf"le &* copy dataf"le &+ copy dataf"le &, copy dataf"le &copy dataf"le &. copy dataf"le (# copy dataf"le (1 %

c1 type d" k; c& type d" k; c( type d" k; c) type d" k; c* type d" k; c+ type d" k; c, type d" k; c- type d" k; c. type d" k; c1# type d" k; to '/de0/prod/backup1/prod_tab*_1'dbf'; to '/de0/prod/backup1/prod_tab*_&'dbf'; to '/de0/prod/backup1/prod_tab*_('dbf'; to '/de0/prod/backup1/prod_tab*_)'dbf'; to '/de0/prod/backup1/prod_tab+_1'dbf'; to '/de0/prod/backup1/prod_tab,_1'dbf'; to '/de0/prod/backup1/prod_tab*_&'dbf'; to '/de0/prod/backup1/prod_nd1*_1'dbf'; to '/de0/prod/backup1/prod_nd1*_&'dbf'; to '/de0/prod/backup1/prod_nd1*_('dbf';

The following state(ent paralleli%es the sa(e e.a(ple? there is one Recovery Manager co((and copying G: files, and G: channels available+ )ll G: channels are concurrently active-/each channel copies one file+ run { allocate channel c1 type d" k; allocate channel c& type d" k; allocate channel c( type d" k; allocate channel c) type d" k; allocate channel c* type d" k; allocate channel c+ type d" k; allocate channel c, type d" k; allocate channel c- type d" k; allocate channel c. type d" k; allocate channel c1# type d" k; copy dataf"le && to '/de0/prod/backup1/prod_tab*_1'dbf'2 dataf"le &( to '/de0/prod/backup1/prod_tab*_&'dbf'2 dataf"le &) to '/de0/prod/backup1/prod_tab*_('dbf'2 dataf"le &* to '/de0/prod/backup1/prod_tab*_)'dbf'2 dataf"le &+ to '/de0/prod/backup1/prod_tab+_1'dbf'2 dataf"le &, to '/de0/prod/backup1/prod_tab,_1'dbf'2 dataf"le &- to '/de0/prod/backup1/prod_tab*_&'dbf'2 dataf"le &. to '/de0/prod/backup1/prod_nd1*_1'dbf'2 dataf"le (# to '/de0/prod/backup1/prod_nd1*_&'dbf'2 dataf"le (1 to '/de0/prod/backup1/prod_nd1*_('dbf'; %

Multiplexed Backup Sets


) server process can concurrently operate on one or (ore files andDor tablespaces+ If (ultiple files andDor tablespaces are specified, or one or (ore (ulti/file tablespaces are specified, then the datafiles are backed up concurrently and the output is (ultiple.ed together+ This (eans blocks fro( files in the sa(e backup set will be interspersed with each other throughout the backup set+

2hen e.ecuting a (ultiple.ed backup ,(ultiple datafiles written to the sa(e backup set-, you can either partition the datafiles into backup sets e.plicitly, or let Recovery Manager auto(atically select a partitioning+ ) high perfor(ance se!uential output device can be kept strea(ing by including a sufficient nu(ber of datafiles in the backup+ This is i(portant for open database backups where the backup operation (ust co(pete with the online syste( for IDO bandwidth+ The control file (ay also be included in a datafile backup set+ The Oracle logical blocksi%e of the ob3ects in a (ultiple.ed backup (ust be the sa(e+ <ence, datafiles and archive logs cannot be written to the sa(e set+

Report Generation
The report and list co((ands provide infor(ation about backups and i(age copies+ 2hile the list co((and si(ply lists the contents of the recovery catalog, the report co((and perfor(s a (ore detailed analysis of the recovery catalog+ The output fro( these co((ands is written to the (essage log file+ The report co((and produces reports that can answer !uestions such as: what files need a backupI what files haven8t been backed up recentlyI what backup files can be deletedI what files are not recoverable because of unrecoverable operationsI what was the physical sche(a of the database at so(e previous point in ti(eI The report need backup and report unrecoverable co((ands should be used on a regular basis to ensure that the necessary backups are available to perfor( recovery, and to ensure that the recovery can be perfor(ed within a reasonable length of ti(e+ The report co((and lists backup sets and datafile copies that can be deleted either because they are redundant or because they could never be used by a recover co((and+ ) datafile is considered unrecoverable if an unrecoverable operation has been perfor(ed against an ob3ect residing in the datafile subse!uent to the last backup+ Note: ) datafile that does not have a backup is not considered unrecoverable+ uch datafiles can be recovered through the use of the create datafile co((and, provided that logs starting fro( when the file was created still e.ist+

The list co((and !ueries the recovery catalog and produces a listing of its contents+ 0ou can use it to find out what backups or copies are available: backup sets containing a backup of a specified list of datafiles copies of a specified list of datafiles backup sets containing a backup of any datafile which is a (e(ber of a specified list of tablespaces copies of any datafile that is a (e(ber of a specified list of tablespaces backup sets containing a backup of any archivelogs with a specified na(e andDor within a specified range copies of any archivelog with a specified na(e andDor within a specified range incarnations of a specified database+

See Also: 'or (ore details on the Recovery Manager report co((and, see )ppendi. ), ARecovery Manager "o((and ynta.A+

User Tags for Recovery Manager Backups


0ou can optionally assign a user/specified character string called a tag to backup sets and i(age copies ,either Oracle/created copies or user/created copies-+ ) tag is essentially a sy(bolic na(e for a backup set or file copy, and can be specified when e.ecuting the restore or change co((and+ ) tag provides a sy(bolic way to refer to a collection of file copies or backup sets+ The (a.i(u( length of a tag is J: characters+ Tags need not be uni!ue: (ultiple backup sets or i(age copies can have the sa(e tag+ 2hen a tag is not uni!ue, then with respect to a given datafile, the tag is understood to refer to the (ost current suitable file ,that is, the (ost current suitable backup containing that file (ay not be the (ost recent backup? this situation would occur when perfor(ing a point/in/ti(e recovery-+ 'or e.a(ple, if datafile copies are created each Monday evening and are always tagged A(onday$McopyA, then the tag is considered to refer to the (ost recently created copy+ Thus, the following co((and switches datafile three to the (ost recently created Monday evening copy: 3"tch dataf"le ( to dataf"lecopy ta4 mondayP5copy; Tags can indicate the intended purpose or usage of different classes of backups or file copies+ 'or e.a(ple, datafile copies that are suitable for use in a switch can be tagged differently fro( file copies that should be used only for restore+ Note: By default, Recovery Manager selects the (ost recent backups to restore, unless !ualified by a tag or an until clause+

warning: %ou can use a tag to specify the input files to a restore or switch co""and. If a tag is specified, &ecovery 'anager will consider only backup sets with a "atching tag when choosing which particular backup set or i"age copy to use.

See Also: 'or infor(ation about the switch and restore co((ands, see )ppendi. ), ARecovery Manager "o((and ynta.+A

Backup Constraints
Backup operations (ay be perfor(ed only by an instance that has the database (ounted or open+ In an Oracle parallel server environ(ent, if the instance where the backup operation is being perfor(ed does not have the database open, then the database (ust not be open by any instance+

Backups are supported at both the tablespace and datafile level+ Backups of the control file (ay also be created+ Backups of online logs are not supported+ ,If backups of the online logs are desired, you (ust run the database in )R"<IE1*O& (ode+ If the database is in =O)R"<IE1*O& (ode, you can (ake whole database backups only if the database is shutdown cleanly+ 0ou can (ake tablespace or datafile backups if the datafiles to be backed up are in an offline nor(al tablespace, or tablespaces are in read/only (ode+ If the database is in )R"<IE1*O& (ode, then backups (ay be taken when the database is open and in use+ Only current datafiles (ay be backed up+ #atafiles which have been restored fro( backups (ay not be backed up until they have been (ade current by perfor(ing (edia recovery+ Backups of a database that was not shutdown cleanly are allowed, but not reco((ended+ Recovery Manager does not back up: $ara(eter files associated with the database $assword files associated with the database Operating syste( files Online redo logs See Also: ABacking Up Online Redo *ogsAchJ+ht( / B5B5G;+

Restore Constraints
Restore operations (ust be perfor(ed on a started instance, however, the instance need not have the database (ounted+ This allows restore operations to be perfor(ed when the control file has been lost+ ) tablespaceDdatafile that is to be restored (ust be offline, or the database (ust be closed+ ) restore (ay either overwrite the e.isting datafiles or its output (ay be directed to a new file via the set newna"e co((and+

Integrity Checking
Oracle prohibits any atte(pts to perfor( operations which would result in unusable backup files or corrupt restored datafiles+ )(ong the integrity checks that the Oracle erver perfor(s are: ensures that restore operations do not corrupt the database by applying backups fro( a previous incarnation of the database ensures that incre(ental backups are applied in the correct order prohibits accessing datafiles that are in the process of being restored or recovered allows only one restore operation per datafile at a ti(e prohibits backups of unrecovered backup files control infor(ation stored in backups ensure that corrupt backup files are detected

Fractured Block Detection During Open Database Backups in Recovery Manager


2hen perfor(ing open backups without using Recovery Manager, tablespaces (ust be put in hot backup (ode in case the operating syste( reads a block for backup that is currently being written by #B2:, and is thus inconsistent+ This pheno(enon is known as AsplitA or Afractured blocks+A 2hen perfor(ing a backup using Recovery Manager, an Oracle server process reads the datafiles, not an operating syste( utility+ The Oracle server process reads whole Oracle blocks, and checks to see whether the block is fractured by co(paring control infor(ation stored in the header and footer of each block+ If a fractured block is

detected, the Oracle server process rereads the block+ This is why, when using Recovery Manager to back up or copy database files, tablespaces do not need to be in hot backup (ode+ See Also: 'or infor(ation about hot backup (ode, see "hapter GG, A$erfor(ing Operating yste( BackupsA+

Tracking Archive Logs


The control file tracks the location of logs archived by the )R"< background process+ 1ach ti(e a log is successfully archived, a record is added to the control file+ The record contains the archived log filena(e and other relevant infor(ation+ 0ou can specify the nu(ber of archive log records (aintained when creating the control file+ )ny nu(ber (ay be specified provided that the li(it on total control file si%e is not e.ceeded+ These records are reused in a circular fashion+ Recovery Manager !ueries these records and propagates the( into the recovery catalog+ If there is a (edia failure in an online log, it (ay not be possible to archive it+ 0ou (ay therefore choose to issue an )*T1R #)T)B) 1 "*1)R U=)R"<IE1# *O& state(ent+ In this case, an archive log record is still created, but it indicates that no archive log e.ists for this log se!uence nu(berD "= range+

Cataloging Image Copies and Archive Logs


Recovery Manager can catalog an i(age copy and read the (eta/data+ This is i(portant when the recovery catalog is lost and you (ust perfor( disaster recovery+ Only i(age copies and archived logs can be cataloged+

Anda mungkin juga menyukai