Backup CATALOG简析(一)

2014-11-24 16:49:33 · 作者: · 浏览: 4
Backup CATALOG简析
DELETE OBSOLETE RECOVERY WINDOW OF 7 DAYS
BACKUP
INCREMENTAL LEVEL 0
MAXSETSIZE 10M
DATABASE
TAG 'BACKUP_1';
CONFIGURE BACKUP OPTIMIZATION ON
CONFIGURE ARCHIVELOG DELETION POLICY
TO BACKED UP 1 TIMES TO SBT;
DELETE
ARCHIVELOG ALL
BACKED UP 2 TIMES TO DEVICE TYPE sbt;
CHANGE BACKUP OF ARCHIVELOG TAG SECOND_COPY UNAVAILABLE;
BACKUP DATABASE
SKIP INACCESSIBLE
SKIP READONLY
SKIP OFFLINE;
Performing Block Media Recovery
###############################
To recover specific data blocks
===============================
RECOVER
DATAFILE 8 BLOCK 13
DATAFILE 2 BLOCK 199
FROM TAG mondayam;
To recover all blocks logged in V$DATABASE_BLOCK_CORRUPTION
===========================================================
RECOVER CORRUPTION LIST;
make a backup with tag
======================
backup as backupset
database device type disk
format '/disk1/backup_%U'
tag mondaybkp;
Making Compressed Backups
=========================
The following example backs up the database, switches the online redo logs, and includes archived logs in the backup:
By archiving the logs immediately after the backup, you ensure that you have a full set of archived logs through the time of the backup. In this way, you guarantee that you can perform media recovery after restoring this backup.
backup as compressed backupset
database plus archivelog;
Backing Up Tablespaces and Datafiles with RMAN
==============================================
RMAN automatically backs up the control file and the server parameter file (if the instance was started with a server parameter file) when datafile 1 is included in the backup. If control file autobackup is enabled, then RMAN writes the current control file and server parameter file to a separate autobackup piece. Otherwise, RMAN includes these files in the backup set that contains datafile 1.
backup device type sbt
tablesapce users, tools;
backup device type sbt
datafile 1,2,3
To manually back up the control file
====================================
backup device type sbt
tablespace users
include current controlfile;
BACKUP AS COPY
CURRENT CONTROLFILE
FORMAT '/tmp/control01.ctl';
To back up the server parameter file
====================================
backup device type sbt spfile;
Archived Redo Log Failover
==========================
The archived redo log failover feature enables RMAN to complete a backup even when some archiving destinations are missing logs or contain logs with corrupt blocks.
Online Redo Log Switching
=========================
Another important RMAN feature is automatic online redo log switching. To make an open database backup of archived redo logs that includes the most recent online redo log, you can execute the BACKUP command with any of the following clauses:
PLUS ARCHIVELOG
ARCHIVELOG ALL
ARCHIVELOG FROM ...
Before beginning the backup, RMAN switches out of the current redo log group, and archives all online redo logs that have not yet been archived, up to and including the redo lo