Oracle RMAN 11g Backup and Recovery (84 page)

BOOK: Oracle RMAN 11g Backup and Recovery
8.71Mb size Format: txt, pdf, ePub

allocated channel: c2

Starting backup at 13-JUN-02

RMAN-00571:

240
Part II: Setup Principles and Practices

RMAN-00569:

ERROR MESSAGE STACK FOLLOWS

RMAN-00571:

RMAN-03002: failure of backup command at 06/13/2002 22:07:47

RMAN-06183: datafile or datafilecopy larger than SETSIZE: file# 1

D:\ORACLE\ORADATA\ROBT\SYSTEM01.DBF

So, be careful using this restriction, and see whether you instead can use the
maxpiecesize
parameter of the
allocate channel
command.

Also, you can use the
configure
command to create default limits on the size of backup sets and limits on the backup piece size, if that is your preference. Refer to Chapter 3 for more information on this command.

Backing Up to a Specific Device Type

Perhaps you have configured different default channels, one to disk and one to tape. You can use the
device type
parameter to define which automatic channel device you wish to use when the backup begins. Here is an example:

backup database device type disk;

backup database device type sbt;

Modifying the Retention Policy for a Backup Set

Starting in Oracle Database 11
g,
the
keep
parameter of the RMAN
backup
command is used to override default retention criteria and creates what is called an archival backup. An archival backup is a self-contained backup (meaning it includes the archived redo logs needed to create a consistent backup). Note that starting in Oracle Database 11
g,
the
logs
and
nologs
options are no longer available, since the logs are always backed up. The
keep
parameter has the following options:


forever
Indicates that the archival backup should be maintained until it is manually removed. Using the
keep forever
option requires the use of a recovery catalog since control file records can be aged out. Here is an example of the use of the
keep forever
parameter during a backup:

backup database keep forever;


until time
string This option defines an alternate retention criterion for the backup. Note that if the time exceeds 365 days, it is possible that the records will be aged out of the control file. Regardless, RMAN does not require that you use a recovery catalog as it does when you use the
keep forever
parameter.

backup database format 'c:\oracle\backup\%U' keep untiltime='sysdate+180' tag Keep backup; This can be used to easily identify the backup for restore purposes. Here is an example where we create an archival backup and assign it a restore point called gold_copy: backup database format 'c:\oracle\backup\%U'

keep until time 'sysdate+180'

restore point gold copy;

Chapter 11: RMAN Backups
241

One restriction on archival backups is that they cannot be kept in the flash recovery area (FRA). If you attempt to use the FRA to store archival backups, RMAN will generate an error and the backup will fail.

The
keep
option is also available in Oracle Database 10
g
and earlier versions, but its implementation is slightly different. With the older version of the
keep
option, you need to back up your archived redo logs in a separate RMAN command because the
plus archivelog
option is not valid when using the
keep
option. Since the archived redo logs are not automatically backed up, you can potentially have an unrecoverable backup, so exercise caution. The older method gives you an option to mark all archived redo log backup sets with the same retention criteria by using the
logs
option, or to skip marking the archived redo log backup sets with the
nologs
option. The
logs
and
nologs
options are no longer available with archival backups in Oracle Database 11
g.

If you are using the
keep
option with Oracle Database 10
g
and earlier, then you will want to know about the following options:


logs
The backup sets that contain the archived redo log backed up during the backup would have the same retention criteria assigned to them as the backup. This would, in effect, keep the log backup sets for the same period as the backup itself, ensuring a consistent recovery was possible.


nologs
This indicates that any archived redo logs will not have a different retention criterion established. Essentially, this makes your ARCHIVELOG mode backup useless if the archived redo logs are aged out, while the backup is not aged out. This parameter is useful for NOARCHIVELOG mode backups since there are no archived redo logs to back up.

Here is an example of a backup using the
keep
parameter in Oracle Database 10
g.
Note that we use the
plus archivelog
parameter to ensure that we back up the archived redo logs. Note in this example that we have two format clauses. The first is for the backup set pieces associated with the backup itself, and the second is for the backup set pieces associated with the archive log backups. This is required since we are using the FRA by default, and since both the archive log–

backup backup set pieces and the database-backup backup set pieces cannot exist in the FRA if the
keep
parameter is used. This is not required in Oracle Database 11
g.

backup database tag 'keep full' format 'c:\oracle\backup\%U'

