You are on page 1of 69

Bhaskar Reddy Page 1 12/7/2021

General

Note:$ORACLE_HOME/rdbms/admin/prgrmanc.sql
Encryption Algorithms

col algorithm_name DBA_HIST_INSTANCE_RECOVERY GV_$RECOVERY_STATUS


format a15 DBA_RECOVERABLE_SCRIPT V_$FLASH_RECOVERY_AREA_USAGE
col algorithm_description DBA_RECOVERABLE_SCRIPT_BLOCKS V_$INSTANCE_RECOVERY
format a25
DBA_RECOVERABLE_SCRIPT_ERRORS V_$RECOVER_FILE
SELECT * FROM DBA_RECOVERABLE_SCRIPT_PARAMS V_$RECOVERY_FILE_DEST
gv$rman_encryption_algor GV_$INSTANCE_RECOVERY V_$RECOVERY_FILE_STATUS
ithms; GV_$RECOVER_FILE V_$RECOVERY_LOG
The default encryption GV_$RECOVERY_FILE_STATUS V_$RECOVERY_PROGRESS
algorithm is 128-bit AES. GV_$RECOVERY_LOG V_$RECOVERY_STATUS
Data Dictionary Objects GV_$RECOVERY_PROGRESS  

Format Description
Format Directives
%a Current database activation id
%A Zero-filled activation ID
The copy number of the backup piece within a set of duplexed backup pieces.bMaximum
%c
value is 256
%d Database name
%D Current day of the month from the Gregorian calendar in format DD
%e Archived log sequence number
%f Absolute file number
%F Combines the DBID, day, month, year, and sequence into a unique and repeatable
generated name

1
Bhaskar Reddy Page 2 12/7/2021

%h Archived redo log thread number


%I DBID
%M Month in the Gregorian calendar in the format MM
%n Database name, padded on the right with x characters to a total length of eight characters
%N Tablespace name. Only valid when backing up datafiles as image copies.
%p Piece number within the backup set. This value starts at 1 for each backup set and is
incremented by 1 for each backup piece created. If a PROXY is specified, the %p variable
must be included in the FORMAT string either explicitly or implicitly within %U.
%r Resetlogs ID
%s Backup set number. This number is a counter in the control file that is incremented for
each backup set. The counter value starts at 1 and is unique for the lifetime of the control
file. If you restore a backup control file, then duplicate values can result. CREATE
CONTROLFILE initializes the counter at 1.
%S Zero-filled sequence number
%t Backup set time stamp, a 4-byte value derived as the number of seconds elapsed since a
fixed reference time. The combination of %s and %t can be used to form a unique name
for the backup set.
%T Year, month, and day in the Gregorian calendar in the format: YYYYMMDD
An 8-character name constituted by compressed representations of the backup set or
%u
image copy number and the time the backup set or image copy was created
%U A system-generated unique filename (default). %U is different for image copies and
backup pieces. For a backup piece, %U is a shorthand for %u_%p_%c and guarantees
uniqueness in generated backup filenames. For an image copy of a datafile, %U means
the following:
data-D-%d_id-%I_TS-%N_FNO-%f_%u
For an image copy of an archived redo log, %U means the following:
arch-D_%d-id-%I_S-%e_T-%h_A-%a_%u
For an image copy of a control file, %U means the following:
cf-D_%d-id-%I_%u

2
Bhaskar Reddy Page 3 12/7/2021

%Y Year in this format: YYYY


%% Percent (%) character. For example, %%Y translates to the string %Y

Repository Initialization compatible=10.2.0


Parameters log_archive_format=RMAN_%s_%r_%d.arc
remote_login_passwordfile=SHARED
show parameter archive_format
-- as root
$ unmount /mnt

$ mkdir /u01
$ chown oracle:dba /u01
$ chmod 755 /u01

$ cd /etc

$ vi fstab

192.168.2.200:/vol/vol1/alpha1 /u01 nfs


rw,bg,intr,hard,rsize=32768,wsize=32768,noac,nolock,tcp,vers=3 0 0
/* as Linux user oracle modify the TNSNAMES.ORA to point to the database that will host the
Create RMAN Repository repository catalog: Then ... */
and Catalog
$ sqlplus / as sysdba

-- using OMF

SQL> CREATE TABLESPACE cat_tbs;

SQL> CREATE USER repoomega


     IDENTIFIED BY oracle1
     DEFAULT TABLESPACE cat_tbs

3
Bhaskar Reddy Page 4 12/7/2021

     TEMPORARY TABLESPACE temp


     QUOTA UNLIMITED ON cat_tbs;

RMAN> GRANT create session TO repoomega


RMAN> GRANT recovery_catalog_owner TO repoomega;
RMAN> GRANT execute ON dbms_stats TO repoomega;  -- for demos

-- in the operating system shell


$ rman target / catalog repoomega/oracle1@repos

RMAN> create catalog tablespace cat_tbs;

RMAN> register database;

RMAN> report schema;

RMAN> configure default device type to disk;


RMAN> configure device type disk parallelism 2 backup type to copy;
RMAN> configure retention policy to recovery window of 7 days;
RMAN> configure backup optimization on;
/* as Linux user oracle modify the TNSNAMES.ORA to point to the database that will host the
Put the database into repository catalog: Then ... */
ARCHIVELOG mode
$ sqlplus / as sysdba

col name format a30


col value format a30

SELECT name, value


FROM gv$parameter
WHERE name LIKE '%arch%';

-- alter the SPFILE as required


shutdown immediate;

4
Bhaskar Reddy Page 5 12/7/2021

startup mount;

alter database archivelog;

alter database open;

archive log list;

alter system switch logfile;

archive log list;


RMAN> BACKUP TAG
Q107 DATABASE KEEP
FOREVER;
Commands
@

Execute a series of script of RMAN commands stored in an operating system file. Do not leave whitespace between the @ and
filename.
@<path_and_file_name> rman TARGET / @backup_db.rcv

or

RMAN> RUN { @backup_db.rman }

@@
Execute script files located in the same directory as the file from which it has been called
@@<path_and_file_name TBD

5
Bhaskar Reddy Page 6 12/7/2021

>
ADVISE FAILURE
Displays repair options for the specified failures. Prints a summary of the failures identified by the Data Recovery Advisor and
implicitly closes all open failures that are already fixed.
ADVISE FAILURE <ALL | RMAN> LIST FAILURE;
CRITICAL | HIGH | LOW | RMAN> ADVISE FAILURE ALL;
failure_number_list> RMAN> REPAIR FAILURE;
EXCLUDE FAILURE
<failure_number_list>
ALLOCATE CHANNEL
To manually allocate a channel, which is a connection between RMAN and a database instance. Each connection initiates an
database server session on the target or auxiliary instance: this server session performs the work of backing up, restoring, or
recovering RMAN backups.

Manually allocated channels (allocated by using ALLOCATE) should be distinguished from automatically allocated channels
(specified by using CONFIGURE). Manually allocated channels apply only to the RUN job in which you issue the command.
Automatic channels apply to any RMAN job in which you do not manually allocate channels. You can always override automatic
channel configurations by manually allocating channels within a RUN command.

Each channel operates on one backup set or image copy at a time. RMAN automatically releases the channel at the end of the
job.

You can control the degree of parallelism within a job by allocating the desired number of channels. Allocating multiple
channels simultaneously allows a single job to read or write multiple backup sets or disk copies in parallel. If you establish
multiple connections, then each connection operates on a separate backup set or disk copy.

Whether ALLOCATE CHANNEL causes operating system resources to be allocated immediately depends on the operating
system. On some platforms, operating system resources are allocated at the time the command is issued. On other platforms,
operating system resources are not allocated until you open a file for reading or writing.
Allocating a Single Backup Channel

6
Bhaskar Reddy Page 7 12/7/2021

Allocate a disk channel