keep until time 'sysdate+180' logs plus archivelog

format 'c:\oracle\backup\%U';

Regardless of which version of Oracle you are running, you may wish to see how long specific backups were set to be kept for. The
list backup of database
command will provide this information. We discuss the
list
command in more detail in Chapter 18, but here is an example of the output you might expect to see. Note in the output that there is a line that says “Keep: LOGS” and followed by “Until” and a date. This indicates that this is an archival backup in Oracle Database 11
g
and is a backup using the
keep logs
option in Oracle Database 10
g
and earlier versions. This backup will be kept up to the date listed in the Until section of the report.

BP Key: 36 Status: AVAILABLE Compressed: NO Tag: KEEP FULL

Piece Name: C:\ORACLE\BACKUP\1FKJVSSA 1 1

Keep: LOGS Until: 08-JAN-10

List of Datafiles in backup set 36

242
Part II: Setup Principles and Practices

File LV Type Ckp SCN Ckp Time Name

---- -- ---- ---------- --------- ----

1 Full 4358741 12-JUL-09 C:\ORACLE\ORADATA\MY\SYSTEM01.DBF

2 Full 4358741 12-JUL-09 C:\ORACLE\ORADATA\MY\SYSAUX01.DBF

3 Full 4358741 12-JUL-09 C:\ORACLE\ORADATA\MY\UNDOTBS01.DBF

4 Full 4358741 12-JUL-09 C:\ORACLE\ORADATA\MY\USERS01.DBF

5 Full 4358741 12-JUL-09 C:\ORACLE\ORADATA\MY\EXAMPLE01.DBF

6 Full 4358741 12-JUL-09 C:\ORACLE\ORADATA\MY\UNDO NEW 01.DBF

7 Full 4358741 12-JUL-09 C:\ORACLE\ORADATA\MY\SMALL01.DBF

8 Full 4358741 12-JUL-09 C:\ORACLE\ORADATA\MY\SMALLTWO.DBF

9 Full 4358741 12-JUL-09 C:\ORACLE\ORADATA\MY\SMALL THREE01.DBF

Also, you can query the V$BACKUP_SET and V$BACKUP_PIECE views as seen in the example query that follows. You can also substitute the RC* views to retrieve this same information from the recovery catalog schema.

select a.set stamp, a.set count, a.backup type, a.pieces, b.piece#, a.keep until, a.keep options

from v$backup set a, v$backup piece b

where a.set stamp b.set stamp

and a.set count b.set count

and a.keep 'YES';

SET STAMP SET COUNT B PIECES PIECE# KEEP UNTIL KEEP OPTION

691981428 26 D 1 1 01/08/2010 01:03:48 BACKUP LOGS

691982114 27 D 1 1 01/08/2010 01:15:13 BACKUP LOGS

691982117 28 L 1 1 01/08/2010 01:15:17 BACKUP LOGS

691982121 29 D 1 1 01/08/2010 01:15:20 BACKUP LOGS

691982247 30 D 1 1 01/08/2010 01:17:26 BACKUP LOGS

691983183 31 D 1 1 01/08/2010 01:33:02 BACKUP LOGS

691983206 32 L 1 1 01/08/2010 01:33:25 BACKUP LOGS

691983252 33 D 1 1 01/08/2010 01:34:11 BACKUP LOGS

692023212 36 D 1 1 10/20/2009 12:40:12 LOGS

692024018 37 D 1 1 10/20/2009 12:40:12 LOGS

692056970 47 D 1 1 01/08/2010 22:02:50 LOGS

692057685 48 D 1 1 01/08/2010 22:02:50 LOGS

Archive Log Deletion Policies

Starting in Oracle Database 11
g
Release 1, you can configure a retention policy for archived redo logs beyond just Oracle Standby Databases (see Chapter 21 for more on RMAN and Oracle Standby Databases). Starting with Oracle Database 11
g
Release 1, you can configure retention policies that apply to normal archived redo logs.

Other books

Elphame's Choice by P.C. Cast
Rebirth of the Seer by Peter W. Dawes
Chasing Mrs. Right by Katee Robert
Drake of Tanith (Chosen Soul) by Heather Killough-Walden
The Dragon Revenant by Katharine Kerr
Horsekeeping by Roxanne Bok
The Amateurs by Marcus Sakey
The Duke's Last Hunt by Rosanne E. Lortz