ALLOCATE [AUXILIARY] SQL> desc gv$backup_device
CHANNEL
<channel_name> [, SQL> SELECT * FROM gv$backup_device;
<channel_id>, DEVICE
TYPE RMAN> RUN {
<device_type_name>[allo   ALLOCATE CHANNEL d1 DEVICE TYPE DISK
cation_operand_list]   FORMAT '/u01/backups/%U';
  BACKUP DATABASE PLUS ARCHIVELOG;
  RELEASE CHANNEL;
}
RMAN RUN {
  ALLOCATE CHANNEL tape1 DEVICE TYPE sbt; 
  BACKUP DATABASE PLUS ARCHIVELOG;
  RELEASE CHANNEL;
}
Spread the backup across
several disk
RUN {
drives. Allocate one
  ALLOCATE CHANNEL d1 DEVICE TYPE DISK FORMAT '/u01/backups/%U'; 
DEVICE TYPE DISK
  ALLOCATE CHANNEL d2 DEVICE TYPE DISK FORMAT '/u02/backups/%U';
channel for ach disk drive
  BACKUP DATABASE PLUS ARCHIVELOG;
and specify the format
  RELEASE CHANNEL;
string so that the
}
filenames are on different
disks
When creating multiple RUN {
copies of a backup, you   ALLOCATE CHANNEL c1 DEVICE TYPE DISK MAXPIECESIZE 5M;
can specify the SET   # AS COPY is the default, so RMAN creates image copies
BACKUP   BACKUP DATABASE PLUS ARCHIVELOG;
COPIES command. The   SET BACKUP COPIES = 2;
following example   BACKUP DATAFILE 1 FORMAT '/u01/backups/%U', '/u02/backups/%U';
generates a single backup }

7
Bhaskar Reddy Page 8 12/7/2021

of the database to disk,


and then creates two
identical backups of
datafile 1 to two different
file systems
Allocate Maintenance
Channel
*Allocates a channel in preparation for a CHANGE, DELETE, or CROSSCHECK. This cannot be used within a RUN block.
ALLOCATE CHANNEL FOR RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;|
MAINTENANCE DEVICE
TYPE <device_specifier>
[allocation_operand_list];
ALTER CLONE
?
TBD
ALTER CLONE ....

ALTER DATABASE

Mount and open the database


ALTER DATABASE RMAN> STARTUP NOMOUNT;
<MOUNT | OPEN | OPEN RMAN> ALTER DATABASE MOUNT;
RESETLOGS>; RMAN> BACKUP DATABASE;
RMAN> ALTER DATABASE OPEN;
RUN {
  ALLOCATE CHANNEL ch1 DEVICE TYPE sbt;
  SET UNTIL SCN 1024;
  RESTORE DATABASE;
  RECOVER DATABASE;
  ALTER DATABASE OPEN RESETLOGS;

8
Bhaskar Reddy Page 9 12/7/2021

}
 
BACKUP
-- Back up a database, tablespace, datafile (current or copy), control file (current or copy), SPFILE, archived log, or backup
set.

BACKUP <BackupOperand> CHANNEL '<channel_id>' CHECK LOGICAL COPIES <integer>


CUMULATIVE DEVICE TYPE <deviceSpecifier> DISKRATIO <integer> DURATION
<FileNameConversionSpecification> FILERPERSET <integer> FORCE
< AUXILIARY FORMAT <formatSpec, NEW> | FORMAT <formatSpec>
<forRecoveryOfSpec>
FULL
<keep option>
MAXSETSIZE <sizeSpec>
<notBackedUpSpec>
NO CHECKSUM NO EXCLUDE POOL <integer> PROXY [ONLY] REUSE SECTION SIZE <sizeSpec> <skipSpec>
TAG '<tag_name>' VALIDATE
-- Back up a database, tablespace, datafile (current or copy), control file (current or copy), SPFILE, archived log, or backup
set.

BACKUP <BackupOperand> CHANNEL '<channel_id>' CHECK LOGICAL COPIES <integer>


CUMULATIVE DEVICE TYPE <deviceSpecifier> DISKRATIO <integer> DURATION
<FileNameConversionSpecification> FILERPERSET <integer> FORCE
< AUXILIARY FORMAT <formatSpec, NEW> | FORMAT <formatSpec>
<forRecoveryOfSpec>
INCREMENTAL <LEVEL | FROM SCN> <integer>
<keep option>
MAXSETSIZE <sizeSpec>
<notBackedUpSpec>
NO CHECKSUM NO EXCLUDE POOL <integer> PROXY [ONLY] REUSE SECTION SIZE <sizeSpec> <skipSpec>
TAG '<tag_name>' VALIDATE
BACKUP ARCHIVELOG

9
Bhaskar Reddy Page 10 12/7/2021

Backs up copy of each distinct log sequence number

BACKUP ARCHIVELOG RMAN> BACKUP ARCHIVELOG ALL;


<ALL | ...> ....

?
TBD
BACKUP AUXILIARY ....

In the first RMAN places datafiles 3 through 7 into one backup set and datafiles 8 and 9 into another. In the second all datafiles
go into a single backup set.
BACKUP AS BACKUPSET BACKUP AS BACKUPSET (DATAFILE 3, 4, 5, 6, 7) (DATAFILE 8, 9);
DEVICE TYPE
<device_identifier> BACKUP AS BACKUPSET DATAFILE 3, 4, 5, 6, 7, 8, 9;
COPIES <integer>
DATABASE FORMAT
'<location_and_format>' .
...

Create two copies of a compressed


backupset.
BACKUP AS COMPRESSED BACKUP AS COMPRESSED BACKUPSET DEVICE TYPE DISK COPIES 2
BACKUPSET DEVICE TYPE DATABASE FORMAT '/u01/db_%U', '/u02/db_%U';
<device_identifier>
COPIES <integer>
DATABASE FORMAT
'<location_and_format>'

Backing up as an image copy


BACKUP AS COPY RUN {
<backup_specification> ...   ALLOCATE CHANNEL dev1 DEVICE TYPE DISK FORMAT '/u01/%U';
.   ALLOCATE CHANNEL dev2 DEVICE TYPE DISK FORMAT '/u02/%U';

10
Bhaskar Reddy Page 11 12/7/2021

  BACKUP AS COPY TABLESPACE system, tools, users, undotbs;


  BACKUP AS COPY CURRENT CONTROLFILE;
}

?
TBD
BACKUP BLOCKS ....

Manually allocate a channel, in order to specify that the backup run by this channel should go to both pools first_copy and
second_copy.

Back up only logs without 2 backups on disk


BACKUP CHANNEL RUN {
'<channel_id>' ....   ALLOCATE CHANNEL d2 DEVICE TYPE DISK
  PARMS='ENV=(NSR_DATA_VOLUME_POOL=first_copy)';

  ALLOCATE CHANNEL d1 DEVICE TYPE DISK


  PARMS='ENV=(NSR_DATA_VOLUME_POOL=second_copy)';

  BACKUP CHANNEL d1 ARCHIVELOG UNTIL TIME 'SYSDATE'


  NOT BACKED UP 2 TIMES TAG SECOND_COPY;

  BACKUP CHANNEL d2 ARCHIVELOG UNTIL TIME 'SYSDATE'


  NOT BACKED UP 2 TIMES TAG FIRST_COPY;
}

SET MAXCORRUPT indicates that  no more than 1 corruption should be tolerated in each datafile. Because the CHECK LOGICAL
option is specified on the BACKUP command, RMAN checks for both physical and logical corruption.
BACKUP CHECK RUN {
[LOGICAL]   SET MAXCORRUPT FOR DATAFILE 5,6,7,8 TO 1;

11
Bhaskar Reddy Page 12 12/7/2021

<database_specifications>   BACKUP CHECK LOGICAL DATABASE;


}

BACKUP TBD
CONTROLFILECOPY ....

?
TBD
BACKUP COPY ....

Define the number of backup copies to create


BACKUP COPIES RUN {
<integer> ....   BACKUP COPIES 2 DEVICE TYPE sbt BACKUPSET ALL;
}

BACKUP TBD
CUMMULATIVE ....

Backup the current Control File to the default or specified location


BACKUP CURRENT RUN {
CONTROLFILE [TO   BACKUP CURRENT CONTROLFILE TO DESTINATION '/u01/backups';
DESTINATION }
<destination_path>];

Backup Database

12
Bhaskar Reddy Page 13 12/7/2021

RUN {
  ALLOCATE CHANNEL d1
RUN {
DEVICE TYPE DISK;
  ALLOCATE CHANNEL d1 DEVICE TYPE DISK;
  BACKUP DATABASE;
  BACKUP DATABASE PLUS ARCHIVELOG;
}
}
Backup Database Plus
Archivelog
BACKUP DATAFILE

Datafile backup to multiple locations


BACKUP DATAFILE RUN {
<integer> [FORMAT   ALLOCATE CHANNEL d1 DEVICE TYPE DISK;
'<location_and_name_for   BACKUP DATAFILE 1 FORMAT '/u01/backups/%U', '/u02/backups/%U';
mat>']   BACKUP DATAFILE 6 TO '/u01/backups', '/u02/backups';
}
BACKUP DATAFILE
<integer> [TO
'<location>']
?

BACKUP TBD
DATAFILECOPY ....

?
BACKUP TBD
DB_FILE_NAME_CONVERT
....
?
BACKUP TBD
DB_RECOVERY_FILE_DES
T ....

13
Bhaskar Reddy Page 14 12/7/2021

RMAN locates all datafile copies with the tag LATESTCOPY, backs them up to tape, and names the backups by means of
substitution variables. After the datafile copies are on tape, the example deletes all image copies with the tag LATESTCOPY.
BACKUP DEVICE TYPE RMAN> {
<DISK | SBT> ....   BACKUP DEVICE TYPE sbt
  DATAFILECOPY FROM TAG 'LATESTCOPY' FORMAT 'Datafile%f_Database%d';

  DELETE COPY TAG 'LATESTCOPY';


}

Populate each backup set with datafiles from the specified number of disks. To disable set to 0.
RMAN> BACKUP
DISKRATIO 0; -- disable

RMAN> BACKUP
DISKRATIO 5; --
enableBACKUP
DURATION
Backup will stop if it is not completed in the specified duration
BACKUP DURATION RMAN> BACKUP DURATION 3:30 DATABASE;
<HH:MI>
<backup_specification>
[MINIMIZE <LOAD |
TIME>]
BACKUP DURATION
<HH:MI>
<backup_specification>
PARTIAL
?
TBD
BACKUP FILE ....

14
Bhaskar Reddy Page 15 12/7/2021

?
TBD
BACKUP FILESPERSET ....

This command will give me a level 1 backup to be used to recover level 0 backup to the latest level
RMAN > BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'incr_upd' DATABASE
FORMAT '/oradata/rman/161932/inc_%d_%T_%t_%s_%p';

BACKUP ... FOR RECOVER RUN {


OF COPY WITH TAG ....   RECOVER COPY OF DATABASE WITH TAG 'incr_update' UNTIL TIME 'SYSDATE-7';
  BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'incr_upd'
  DATABASE;
}
BACKUP FORCE
Forces RMAN to ignore backup optimization even if CONFIGURE BACKUP OPTIMIZATION is ON
BACKUP FORCE RMAN> BACKUP FORCE DATABASE;
<backup_specification>

Specify Backup Format


BACKUP FORMAT RMAN> BACKUP FORMAT = 'UW_%d/%t/%s/%p' ARCHIVELOG LIKE '%arc_dest%';
<format_specification> ...
.
?
TBD
BACKUP FROM ....

Creates a backup of all blocks of datafiles included in the backup


RMAN> BACKUP FULL;
BACKUP FULL

15
Bhaskar Reddy Page 16 12/7/2021

Incremental Backup Level 0


BACKUP INCREMENTAL BACKUP INCREMENTAL LEVEL 0 DATABASE;
LEVEL <level_number>
BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE;
[CUMULATIVE |
BACKUP INCREMENTAL LEVEL 1 DIFFERENTIAL TABLESPACE users;
DIFFERENTIAL> ....
BACKUP INCREMENTAL LEVEL 1 CUMULATIVE SKIP INACCESSIBLE DATABASE;

Copies two datafiles and


BACKUP KEEP <FOREVER | UNTIL TIME 'date_string' [RESTORE POINT <restore_point_name>]
exempts them from the
retention policy forever
RMAN> SHUTDOWN IMMEDIATE;
RMAN> STARTUP MOUNT;

RMAN> BACKUP KEEP FOREVER FORMAT '?/dbs/%U_longterm.cpy'


TAG LNGTRM_BCK DATAFILE 5 DATAFILE 6;

RMAN> ALTER DATABASE OPEN;

?
TBD
BACKUP KEEP ....

?
TBD
BACKUP MAXSETSIZE ....

?
BACKUP NOCHECKSUM .... TBD

16
Bhaskar Reddy Page 17 12/7/2021

?
TBD
BACKUP NOEXCLUDE ....

?
TBD
BACKUP NOKEEP ....

?
TBD
BACKUP NOT ....

?
TBD
BACKUP PROXY ....

?
TBD
BACKUP POOL ....

?
TBD
BACKUP RECOVERY ....

?
TBD
BACKUP REUSE ....

17
Bhaskar Reddy Page 18 12/7/2021

TBD
BACKUP SECTION ....

?
TBD
BACKUP SETSIZE ....

BACKUP SKIP TBD


READONLY ....

Backup the Server Parameter file to the default or specified location


BACKUP SPFILE [TO RMAN> BACKUP SPFILE TO DESTINATION '/u01/backups';
DESTINATION
<destination_path>]
Backup the database and apply a user specified tag

BACKUP TAG RMAN> BACKUP TAG 'weekly_full_db_bkup' DATABASE MAXSETSIZE 10M;


'<tag_name>' ....

?
TBD
BACKUP TABLESPACE ....

?
TBD
BACKUP TO ....

?
TBD
BACKUP VALIDATE ....

18
Bhaskar Reddy Page 19 12/7/2021

BLOCKRECOVER
Block media recovery recovers an individual data block or set of data blocks within a datafile. This type of recovery is useful if
the data loss or corruption applies to a small number of blocks rather than to an entire datafile.

Typically, block corruption is reported in error messages in trace files. Block-level data loss usually results from:
 I/O errors causing minor data loss
 Memory corruptions that get flushed to disk
BLOCKRECOVER ALLOW
?

BLOCKRECOVER TBD
ALLOW ....

BLOCKRECOVER TBD
ARCHIVELOG ....

BLOCKRECOVER TBD
AUXILIARY ....

BLOCKRECOVER TBD
CHECK ....

BLOCKRECOVER TBD
CLEAR ....

?
BLOCKRECOVER COPY .... TBD

19
Bhaskar Reddy Page 20 12/7/2021

BLOCKRECOVER TBD
CORRUPTION ....

BLOCKRECOVER TBD
DATABASE ....

Recover corrupt blocks in 3 data files


BLOCKRECOVER DATAFILE RMAN> BLOCKRECOVER DATAFILE 2 BLOCK 12,13;
<data_file_number>
BLOCK <block_list> RMAN> BLOCKRECOVER DATAFILE 2 BLOCK 12,13 DATAFILE 3 BLOCK 5,98,99
      DATAFILE 4 BLOCK 19;
BLOCKRECOVER DATAFILE <data_file_number> BLOCK <block_list> TABLESPACE
<tablespace_name> FROM DATAFILECOPY
RUN {
  BLOCKRECOVER DATAFILE 3 BLOCK 2,3,4,5 TABLESPACE sales DBA 4194405, 4194409, 4194412
  FROM DATAFILECOPY;
}

BLOCKRECOVER TBD
DATAFILECOPY ....

BLOCKRECOVER TBD
DELETE ....

20
Bhaskar Reddy Page 21 12/7/2021

BLOCKRECOVER TBD
DEVICE ....

BLOCKRECOVER EXCLUDE TBD


....

?
TBD
BLOCKRECOVER FROM ....

BLOCKRECOVER TBD
NOFILEUPDATE ....

BLOCKRECOVER TBD
NOPARALLEL ....

BLOCKRECOVER TBD
NOREDO ....

BLOCKRECOVER PARALLEL TBD


....

?
BLOCKRECOVER PREVIEW TBD

21
Bhaskar Reddy Page 22 12/7/2021

....
?

BLOCKRECOVER RESTORE TBD


....

?
TBD
BLOCKRECOVER SAVE ....

BLOCKRECOVER SKIP TBD


READONLY ....

?
TBD
BLOCKRECOVER SAVE ....

Limit block recovery by backup tag


BLOCKRECOVER BLOCKRECOVER TABLESPACE SYSTEM DBA 4194404, 4194405 FROM TAG "weekly_backup";
TABLESPACE
<tablespace_name> ... BLOCKRECOVER TABLESPACE <tablespace_name> ...

BLOCKRECOVER TABLESPACE SYSTEM DBA 4194404, 4194405 RESTORE UNTIL TIME 'SYSDATE-2';
BLOCKRECOVER CORRUPTION LIST
BACKUP VALIDATE DATABASE;
BLOCKRECOVER CORRUPTION LIST;

22
Bhaskar Reddy Page 23 12/7/2021

TBD
BLOCKRECOVER TEST ....

?
TBD
BLOCKRECOVER UNDO ....

BLOCKRECOVER TBD
VALIDATE ....

CATALOG
Adds information about file copies and user-managed backups to the repository
CATALOG ARCHIVELOG
Back the named archive log

CATALOG ARCHIVELOG RMAN> CATALOG ARCHIVELOG '


'<file_name_list>'

Catalogs the backups specified


RMAN> CATALOG BACKUP ...
CATALOG BACKUP ...

Catalogs the backup pieces in the new location


CATALOG BACKUPPIECE RMAN> CATALOG BACKUPPIECE '/u01/c-874220581-20080315-01'; USING
<file_name_list>       target database control file instead of recovery catalog
      cataloged backup piece backup piece
      handle=/u01/c-874220581-20080315-01 RECID=8
      STAMP=607695990;

23
Bhaskar Reddy Page 24 12/7/2021

?
TBD
CATALOG CLONE ...

Catalog the control files identified

CATALOG RMAN> COPY CURRENT CONTROLFILE TO '/stage';


CONTROLFILECOPY
<controlfilecopy_name_lis RMAN> CATALOG CONTROLFILECOPY '/stage/control01.ctl'
t>

Specifies that the datafile copy should be recorded as a level 0 incremental backup (0 is the only valid value of LEVEL)
RMAN> CATALOG DATAFILECOPY '/stage/users01.dbf';
DATAFILECOPY  RMAN> CATALOG DATAFILECOPY '/u02/backup/users01.bak' LEVEL 0;
<file_name_list> LEVEL RMAN> LIST COPY;
<integer>

Catalog the Backup Pieces held in the location set by  DB_RECOVERY_FILE_DEST
CATALOG RMAN> CATALOG DB_RECOVERY_FILE_DEST;
DB_RECOVERY_FILE_DES
T
?
TBD
CATALOG DEVICE ...

Catalog all files in the currently enabled flash recovery area

CATALOG RECOVERY RMAN> CATALOG RECOVERY AREA;


AREA

Catalog all files in a named disk location


CATALOG START WITH RMAN> CATALOG START WITH '/u02/archivelog' NOPROMPT;

24
Bhaskar Reddy Page 25 12/7/2021

<path_name>
[NOPROMPT]
CHANGE
To make the following changes:
 To change the status of backups, copies, and archived logs in the repository to AVAILABLE or UNAVAILABLE. This
feature is useful when a previously unavailable file is made available again, or you do not want a specific backup or copy to be
eligible to be restored but also do not want to delete it.
 To alter the repository status of usable backups and copies from prior incarnations.
 To remove catalog records for backups and copies, and update the corresponding records in the target control file to
status DELETED. This feature is useful when you remove a file by using an operating system command rather than the RMAN
CHANGE command, and want to remove its repository record as well.
 To specify that a backup or copy should either abide by the currently configured retention policy or be exempt from it.
CHANGE ARCHIVELOG

Move all archived logs to a new directory, uncatalog them, and then recatalog them in the new location
CHANGE ARCHIVELOG ... HOST 'mv $ORACLE_HOME/oradata/trgt/arch/* /fs2/arch';
CHANGE ARCHIVELOG ALL UNCATALOG;
CATALOG START WITH '/fs2/arch';

Change the status of all backups of server parameter files created more than a day ago to UNAVAILABLE
CHANGE BACKUP ... CHANGE BACKUP OF SPFILE COMPLETED BEFORE 'SYSDATE-1' UNAVAILABLE;

CHANGE BACKUP OF ARCHIVELOG ALL NOKEEP;

Change the status a backup set


CHANGE BACKUPSET ... CHANGE BACKUPSET 42 UNAVAILABLE;
CHANGE BACKUPSET ...

25
Bhaskar Reddy Page 26 12/7/2021

CHANGE BACKUP TAG 'consistent_db_bkup' KEEP FOREVER NOLOGS;

CHANGE TBD
CHANGEFAILURE ...

CHANGE TBD
CONTROLFILECOPY ...

?
TBD
CHANGE COPY ...

CHANGE TBD
DATAFILECOPY ...

?
CHANGE TBD
DB_UNIQUE_NAME_FROM
...
CONFIGURE
To configure persistent settings affecting RMAN backup, restore, duplication, and maintenance jobs. These configurations are in
effect for any RMAN session until the configuration is cleared or changed.

Configuration Defaults
$ rman

26
Bhaskar Reddy Page 27 12/7/2021

RMAN> SHOW ALL

RMAN> CONFIGURE
ARCHIVELOG BACKUP
COPIES FOR DEVICE TYPE
DISK TO 1;
RMAN> CONFIGURE
ARCHIVELOG DELETION
POLICY TO NONE;
RMAN> CONFIGURE
BACKUP OPTIMIZATION
OFF;
RMAN> CONFIGURE
CONTROLFILE
AUTOBACKUP OFF;
RMAN> CONFIGURE
CONTROLFILE
AUTOBACKUP FORMAT
FOR DEVICE TYPE DISK
TO '%F';
RMAN> CONFIGURE
DATAFILE BACKUP COPIES
FOR DEVICE TYPE DISK
TO 1;
RMAN> CONFIGURE
DEFAULT DEVICE TYPE TO
DISK;
RMAN> CONFIGURE
DEVICE TYPE DISK
PARALLELISM 1 BACKUP
TYPE TO BACKUPSET;
RMAN> CONFIGURE
ENCRYPTION FOR
DATABASE OFF;

27
Bhaskar Reddy Page 28 12/7/2021

RMAN> CONFIGURE
ENCRYPTION ALGORITHM
'AES128';
RMAN> CONFIGURE
MAXSETSIZE TO 2 G;
RMAN> CONFIGURE
RETENTION POLICY TO
REDUNDANCY 1;
RMAN> CONFIGURE
SNAPSHOT CONTROLFILE
NAME TO
     
'/app/oracle/product/flash
_recovery_area/snapshot.
ctl';CONFIGURE
AUXILIARY
?
CONFIGURE AUXILIARY RMAN> CONFIGURE AUXILARY
CHANNEL <DEVICE,
INTEGER> ....

Set and clear an auxiliary name for a datafile


CONFIGURE AUXNAME RMAN> CONFIGURE AUXNAME FOR DATAFILE 5 TO '/home/oracle/auxfiles/aux1.f';
FOR DATAFILE
<data_file_number> TO RMAN> CONFIGURE AUXNAME FOR DATAFILE 4 CLEAR;
<path_and_file_name>
CONFIGURE AUXNAME
FOR DATAFILE CLEAR
?
CONFIGURE CHANNEL RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' CLEAR;
<DEVICE TYPE |
CONFIGURE CLONENAME ....

28
Bhaskar Reddy Page 29 12/7/2021

INTEGER> <configuration
RMAN> CONFIGURE CLONENAME

CONFIGURE RMAN> CONFIGURE COMPATIBLE


COMPATIBLE ....

Configure a backup compression algorithm


CONFIGURE SELECT algorithm_name, algorithm_description
COMPRESSION FROM v$rman_compression_algorithm;
ALGORITHM <CLEAR |
'<quoted_string>'> RMAN> CONFIGURE COMPRESSION ALGORITHM 'ZLIB';

Enable autobackup and configure  the default autobackup format for a DISK device
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE
AUTOBACKUP CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u02/%F';

?
CONFIGURE TBD
DB_UNIQUE_NAME
'<db_unique_name>'
<CLEAR | CONNECT CONFIGURE ENCRYPTION ALGORITHM <CLEAR | encryption_algorithm>
IDENTIFIER
'<quoted_string>'>
SQL> col algorithm_name format a20

29
Bhaskar Reddy Page 30 12/7/2021

SQL> col algorithm_description format a25

SQL> SELECT algorithm_name, algorithm_description


     FROM v$rman_encryption_algorithms;

RMAN> CONFIGURE ENCRYPTION ALGORITHM 'AES256';

RMAN> CONFIGURE ENCRYPTION CLEAR;


CONFIGURE ENCRYPTION FOR <DATABASE | TABLESPACE <tablespace_name>>
<ON | OFF | CLEAR>
RMAN> CONFIGURE ENCRYPTION FOR DATABASE ON;

RMAN> CONFIGURE ENCRYPTION FOR TABLESPACE uwdata OFF;


CONFIGURE EXCLUDE ...
TBD

CONNECT
Creates a connection between RMAN and a target, auxiliary, or recovery catalog database
Auxiliary
CONNECT AUXILIARY $ rman auxiliary oracle/oracle1@prodb
<user_id>/<password>@
<instance> CONNECT

$ rman catalog repoomega/oracle1@repos

$ rman
RMAN> connect catalog repoomega/oracle1@repos
CONNECT TARGET <user_id>/<password>@<instance>
$ rman target /

30
Bhaskar Reddy Page 31 12/7/2021

$ rman>
RMAN> connect target /  catalog repoomega/oracle1@repos
CONNECT
$ rman target / catalog repoomega/oracle1@repos

$ rman>
RMAN> connect target /  catalog repoomega/oracle1@repos
CONNECT
$ rman

RMAN> connect target omega1/omega1@emrep NOCATALOG

CONVERT
Converts a datafile, tablespace or database to the format of a destination platform, in preparation for transport across different
platforms
CONVERT DATABASE

Uses CONVERT DATABASE NEW DATABASE to convert  datafiles and generate a transport script
CONVERT DATABASE NEW CONVERT DATABASE
DATABASE '<db_name>' NEW DATABASE 'prodb'
TRANSPORT SCRIPT TRANSPORT SCRIPT '/tmp/convertdb/transportscript'
'<script_location>' TO PLATFORM 'Linux IA (64-bit)'
TO PLATFORM DB_FILE_NAME_CONVERT '/u01/oradata', '/stage/dbfiles';
'<platform_name>'
DB_FILE_NAME_CONVERT
'<source_location>
<destination_location>'

31
Bhaskar Reddy Page 32 12/7/2021

Converts the datafiles to be transported to the destination host format and deposits the results in /u02/oradata
CONVERT DATAFILE CONVERT DATAFILE
<datafile_name_list> '/tmp/transport_from_aix/u01/uwdata01.dbf',
DB_FILE_NAME_CONVERT '/tmp/transport_from_aix/u01/uwdata02.dbf',
'<source_location> '/tmp/transport_from_aix/u03/users01.dbf',
<destination_location>' '/tmp/transport_from_aix/u03/users02.dbf'
FROM PLATFORM DB_FILE_NAME_CONVERT
<original_platform_name '/app/oracle/product/oradata','/stage/oradata',
> '/tmp/transport_from_solaris/hr','/stage/oradata'
FROM PLATFORM 'Linux IA (64-bit)';

Convert a tablespaces to 64 bit Linux


CONVERT TABLESPACE desc v$transportable_platform
<tablespace_name_list>
TO PLATFORM SELECT platform_name, endian_format
<platform_name> FROM v$transportable_platform;
FORMAT '<format_string>'
CONVERT TABLESPACE uwdata, users TO PLATFORM 'Linux IA (64-bit)'
FORMAT '/app/oracle/product/flash_recovery_area/linux64/%U';

COPY
?
COPY ARCHIVELOG ... RMAN> COPY ARCHIVELOG
(level, nochecksum,
nokeep, reuse, tag) COPY BACKUP ...

RMAN> COPY BACKUP


COPY CHECK ...
RMAN> COPY CHECK

32
Bhaskar Reddy Page 33 12/7/2021

COPY CONTROLFILECOPY ...


RMAN> COPY CONTROLFILECOPY
COPY CURRENT ...
RMAN> COPY CURRENT
COPY DATAFILE ...
RMAN> COPY DATAFILE
COPY DATAFILECOPY ...
RMAN> COPY DATAFILECOPY
COPY KEEP ...
RMAN> COPY KEEP

CREATE
CREATE CATALOG

Create a recovery catalog or a virtual private catalog


CREATE [VIRTUAL] RMAN> CREATE CATALOG;
CATALOG;
SQL> conn repoomega/oracle1@repos

SQL> SELECT object_type, COUNT(*)


     FROM user_objects;

RMAN> DROP CATALOG;

SQL> SELECT object_type, COUNT(*)


     FROM user_objects;

33
Bhaskar Reddy Page 34 12/7/2021

Create a restore point


RMAN> CREATE RESTORE POINT app_patch;
CREATE RESTORE POINT RMAN> DROP RESTORE POINT app_patch;
<restore_point_name>

Creates a stored script called backup_whole that backs up the database and archived redo logs
CREATE [GLOBAL] SCRIPT CREATE SCRIPT backup_whole 
'<script_name>' COMMENT "backup whole database and logs"
COMMENT '<comment>' {
{RMAN_command_list}   BACKUP INCREMENTAL LEVEL 0 TAG b_whole_l0 
FROM FILE '<file_name>'   DATABASE PLUS ARCHIVELOG;
}
CREATE GLOBAL SCRIPT global_backup_db
COMMENT "backup any database from the recovery catalog, with logs"
{
  BACKUP DATABASE PLUS ARCHIVELOG;
}
 
CROSSCHECK
Verify the status of backups and copies recorded in the RMAN repository against media such as disk or tape. The CROSSCHECK
command only processes files created on the same device type as the channels running the crosscheck.
Status Description
The Object is available for use by RMAN. For a backup set to be AVAILABLE, all set backup pieces must be
AVAILABLE
AVAILABLE.
Object is not found either in file system (for DISK) or in the media manager (for sbt). Note that for a backup
EXPIRED set to be EXPIRED, all backup pieces in the set must be EXPIRED. EXPIRED does not mean the same as
OBSOLETE.
UNAVAILABLE Object is not available for use by RMAN. For a backup set to be UNAVAILABLE, all backup pieces must be

34
Bhaskar Reddy Page 35 12/7/2021

UNAVAILABLE.
The following objects can be crosschecked:
ARCHIVELOG BACKUP BACKUPPIECE BACKUPSET CONTROLFILECOPY COPY DATAFILECOPY PROXY

CROSSCHECK ARCHIVELOG

Allocate a channel and crosscheck all archivelogs


CROSSCHECK RMAN> RUN {
<archivelogRecordSpecifie   ALLOCATE CHANNEL d1 FOR MAINTENANCE DEVICE TYPE DISK;
r>   CROSSCHECK ARCHIVELOG ALL;
  RELEASE CHANNEL;
}

Allocate a channel, crosscheck backups in a date range and release the channel after use
CROSSCHECK BACKUP .... RMAN> RUN {
  ALLOCATE CHANNEL d1 FOR MAINTENANCE DEVICE TYPE DISK;
  CROSSCHECK BACKUP DEVICE TYPE DISK COMPLETED BETWEEN '01-JUL-08' AND '30-SEP-08';
  RELEASE CHANNEL;
}

Checks that specific backuppieces still exist

CROSSCHECK RMAN> CROSSCHECK BACKUPPIECE


BACKUPPIECE ....

Checks that specific backupsets still exist


CROSSCHECK BACKUPSET RMAN> CROSSCHECK BACKUPSET OF TABLESPACE UWDATA;
OF <backupset
identifier>;

35
Bhaskar Reddy Page 36 12/7/2021

Checks for the physical existence of archivelog files and will change the V$ARCHIVED_LOG.STATUS of affected archivelogs
from "A" for AVAILABLE to "X" for EXPIRED. Once the archivelog file has a status of X, RMAN will no longer attempt to backup
this archivelog file.
RMAN> CROSSCHECK COPY OF ARCHIVELOG ALL;
CROSSCHECK COPY ...

Checks that specific controlfile copies still exist

CROSSCHECK RMAN> CROSSCHECK CONTROLFILECOPY


CONTROLFILECOPY ....

Checks that specific bdatafile copies still exist


CROSSCHECK RMAN> CROSSCHECK DATAFILECOPY ALL;
DATAFILECOPY <ALL |
INTEGER | LIKE |
QUOTED_STRING>
Crosscheck all foreign archived redo logs
CROSSCHECK FOREIGN RMAN> CROSSCHECK FOREIGN ARCHIVELOG ALL;
ARCHIVELOG <ALL |
FROM | HIGH | LOGSEQ |
LOW | SCN | SEQUENCE |
TIME | UNTIL> ....
Crosscheck the existence of a specific proxy copy
*RMAN> CROSSCHECK PROXY 941;
CROSSCHECK PROXY

DEBUG
Commands for the RMAN debugger
DEBUG <AFFINITY | ALL | *RMAN> DEBUG ALL;
DUPLICATE | IO | KRB | *RMAN> DEBUG OFF;

36
Bhaskar Reddy Page 37 12/7/2021

MISC | NODEVALS | OFF |


ON | PACKAGES | PLSQL |
RCVCAT | RCVMAN |
RECOVER | RESTORE |
RESYNC | RPC | SQL>
DELETE
To delete physical backups and copies as well as do the following:
 Update their repository records in the target control file to status DELETED
 Remove their repository records from the recovery catalog (if you use a catalog)
When running RMAN interactively, DELETE displays a list of the files and prompts you for confirmation before deleting any file
in the list. When reading commands from a command file, RMAN will not prompt for confirmation.
DELETE ARCHIVELOG
Wildcard Delete
DELETE ARCHIVELOG RMAN> LIST ARCHIVELOG LIKE '%';
<ALL | FROM | HIGH | RMAN> CROSSCHECK ARCHIVELOG LIKE '%';
LIKE | LOGSEQ | LOW | RMAN> DELETE ARCHIVELOG LIKE '%';
QUOTED_STRING | SCN |
SEQUENCE | TIME |
UNTIL> ....
Delete Backup Set
*DELETE NOPROMPT BACKUP OF DATABASE COMPLETED BEFORE 'SYSDATE-7';
?
?
# back up datafile to disk and tape
BACKUP DEVICE TYPE DISK DATAFILE 1 TAG "weekly_bkup";
BACKUP DEVICE TYPE sbt DATAFILE 1 TAG "weekly_bkup";

# manually allocate disk and sbt channels


ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;
ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE SBT;
DELETE BACKUPSET TAG "weekly_bkup";

37
Bhaskar Reddy Page 38 12/7/2021

Deletes expired backup records


DELETE [FORCE | RMAN> CROSSCHECK BACKUP;
NOPROMPT] EXPIRED RMAN> DELETE EXPIRED BACKUP;
<maintenance_spec> [for
db_unique_name_option]; RMAN> CROSSCHECK BACKUPSET OF TABLESPACE uwdata DEVICE TYPE disk COMPLETED BEFORE
SYSDATE-15;

RMAN> DELETE NOPROMPT EXPIRED BACKUPSET OF TABLESPACE uwdata DEVICE TYPE disk
COMPLETED BEFORE SYSDATE-15;

Delete Obsolete
DELETE [FORCE | RMAN> DELETE FORCE OBSOLETE;
NOPROMPT] OBSOLETE
[obsOperandList]
[device_type]
[device_specifier];
Deletes a stored script b_whole_10 from the recovery catalog
rman TARGET / CATALOG rman/cat@catdb
DELETE [GLOBAL] SCRIPT RMAN> DELETE SCRIPT b_whole_10;
'<script_name>' RMAN> DELETE GLOBAL SCRIPT b_whole_10;

Drop
DROP CATALOG
Drop the RMAN catalog
*See CREATE CATALOG Demo Above
DROP CATALOG;

38
Bhaskar Reddy Page 39 12/7/2021

Use RMAN to issue the drop database command


No demo is shown as this is something I would strongly recommend against doing within RMAN.
DROP DATABASE;

Drop a restore point

DROP RESTORE POINT *See CREATE RESTORE POINT Demo Above


<restore_point_name>

DUPLICATE

Allocates axiliary channels and duplicates the target database as newdb


DUPLICATE [TARGET] RUN { 
DATABASE TO   ALLOCATE AUXILIARY CHANNEL d1 DEVICE TYPE DISK;
<new_name>   ALLOCATE AUXILIARY CHANNEL d2 DEVICE TYPE DISK;
LOGFILE   DUPLICATE TARGET DATABASE TO newdb
'<redo_log_file_path_and     LOGFILE 
_name>' SIZE <integer>       '?/oradata/aux1/redo01.log' SIZE 50M, 
<K | M>       '?/oradata/aux1/redo02.log' SIZE 50M,
[SKIP READONLY]       '?/oradata/aux1/redo03.log' SIZE 50M
[NOFILENAMECHECK]   SKIP READONLY
  NOFILENAMECHECK;
}

EXIT

Exit from RMAN or a terminal window


EXIT RMAN> target /
*RMAN> EXIT;

or

39
Bhaskar Reddy Page 40 12/7/2021

RMAN> HOST;
*$ EXIT;
RMAN>

FLASHBACK DATABASE
Returns the database to its state at a previous time or SCN

FLASHBACK DATABASE TO *RMAN> FLASHBACK DATABASE TO SCN=42678315;


SCN=<integer>

GRANT
Grant privileges to a recovery catalog user
*RMAN> GRANT CATALOG FOR DATABASE orabase TO repoomega;
GRANT <privilege> TO *RMAN> GRANT REGISTER DATABASE TO repoomega;
<schema_name>

HOST
Shell out of RMAN to the operating system for command execution
*See EXIT Demo Above
HOST

IMPORT
IMPORT CATALOG
Imports the metadata from one recovery catalog into a different recovery catalog
?
?

40
Bhaskar Reddy Page 41 12/7/2021

?
?

LIST

Produce a detailed listing of the indicated items


LIST <ARCHIVELOG | *RMAN> LIST ARCHIVELOG ALL;
COPY | DB_UNIQUE_NAME
| FAILURE> ALL; *RMAN> LIST COPY;

*RMAN> LIST DB_UNIQUE_NAME ALL;

*For LIST FAILURE See Advise Failure Demo Above

PRINT SCRIPT
Display a stored script

PRINT <IDENTIFIER | See CREATE SCRIPT Demos Above


QUOTED_STRING>

PURGE
?
See "CREATE SCRIPT" Demos Above
PURGE

QUIT
Exit the RMAN executable
*RMAN> QUIT;
QUIT

41
Bhaskar Reddy Page 42 12/7/2021

RECOVER
Apply redo logs and incremental backups to datafiles or data blocks restored from backup or datafile copies, in order to update
them to a specified time
TBD
RECOVER

REGISTER DATABASE
Register a Target in the Database  
Recovery Catalog
*RMAN> REGISTER DATABASE;
REGISTER DATABASE

RELEASE CHANNEL
Release a channel that was allocated with an ALLOCATE CHANNEL command or ALLOCATE CHANNEL FOR MAINTENANCE
command
See ? Demo Above
RELEASE CHANNEL

REPAIR FAILURE
Repair one or more failures recorded in the automated diagnostic repository
REPAIR FAILURE [<NO | *See Advise Failure Demo Above
NOPROMPT | PREVIEW |
USING>
REPLACE SCRIPT
Replace an existing script stored in the recovery catalog. If the script does not exist, then REPLACE SCRIPT creates it
TBD
REPLACE SCRIPT

REPORT

42
Bhaskar Reddy Page 43 12/7/2021

Perform detailed analyses on  recovery catalog metadata


RMAN> REPORT SCHEMA;
REPORT

RESET DATABASE

Reset the incarnation of the target database in the RMAN repository to a previous database incarnation
RESET DATABASE TO $ rman target / nocatalog
INCARNATION RMAN> STARTUP NOMOUNT;
<incarnation_identifier>; RMAN> RESTORE CONTROLFILE FROM AUTOBACKUP;
RMAN> ALTER DATABASE MOUNT;
RMAN> LIST INCARNATION OF DATABASE orabase;
RMAN> RESET DATABASE TO INCARNATION 1;
RMAN> RESTORE DATABASE UNTIL SCN 4208974;
RMAN> RECOVER DATABASE UNTIL SCN 4208974;
RMAN> ALTER DATABASE OPEN RESETLOGS;
RMAN> LIST INCARNATION OF DATABASE orabase;

RESTORE

Restore files from backup sets or from disk copies to the default or a new location
RESTORE RMAN> target / catalog rman/rman@rman

RMAN> backup database;

RMAN> validate backupset 1;

SQL> conn scott/tiger

SQL> DELETE FROM emp WHERE rownum < 6;

43
Bhaskar Reddy Page 44 12/7/2021

SQL> COMMIT;

RMAN> restore database;

RESYNC
Perform a full resynchronization, which creates a snapshot control file and then copies any new or changed information from
that snapshot control file to the recovery catalog.

This example performs a full resynchronization of the target database after archiving all unarchived redo logs
RESYNC CATALOG FROM
CONTROLFILECOPY
'<file_name>'

RESYNC FROM
DB_UNIQUE_NAME ALL
$ rman target /
RESYNC FROM RMAN> STARTUP FORCE MOUNT;
DB_UNIQUE_NAME RMAN> RESYNC CATALOG FROM CONTROLFILECOPY '/u01/cfile.dbf';
'<db_unique_name>'Mou RMAN> ALTER DATABASE OPEN;
nt the target database,
update the repository in
the current control file
with metadata from a
backup control file, then
open the database
After adding a datafile to *RMAN> RESYNC CATALOG;
an existing tablespace
 
Revoke
Revoke privileges from a recovery catalog user

44
Bhaskar Reddy Page 45 12/7/2021

TBD
REVOKE

Run
Execute a script of RMAN commands
RUN { See "Allocate A Single Backup Channel" Demo Above
  <script commands>
}
Send
Send a vendor-specific quoted string to one or more specific channels
SEND CHANNEL
Specify commands by CHANNEL
SEND CHANNEL TBD
'<channel_id>'
'<command_string>'
PARMS
'<channel_params>'

Specify a tape drive for a backup of the users tablespace to Oracle Secure Backup
SEND DEVICE_TYPE RUN
'<device_specifier>' {
'<command_string>'   ALLOCATE CHANNEL c1 DEVICE TYPE sbt;
PARMS   SEND 'OB_DEVICE stape1';
'<channel_params>'   BACKUP TABLESPACE users;
}

Set
Set the value of various attributes that affect RMAN behavior for the duration of a RUN block or a session

45
Bhaskar Reddy Page 46 12/7/2021

?
SET <OFF | ON> [FOR ALL TBD
TABLESPACES]
SET ARCHIVELOG DESTINATION TO '<
SET BACKUP COPIES <integer>
SET COMPRESSION ALGORITHM '<compression_algorithm_name>'
SET DECRYPTION IDENTIFIED BY <password>
SET ECHO <ON | OFF>
SET ENCRYPTION ALGORITHM '<algorithm_name>'
SET IDENTIFIED BY <password> [ONLY]
SET MAXCORRUPT FOR DATAFILE <dataFileSpec> TO <integer>
SET NEWNAME FOR DATAFILE <dataFileSpec> TO '<file_name>'
SET NEWNAME FOR DATAFILE <dataFileSpec> TO NEW
SET NEWNAME FOR TEMPFILE <tempFileSpec> TO '<quoted_string>'
SET NEWNAME FOR TEMPFILE <tempFileSpec> TO NEW
SET TO RESTORE POINT <restore_point_name>
SET UNTIL <TIME | SCN>
CONFIGURE ARCHIVELOG COPIES FOR DEVICE TYPE sbt TO 3;
CONFIGURE DATAFILE COPIES FOR DEVICE TYPE sbt TO 3;

RMAN> run {
  ALLOCATE CHANNEL dev1 DEVICE TYPE sbt
  PARMS 'ENV=(OB_DEVICE_1=stape1,OB_DEVICE_2=stape2)';
*  SET BACKUP COPIES 2;
  BACKUP DATABASE PLUS ARCHIVELOG;
}
RMAN> run {
  SET UNTIL TIME = "TO_DATE('03/15/08 10:42:07','MM/DD/RR HH24:MI:SS')";
  RESTORE DATABASE;
  RECOVER DATABASE;
}
SET AUXILIARY INSTANCE PARAMETER FILE TO '<file_name>

46
Bhaskar Reddy Page 47 12/7/2021

SET COMMAND ID TO '<string>'

SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE <deviceSpecifier> TO <formatSpec>

SET DBID <integer>


RMAN> RUN {
  ALLOCATE CHANNEL d1 DEVICE TYPE DISK FORMAT '/u01/%U';
  ALLOCATE CHANNEL d2 DEVICE TYPE DISK FORMAT '/u02/%U';
  SET COMMAND ID TO 'rman';
  BACKUP INCREMENTAL LEVEL 0 DATABASE;
  SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
}
RMAN> SET DBID 3257174182;

RMAN> STARTUP FORCE NOMOUNT;

RMAN> RUN {
  ALLOCATE CHANNEL t1 DEVICE TYPE sbt;
  RESTORE SPFILE FROM AUTOBACKUP;
}

STARTUP FORCE; # RMAN restarts database with restored SPFILE


$ rman target /

RMAN> STARTUP FORCE NOMOUNT


RMAN> SET DBID 28014364;

RMAN> RUN {
  SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u02/cf_%F.bak';
  RESTORE CONTROLFILE FROM AUTOBACKUP MAXSEQ 100;
}

47
Bhaskar Reddy Page 48 12/7/2021

ALTER DATABASE MOUNT;


RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;

Show
All
$ rman target / catalog repoomega1/oracle1@repos
ALL RMAN> show all;
AUXNAME
$ rman target / catalog repoomega1/oracle1@repos
RMAN> show auxname;
{DATAFILE | ARCHIVELOG} BACKUP COPIES
$ rman target / catalog repoomega1/oracle1@repos
RMAN> show datafile backup copies;
RMAN> show archivelog backup copies;
BACKUP OPTIMIZATION
$ rman target / catalog repoomega1/oracle1@repos
RMAN> show backup optimization;
[AUXILIARY] CHANNEL [FOR DEVICE TYPE <deviceSpecifier>]
$ rman target / catalog repoomega1/oracle1@repos
RMAN> show channel;
CONTROLFILE AUTOBACKUP [FORMAT]
$ rman target / catalog repoomega1/oracle1@repos
RMAN> show controfile autobackup;
CONTROLFILE AUTOBACKUP FORMAT <format mask>
$ rman target / catalog repoomega1/oracle1@repos

48
Bhaskar Reddy Page 49 12/7/2021

RMAN> show controfile autobackup;


ENCRYPTION FOR DATABASE
$ rman target / catalog repoomega1/oracle1@repos
RMAN> show encryption for database;
[DEFAULT] DEVICE TYPE
$ rman target / catalog repoomega1/oracle1@repos
RMAN> show device type;
ENCRYPTION ALGORITHM
$ rman target / catalog repoomega1/oracle1@repos
RMAN> show encryption algorithm;
EXCLUDE
$ rman target / catalog repoomega1/oracle1@repos
RMAN> show exclude;
MAXSETSIZE
$ rman target / catalog repoomega1/oracle1@repos
RMAN> show maxsetsize;
RETENTION POLICY
$ rman target / catalog repoomega1/oracle1@repos
RMAN> show retention policy;
RMAN> show retention policy to redundancy;
SNAPSHOT CONTROLFILE NAME
$ rman target / catalog repoomega1/oracle1@repos
RMAN> SHOW SNAPSHOT CONTROLFILE NAME;

Shutdown
Shutdown the target database

49
Bhaskar Reddy Page 50 12/7/2021

SHUTDOWN <ABORT | RMAN> SHUTDOWN ABORT;


IMMEDIATE | NORMAL |
TRANSACTIONAL>
Spool

Write RMAN output to a log file


SPOOL LOG OFF CONFIGURE DEFAULT DEVICE TYPE TO sbt;
SPOOL LOG TO '/tmp/current_config.log';
SPOOL LOG TO SHOW ALL;
<file_name> [APPEND] SPOOL LOG OFF;
SPOOL LOG TO '/home/oracle/rman.log';
BACKUP DATABASE;
SPOOL LOG OFF;

SQL

Execute a SQL statement from within RMAN


SQL '<SQL_statement>' RUN {
  SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
}

Startup

Startup a Database
STARTUP <DBA | FORCE | $ rman TARGET / CATALOG repoomega/oracle1@repos
MOUNT | NOMOUNT>
RMAN> STARTUP MOUNT;
STARTUP PFILE
'<file_name>'

50
Bhaskar Reddy Page 51 12/7/2021

Switch
Specify that a datafile copy is now the current datafile, that is, the datafile pointed to by the control file. This command is
equivalent to the SQL statement ALTER DATABASE RENAME FILE as it applies to datafiles
Switch the controlfile to point to an ImageCopy of the data file

SWITCH DATABASE TO TBD


COPY SWITCH DATAFILE '<data_file_specification>' TO COPY
TBD
SWITCH DATAFILE '<data_file_specification>' TO DATAFILECOPY '<file_name>'
TBD
SWITCH DATAFILE '<data_file_specification>' TO DATAFILECOPY TAG '<tag_name>'
TBD
SWITCH DATAFILE ALL
RUN {
  ALLOCATE CHANNEL d1 DEVICE TYPE DISK;
  SQL "ALTER TABLESPACE uwdata OFFLINE IMMEDIATE";
  SET NEWNAME FOR DATAFILE '/u01/oradata/users01.dbf' TO '/u02/oradata/users01.dbf';
  RESTORE TABLESPACE uwclass;
  SWITCH DATAFILE ALL;
  RECOVER TABLESPACE uwclass;
  SQL "ALTER TABLESPACE uwclass ONLINE";
}
SWITCH TABLESPACE '<tablespace_name>' TO COPY
SQL "ALTER TABLESPACE users OFFLINE IMMEDIATE";
SWITCH TABLESPACE users TO COPY;
RECOVER TABLESPACE users;
SQL "ALTER TABLESPACE users ONLINE";
SWITCH TEMPFILE <temp_file_specification> TO '<file_name>'

51
Bhaskar Reddy Page 52 12/7/2021

TBD
SWITCH TEMPFILE ALL
TBD

Transport Tablespace
Create transportable tablespace sets from backup for one or more tablespaces
TBD
TRANSPORT TABLESPACE

Unregister

Unregister a Database from the Catalog


UNREGISTER DATABASE RMAN> UNREGISTER DATABASE;
'<database_name>'
UNREGISTER DB_UNIQUE_NAME '<db_unique_name>' [INCLUDING BACKUPS [NOPROMPT]]
[NOPROMPT]
RMAN> LIST DB_UNIQUE_NAME ALL;
RMAN> UNREGISTER DB_UNIQUE_NAME 'ORADATA';

Upgrade Catalog
Upgrade the recovery catalog schema from an older version to the version required by RMAN
RMAN> UPGRADE CATALOG;
UPGRADE CATALOG

Validate
Examine a backup set and report whether its data is intact. RMAN scans all of the backup pieces in the specified backup sets
and looks at the checksums to verify that the contents can be successfully restored

52
Bhaskar Reddy Page 53 12/7/2021

Validate archivelogs
VALIDATE ARCHIVELOG RMAN> VALIDATE ARCHIVELOG ALL;
ALL
VALIDATE ARCHIVELOG
LIKE '<string_pattern>'
VALIDATE ARCHIVELOG
FROM SCN <integer>
VALIDATE ARCHIVELOG
BETWEEN SCN <integer>
AND SCN <integer>
VALIDATE ARCHIVELOG
UNTIL SCN <integer>
VALIDATE ARCHIVELOG
FROM SEQUENCE
<integer> [THREAD
<integer>]
VALIDATE ARCHIVELOG VALIDATE BACKUPSET <primaryKey>
SEQUENCE <integer>
[THREAD <integer>]
VALIDATE ARCHIVELOG
SEQUENCE BETWEEN
<integer> AND <integer>
VALIDATE ARCHIVELOG
UNTIL SEQUENCE
<integer> [THREAD
<integer>]
TIME BETWEEN
'<date_string>' AND
'<date_string>'
UNTIL TIME
'<date_string>'
TBD
VALIDATE CONTROLFILECOPY ALL

53
Bhaskar Reddy Page 54 12/7/2021

VALIDATE CONTROLFILECOPY '<file_name>'


VALIDATE CONTROLFILECOPY LIKE '<string_pattern>'
RMAN> VALIDATE CONTROLFILECOPY ALL;
VALIDATE COPY OF DATABASE
VALIDATE COPY OF DATAFILE '<file_name>'
VALIDATE COPY OF DATAFILE <file_number>
VALIDATE COPY OF TABLESPACE '<tablespace_name>'
RMAN> VALIDATE COPY OF TABLESPACE 'UWDATA';
VALIDATE <blockObject>
TBD
VALIDATE CURRENT CONTROLFILE
RMAN> VALIDATE CURRENT CONTROLFILE;
VALIDATE DATABASE
RMAN> VALIDATE DATABASE;
VALIDATE DATAFILE '<file_name>'
VALIDATE DATAFILE <file_number>
RMAN> VALIDATE DATAFILE 'C:\ORACLE\PRODUCT\ORADATA\ORABASE\UWDATA01';
RMAN> VALIDATE DATAFILE 9;
VALIDATE DB_RECOVERY_FILE_DEST
RMAN> VALIDATE DB_RECOVERY_FILE_DEST;
VALIDATE RECOVERY AREA
RMAN> VALIDATE RECOVERY AREA;
VALIDATE RECOVERY FILES
RMAN> VALIDATE RECOVERY FILES;
VALIDATE SPFILE

54
Bhaskar Reddy Page 55 12/7/2021

RMAN> VALIDATE SPFILE;


VALIDATE TABLESPACE <tablespace_name_list>
RMAN> VALIDATE TABLESPACE uwdata;

RMAN Demos

Using a target database controlfile instead of recovery catalog

The following were provided to PSOUG by member Andrea Sparling


RMAN> CONFIGURE RMAN> connect target /
RETENTION POLICY TO
REDUNDANCY 1; RMAN> BACKUP INCREMENTAL LEVEL 0
RMAN> CONFIGURE       TAG full_backup 
BACKUP OPTIMIZATION       FORMAT '/u03/backup/rman_fullbackup_%d_%t.%s.%c.%p.bus' 
OFF; # default       DATABASE;
RMAN> CONFIGURE
DEFAULT DEVICE TYPE TO RMAN> COPY CURRENT CONTROLFILE TO '/u03/backup/ctrlfile.backup';
DISK; # default RMAN> CROSSCHECK BACKUP;
RMAN> CONFIGURE RMAN> CROSSCHECK ARCHIVELOG ALL;
CONTROLFILE RMAN> DELETE OBSOLETE;
AUTOBACKUP OFF; # RMAN> DELETE EXPIRED ARCHIVELOG ALL;
default RMAN> LIST BACKUP;
RMAN> CONFIGURE RMAN> LIST ARCHIVELOG ALL;
CONTROLFILE
AUTOBACKUP FORMAT
FOR DEVICE TYPE DISK
      TO '%F';
RMAN> CONFIGURE
DEVICE TYPE DISK
PARALLELISM 1 BACKUP
TYPE TO

55
Bhaskar Reddy Page 56 12/7/2021

      COMPRESSED
BACKUPSET; # default
RMAN> CONFIGURE
DATAFILE BACKUP COPIES
FOR DEVICE TYPE DISK
TO 1;
RMAN> CONFIGURE
ARCHIVELOG BACKUP
COPIES FOR DEVICE TYPE
DISK TO 1;
RMAN> CONFIGURE
MAXSETSIZE TO 2 G;
RMAN> CONFIGURE
ARCHIVELOG DELETION
POLICY TO NONE;
RMAN> CONFIGURE
SNAPSHOT CONTROLFILE
NAME TO 
     
'/u01/app/oracle/product/
10.1.0.3/dbs/snapcf_pnbd
b.f';
Incremental Level 0
Backup
#!/bin/sh
Incremental #####################################################
# script to take a rman full backup 
# this script must be run
# as the trusted user 'oracle10g' 'oracle9i' etc
#####################################################
# create output logs with that number and the current date in the ./rman/logs directory age out in
14-30 days
# get env IMPORTANT, if multiple Oracle SID's the env var ORACLE_SID must be set

56
Bhaskar Reddy Page 57 12/7/2021

. /etc/bashrc
export ORACLE_BASE=/u01/app/oracle;
export ORACLE_HOME=$ORACLE_BASE/product/10.1.0.3;
export ORACLE_SID=pnbdb;
export LD_LIBRARY_PATH=/u01/app/oracle/product/10.1.0.3/lib:/lib:/usr/lib;

# set relative head of directory (work disk is u03, oracle disk is u01)
HEAD=/u03
WORK=$HEAD/backup/scripts
cd $WORK

# unique logfile
DATE=`date +"%Y%m%d-%H%M%S"`
LOGFILE='/u03/backup/rman/logs/rman_full_backup_'${DATE}'.log'
echo "log: "${LOGFILE} > $LOGFILE
echo "Started " >> $LOGFILE
date >> $LOGFILE
echo instance $ORACLE_SID >> $LOGFILE
#############################################################
#############
 
${ORACLE_HOME}/bin/rman @${WORK}/rman_full.rcv >> $LOGFILE
returncode=$?
echo $returncode return code >> $LOGFILE
df >> $LOGFILE
echo "Ended " >> $LOGFILE
date >> $LOGFILE

if [ $returncode -ne 0 ]; then


  echo " email error log " >> $LOGFILE
  mail csds_opb@u.washington.edu -s"RMAN ERROR LOG for parnassus pnbdb backup" < $LOGFILE
  mail amspar@u.washington.edu -s"RMAN ERROR LOG for parnassus pnbdb backup" < $LOGFILE
fi
exit

57
Bhaskar Reddy Page 58 12/7/2021

 
RAC Demo
Crosschecking on Multiple Nodes of an Oracle Real Application Clusters Configuration: Example In this example, you perform a
crosscheck of backups on two nodes of an Oracle Real Application Clusters configuration, where each node has access to a
subset of backups. It is assumed here that all backups are accessible by at least one of the two nodes used in the crosscheck.
Any backups not accessible from at least one of the nodes are marked EXPIRED after the crosscheck.

RMAN on a RAC Cluster


ALLOCATE CHANNEL FOR
MAINTENANCE DEVICE
TYPE DISK CONNECT 
'sys/oracle1@inst1';
ALLOCATE CHANNEL FOR
MAINTENANCE DEVICE
TYPE DISK CONNECT
'sys/oracle1@inst2';
CROSSCHECK BACKUP; 
RMAN Related Queries

?
SELECT
recovery_estimated_ios,
actual_redo_blks,
target_redo_blks,
target_mttr,
estimated_mttr
FROM
gv$instance_recovery;

SELECT * FROM
v_$recovery_file_dest;

58
Bhaskar Reddy Page 59 12/7/2021

select count(*) from


dba_hist_instance_recover
y;

cd
/app/oracle/product/Oracl
eHomes/oradata/orcl

ls -la

cd
/app/oracle/product/Oracl
eHomes/admin/orcl/bdum
p

tail alert_orcl.log

rm control02.ctl

ls -la

SQL> conn hr/hr (after


unlocking account)
SQL> desc jobs
SQL> INSERT INTO jobs
VALUES (987,'TEST',0,1);
SQL> COMMIT;
-- also build a dummy
table

tail alert_orcl.log
-- no one knows anything
bad has happened

59
Bhaskar Reddy Page 60 12/7/2021

SQL> select file_name


from
mgmt$db_controlfiles;

-- lets do a shutdown and


restart
SQL> shutdown
immediate;

SQL> conn / as sysdba


Connected.
SQL> shutdown
immediate;
ORA-00210: cannot open
the specified control file
ORA-00202: control file:
'/app/oracle/product/Oracl
eHomes/oradata/orcl/cont
rol02.ctl'
ORA-27041: unable to
open file
Linux Error: 2: No such
file or directory
Additional information: 3
-- now we have a problem

SQL> shutdown abort;

tail the alert log and we


know what happened

RUN {
  STARTUP FORCE

60
Bhaskar Reddy Page 61 12/7/2021

NOMOUNT;
  RESTORE CONTROLFILE;
  ALTER DATABASE
MOUNT;
  RESTORE DATABASE;
  RECOVER DATABASE;
}

alter database open


resetlogs;

ls -la shows control files


back

rman done

-- hadn't done a backup


after last restore
RMAN> run {startup force
nomount; restore
controlfile;
alter database mount;}

tail the alert log

-- look at
/app/oracle/OracleHomes/
oradata/orcl

-- the file is restored


ls -la

conn / as sysdba
shutdown immediate;

61
Bhaskar Reddy Page 62 12/7/2021

startup

-- note error message


SQL> startup
ORACLE instance started.

Total System Global Area


440401920 bytes
Fixed Size 1219880 bytes
Variable Size 130024152
bytes
Database Buffers
306184192 bytes
Redo Buffers 2973696
bytes
Database mounted.
ORA-01589: must use
RESETLOGS or
NORESETLOGS option
for database open

SQL> startup mount;

tail alert_orcl.log

-- next dumped
controlfiles 1 and 3
shutdown immediate fails
shutdown abort
connect to RMAN 
Backup and Recovery Practices Best Practices
Metalink Note: 388422.1
1. Turn on block

62
Bhaskar Reddy Page 63 12/7/2021

checking
REASON: The aim is to
detect, very early the
presence of corrupt blocks
in the database. This has
a slight performance
overhead, but Checksums
allow Oracle to detect
early corruption caused by
underlying disk, storage
system, or I/O system
problems.

SQL> alter system set


db_block_checking = true
scope=both;

2. Turn on block
tracking when using
RMAN backups (if
running 10g or above)
REASON: This will allow
RMAN to backup only
those blocks that have
changed since the last full
backup, which will reduce
the time taken to back up,
as less blocks will be
backed up.

SQL> alter database


enable block change
tracking using file
‘/u01/oradata/ora1/chang

63
Bhaskar Reddy Page 64 12/7/2021

e_tracking.f’;
3. Duplex log groups
and members and have
more than one archive
log dest
REASON: If an archivelog
is corrupted or lost, by
having multiple copies in
multiple locations, the
other logs will still be
available and could be
used.

If an online log is deleted


or becomes corrupt, you
will have another member
that can be used to
recover if required.

SQL> alter system set


log_archive_dest_2='locati
on=/new/location/archive
2' scope=both;
SQL> alter database add
logfile member
'/new/location/redo21.log'
to group 1;
4. When backing up the
database use the 'check
logical' parameter
REASON: This will cause
RMAN to check for logical
corruption within a block
as well as the normal

64
Bhaskar Reddy Page 65 12/7/2021

head/tail checksumming.
This is the best way to
ensure that you will get a
good backup.

RMAN> backup check


logical database plus
archivelog delete input;
5. Test your backup
REASON: This will do
everything except actually
restore the database. This
is the best method to
determine if your backup
is good and usable before
being in a situation where
it is
critical and issues exist.

RMAN> restore validate


database;
6. Have each datafile in
a single backup piece
REASON: When doing a
partial restore RMAN must
read through the entire
piece to get the
datafile/archivelog
requested. The smaller the
backup piece the quicker
the restore can
complete. This is
especially relevent with
tape backups of large

65
Bhaskar Reddy Page 66 12/7/2021

databases or where the


restore is only on
individual / few files.

RMAN> backup database


filesperset 1 plus
archivelog delete input;
7. Maintain your RMAN
catalog/controlfile
REASON: Choose your
retention policy carefully.
Make sure that it
compliments your tape
subsystem
retention policy,
requirements for backup
recovery strategy. If not
using a catalog, ensure
that your controlfile record
keep time instance
parameter matches your
retention policy.

SQL> alter system set


control_file_record_keep_t
ime=21 scope=both;
This will keep 21 days of
backup records.

Run regular catalog


maintenance.
REASON: Delete obsolete
will remove backups that
are outside your retention

66
Bhaskar Reddy Page 67 12/7/2021

policy. If obsolete backups


are not deleted, the
catalog will continue to
grow until performance
becomes an issue.

RMAN> delete obsolete;

REASON: crosschecking
will check that the
catalog/controlfile
matches the physical
backups. If a backup is
missing, it will set the
piece to 'EXPIRED' so
when a restore is started,
that it will not be eligible,
and an earlier backup will
be used. To remove the
expired backups from the
catalog/controlfile use the
delete expired command.

RMAN> crosscheck
backup;
RMAN> delete expired
backup;
8. Prepare for loss of
controlfiles set
autobackup on
REASON: This will ensure
that you always have an
up to date controlfile
available that has been

67
Bhaskar Reddy Page 68 12/7/2021

taken at the end of the


current backup not during.

RMAN> configure
controlfile autobackup on;

keep your backup logs


REASON: The backup log
contains parameters for
your tape access,
locations on controlfile
backups that can be
utilised if complete loss
occurs.

9. Test your recovery


REASON: During a
recovery situation this will
let you know how the
recovery will go without
actually doing it, and can
avoid having to restore
source datafiles again.

SQL> recover database


test;
10. Do not specify
'delete all input' when
backing up archivelogs
REASON: Delete all input'
will backup from one
destination then delete
both copies of the
archivelog where as

68
Bhaskar Reddy Page 69 12/7/2021

'delete input' will backup


from one location and
then delete what has been
backed up. The next
backup will back up those
from location 2 as well as
new logs from location 1,
then delete all that are
backed up. This means
that you will have the
archivelogs since the last
backup available on disk
in location 2 (as well as
backed up once) and two
copies backup up prior to
the previous backup.

69

You might also like