Oracle RMAN
Version 12.1.0.1

General Information
Library Note Morgan's Library Page Header
The Library is currently in the process of being upgraded from Oracle Database Version 12.1.0.2 to 12.2.0.1. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) and may contain references to CDBs, PDBs, and other objects you may not be familiar with such as CDB_OBJECTS_AE: Welcome to 12c.

Have you viewed the Library's main Table of Contents? If not ... [Click Here] ... scroll down the page and you will find links to the largest collection of Oracle Database demos on the net.
Given how large this topic is deprecated syntax is not included. Be sure to review the header and code in $ORACLE_HOME/rdbms/admin/prgrmanc.sql

This page is in the process of being upgraded to 12.2 so you will find some sections incomplete and others with notes supporting the on-going edits. Check back frequently as the page updates should be complete by week's end.
Top Level Commands
Database Commands that can be executed at the RMAN prompt
ASSOCIATE STATISTICS DESCRIBE INSERT
AUDIT DISASSOCIATE STATISTICS LOCK
BEGIN DROP MERGE
CALL EXPLAIN PLAN MOUNT
COMMENT FLASHBACK NOAUDIT
COMMIT FLASHBACK TABLE PURGE
DELETE GRANT RENAME
Data Dictionary Objects See Related Topic "Dynamic Performance Views" Link Below
System Privileges
SYSDBA BACKUP ANY TABLE  
Encryption Algorithms col algorithm_name format a15
col algorithm_description format a25

SELECT * FROM gv$rman_encryption_algorithms;

The default encryption algorithm is 128-bit AES.
Data Dictionary Objects
DBA_HIST_INSTANCE_RECOVERY GV_$RECOVERY_FILE_STATUS V_$RECOVER_FILE
DBA_RECOVERABLE_SCRIPT GV_$RECOVERY_LOG V_$RECOVERY_FILE_DEST
DBA_RECOVERABLE_SCRIPT_BLOCKS GV_$RECOVERY_PROGRESS V_$RECOVERY_FILE_STATUS
DBA_RECOVERABLE_SCRIPT_ERRORS GV_$RECOVERY_STATUS V_$RECOVERY_LOG
DBA_RECOVERABLE_SCRIPT_PARAMS V_$FLASH_RECOVERY_AREA_USAGE V_$RECOVERY_PROGRESS
GV_$INSTANCE_RECOVERY V_$INSTANCE_RECOVERY V_$RECOVERY_STATUS
GV_$RECOVER_FILE    
Format Directives
Format Description
%a Current database activation id
%A Zero-filled activation ID
%c The copy number of the backup piece within a set of duplexed backup pieces.bMaximum 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
%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
%u An 8-character name constituted by compressed representations of the backup set or 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
%Y Year in this format: YYYY
%% Percent (%) character. For example, %%Y translates to the string %Y
Repository Initialization Parameters compatible=12.1.0
log_archive_format=RMAN_%s_%r_%d.arc
remote_login_passwordfile=SHARED
SQL> show parameter archive_format
To create a permanent NAS Mount -- 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
Create RMAN Repository and Catalog /* as Linux user oracle modify the TNSNAMES.ORA to point to the database that will host the repository catalog: Then ... */

$ sqlplus / as sysdba

-- using OMF

SQL> CREATE TABLESPACE cat_tbs;

SQL> CREATE USER repoomega
     IDENTIFIED BY oracle1
     DEFAULT TABLESPACE cat_tbs
     TEMPORARY TABLESPACE temp
     QUOTA UNLIMITED ON cat_tbs;

SQL> GRANT create session TO repoomega
SQL> GRANT recovery_catalog_owner TO repoomega;
SQL> 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;
RMAN Catalog Upgrade

Thank you Ed Whalen
An RMAN catalog must be at the maximum version of all databases in the catalog or a higher version. So, for example, if you are using your RMAN catalog to backup databases of version 11.2.0.4, 12.1.0.2, and 12.2.0.1 your catalog must be 12.2.0.1 or higher. The following code sample shows how to upgrade the RMAN catalog even if the catalog database is, itself, of a lower version.
target / catalog <catalog_connection_string> UPGRADE CATALOG;
$ rman target / catalog repoomega/oracle1@repos UPGRADE CATALOG;
Put the database into ARCHIVELOG mode /* as Linux user oracle modify the TNSNAMES.ORA to point to the database that will host the repository catalog: Then ... */

$ 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;

startup mount;

alter database archivelog;

alter database open;

archive log list;

alter system switch logfile;

archive log list;
 
Syntax
BACKUP [(backup operand)] (backup specification) [plus archivelog [backup specification operand]]

backup operand = (backup type spec) | CHANNEL '<channel_id>' | CHECK LOGICAL
 
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
 
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 | CRITICAL | HIGH | LOW | failure_number_list>
EXCLUDE FAILURE <failure_number_list>
RMAN> LIST FAILURE;
RMAN> ADVISE FAILURE ALL;
RMAN> REPAIR FAILURE;
 
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
Allocate a disk channel ALLOCATE [AUXILIARY] CHANNEL <channel_name> [, <channel_id>,
DEVICE TYPE <device_type_name>[allocation_operand_list]
SQL> desc gv$backup_device

SQL> SELECT * FROM gv$backup_device;

RMAN> target / catalog repoomega/oracle1
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO disk;
RMAN> RUN {
  ALLOCATE CHANNEL d1 DEVICE TYPE DISK FORMAT '/u01/backups/%U';
  BACKUP DATABASE PLUS ARCHIVELOG;
  RELEASE CHANNEL;
}
Allocates a tape channel for a whole database and archived redo log backup RMAN> RUN {
  ALLOCATE CHANNEL tape1 DEVICE TYPE sbt
  BACKUP DATABASE PLUS ARCHIVELOG;
  RELEASE CHANNEL;
}
Spread the backup across several disk drives. Allocate one DEVICE TYPE DISK channel for ach disk drive and specify the format string so that the filenames are on different disks RMAN> RUN {
  ALLOCATE CHANNEL d1 DEVICE TYPE DISK FORMAT '/u01/backups/%U';
  ALLOCATE CHANNEL d2 DEVICE TYPE DISK FORMAT '/u02/backups/%U';
  BACKUP DATABASE PLUS ARCHIVELOG;
  RELEASE CHANNEL;
}
When creating multiple copies of a backup, you can specify the SET BACKUP COPIES command. The following example generates a single backup of the database to disk, and then creates two identical backups of datafile 1 to two different file systems RMAN> RUN {
  ALLOCATE CHANNEL c1 DEVICE TYPE DISK MAXPIECESIZE 5M;
  # AS COPY is the default, so RMAN creates image copies
  BACKUP DATABASE PLUS ARCHIVELOG;
  SET BACKUP COPIES = 2;
  BACKUP DATAFILE 1 FORMAT '/u01/backups/%U', '/u02/backups/%U';
}
Allocate Channel for Maintenance
Allocates a channel in preparation for a CHANGE, DELETE, or CROSSCHECK. This cannot be used within a RUN block. ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE <device_specifier> [allocation_operand_list];
RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;
 
ALTER DATABASE
Mount and open the database ALTER DATABASE <MOUNT | OPEN | OPEN RESETLOGS>;
RMAN> STARTUP NOMOUNT;
RMAN> ALTER DATABASE MOUNT;
RMAN> BACKUP DATABASE;
RMAN> ALTER DATABASE OPEN;
Mount and open the database resetlogs RUN {
  ALLOCATE CHANNEL ch1 DEVICE TYPE sbt;
  SET UNTIL SCN 1024;
  RESTORE DATABASE;
  RECOVER DATABASE;
  ALTER DATABASE OPEN RESETLOGS;
}
 
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
Backs up copy of each distinct log sequence number BACKUP ARCHIVELOG [NOT] <ALL | FROM .... | HIGH | LIKE .... | LOW | SCN .... | SEQUENCE | TIME ... | UNTIL ....>
RMAN> BACKUP ARCHIVELOG ALL;
Backup archivelogs not previously backedup RMAN> BACKUP ARCHIVELOG ALL NOT BACKEDUP 1 TIMES;

Starting backup at 21-AUG-16
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=146 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=149 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=39 RECID=1 STAMP=758408898
input archived log thread=1 sequence=40 RECID=2 STAMP=758412681
input archived log thread=1 sequence=41 RECID=3 STAMP=758447886
input archived log thread=1 sequence=42 RECID=4 STAMP=758447887
input archived log thread=1 sequence=43 RECID=5 STAMP=758447893
input archived log thread=1 sequence=44 RECID=6 STAMP=758499761
input archived log thread=1 sequence=45 RECID=7 STAMP=758512857
input archived log thread=1 sequence=46 RECID=8 STAMP=758541784
input archived log thread=1 sequence=47 RECID=9 STAMP=758558811
input archived log thread=1 sequence=48 RECID=10 STAMP=758569034
input archived log thread=1 sequence=49 RECID=11 STAMP=758569043
input archived log thread=1 sequence=50 RECID=12 STAMP=758569055
input archived log thread=1 sequence=51 RECID=13 STAMP=758571129
input archived log thread=1 sequence=52 RECID=14 STAMP=758577127
input archived log thread=1 sequence=53 RECID=15 STAMP=758577128
input archived log thread=1 sequence=54 RECID=16 STAMP=758577133
input archived log thread=1 sequence=55 RECID=17 STAMP=758586204
input archived log thread=1 sequence=56 RECID=18 STAMP=758657669
input archived log thread=1 sequence=57 RECID=19 STAMP=758671280
input archived log thread=1 sequence=58 RECID=20 STAMP=758732465
input archived log thread=1 sequence=59 RECID=21 STAMP=758760639
channel ORA_DISK_1: starting piece 1 at 21-AUG-16
channel ORA_DISK_2: starting archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=60 RECID=22 STAMP=758823382
input archived log thread=1 sequence=61 RECID=23 STAMP=758935543
input archived log thread=1 sequence=62 RECID=24 STAMP=758937344
input archived log thread=1 sequence=63 RECID=25 STAMP=759016813
input archived log thread=1 sequence=64 RECID=26 STAMP=759024182
input archived log thread=1 sequence=65 RECID=27 STAMP=759163875
input archived log thread=1 sequence=66 RECID=28 STAMP=759180493
input archived log thread=1 sequence=67 RECID=29 STAMP=759256226
input archived log thread=1 sequence=68 RECID=30 STAMP=759276196
input archived log thread=1 sequence=69 RECID=31 STAMP=759321858
input archived log thread=1 sequence=70 RECID=32 STAMP=759362452
input archived log thread=1 sequence=71 RECID=33 STAMP=759406656
input archived log thread=1 sequence=72 RECID=34 STAMP=759407028
input archived log thread=1 sequence=73 RECID=35 STAMP=759491861
input archived log thread=1 sequence=74 RECID=36 STAMP=759504633
input archived log thread=1 sequence=75 RECID=37 STAMP=759539362
input archived log thread=1 sequence=76 RECID=38 STAMP=759621618
input archived log thread=1 sequence=77 RECID=39 STAMP=759657406
input archived log thread=1 sequence=78 RECID=40 STAMP=759793790
input archived log thread=1 sequence=79 RECID=41 STAMP=759794509
channel ORA_DISK_2: starting piece 1 at 21-AUG-16
channel ORA_DISK_1: finished piece 1 at 21-AUG-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\ 2016_04_21\O1_MF_ANNNN_TAG20160421T220151_753RP3L2_.BKP tag=TAG20160421T220151 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:59
channel ORA_DISK_2: finished piece 1 at 21-AUG-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\ 2016_04_21\O1_MF_ANNNN_TAG20160421T220151_753RPK00_.BKP tag=TAG20160421T220151 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:01:56
Finished backup at 21-AUG-16

Starting Control File and SPFILE Autobackup at 21-AUG-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\AUTOBACKUP\ 2016_04_21\O1_MF_S_759794645_753RT6WB_.BKP comment=NONE
Finished Control File and SPFILE Autobackup at 21-AUG-16
Backup archive logs RMAN> run
2> {
3> allocate channel t1 type 'SBT_TAPE';
4> sql 'alter system archive log current';
5> backup archivelog all filesperset 10 format 'orabase_al_t%t_s%s_p%p'
6> plus
7> archivelog format '%d_%Y_%M_%D_%s_%p.arc'
8> delete all input;
9> show all;
10> release channel t1;
11> }

using target database control file instead of recovery catalog allocated channel: t1 channel t1: sid=102 devtype=SBT_TAPE channel t1: VERITAS NetBackup for Oracle - Release 5.1 (2002111220)

sql statement: alter system archive log current

Starting backup at 11-AUG-16
current log archived
channel t1: starting archive log backupset channel t1: specifying archive log(s) in backup set input archive log thread=1 sequence=6084
recid=5431 stamp=758849405 input archive log thread=1 sequence=6085 recid=5432 stamp=758870222 input archive log thread=1 sequence=6086
recid=5433 stamp=758894325 input archive log thread=1 sequence=6087 recid=5434 stamp=758910534 input archive log thread=1 sequence=6088
recid=5435 stamp=758920929 input archive log thread=1 sequence=6089 recid=5436 stamp=758920930 channel t1: starting piece 1 at
11-APR-16 channel t1: finished piece 1 at 11-APR-16 piece handle=orabase_al_t758920930_s4687_p1 tag=TAG20160411T192210 comment=API
Version 2.0,MMS Version 5.0.0.0 channel t1: backup set complete, elapsed time: 00:06:57 channel t1: deleting archive log(s) archive log
filename=/ORACLE/ORADATA/ORABASE/ARCHIVE/ARC06084_0647970522.001 recid=5431 stamp=758849405 archive log
filename=/ORACLE/ORADATA/ORABASE/ARCHIVE/ARC06085_0647970522.001 recid=5432 stamp=758870222 archive log
filename=/ORACLE/ORADATA/ORABASE/ARCHIVE/ARC06086_0647970522.001 recid=5433 stamp=758894325 archive log
filename=/ORACLE/ORADATA/ORABASE/ARCHIVE/ARC06087_0647970522.001 recid=5434 stamp=758910534 archive log
filename=/ORACLE/ORADATA/ORABASE/ARCHIVE/ARC06088_0647970522.001 recid=5435 stamp=758920929 archive log
filename=/ORACLE/ORADATA/ORABASE/ARCHIVE/ARC06089_0647970522.001 recid=5436
stamp=758920930 Finished backup at 11-AUG-16

Recovery Manager complete.
BACKUP AS BACKUPSET
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 DEVICE TYPE <device_identifier> COPIES <integer> DATABASE FORMAT '<location_and_format>' ....
RMAN> BACKUP AS BACKUPSET DATAFILE 3, 4, 5, 6, 7) (DATAFILE 8, 9);

RMAN> BACKUP AS BACKUPSET DATAFILE 3, 4, 5, 6, 7, 8, 9;
BACKUP AS COMPRESSED BACKUPSET
Create two copies of a compressed backupset BACKUP AS COMPRESSED BACKUPSET DEVICE TYPE <device_identifier>
COPIES <integer>
DATABASE FORMAT '<location_and_format>'
RMAN> BACKUP AS COMPRESSED BACKUPSET DATABASE;

RMAN> BACKUP AS COMPRESSED BACKUPSET DEVICE TYPE DISK COPIES 2 DATABASE FORMAT '/u01/db_%U', '/u02/db_%U';
BACKUP AS COPY
Backing up as an image copy BACKUP AS COPY <backup_specification> ....
RUN {
  ALLOCATE CHANNEL dev1 DEVICE TYPE DISK FORMAT '/u01/%U';
  ALLOCATE CHANNEL dev2 DEVICE TYPE DISK FORMAT '/u02/%U';
  BACKUP AS COPY TABLESPACE system, tools, users, undotbs;
  BACKUP AS COPY CURRENT CONTROLFILE;
}
With REUSE syntax BACKUP AS COPY REUSE ARCHIVELOG LIKE "/orabase/ARCHIVELOG/O1_MF_1_124_76LLH2H4_.ARC
AUXILIARY FORMAT "+RCVDEST";
BACKUP CHANNEL
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 '<channel_id>' ....
RUN {
  ALLOCATE CHANNEL d2 DEVICE TYPE DISK;
  ALLOCATE CHANNEL d1 DEVICE TYPE DISK;

  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;
}
BACKUP CHECK
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 [LOGICAL] <database_specifications>
RUN {
  SET MAXCORRUPT FOR DATAFILE 5,6,7,8 TO 1;
  BACKUP CHECK LOGICAL DATABASE;
}
Check for logical corruption in datafile 42 RMAN>   BACKUP CHECK LOGICAL DATAFILE 42;
BACKUP CONTROLFILECOPY
Create a backup copy of a control file BACKUP CONTROLFILECOPY ....
RMAN> BACKUP AS COPY CURRENT CONTROLFILE FORMAT 'c:\stage\control01.ctl';
RMAN> BACKUP CONTROLFILECOPY 'c:\stage\control01.ctl';
BACKUP COPIES
Define the number of backup copies to create BACKUP COPIES <integer> ....
RUN {
  BACKUP COPIES 2 DEVICE TYPE sbt BACKUPSET ALL;
}
BACKUP CURRENT
Backup the current Control File to the default or specified location BACKUP CURRENT CONTROLFILE [TO DESTINATION <destination_path>];
RUN {
  BACKUP CURRENT CONTROLFILE TO DESTINATION '/u01/backups';
}
BACKUP DATABASE
Backup Database RUN {
  ALLOCATE CHANNEL d1 DEVICE TYPE DISK;
  BACKUP DATABASE;
}
Backup Database Plus Archivelog RUN {
  ALLOCATE CHANNEL d1 DEVICE TYPE DISK;
  BACKUP DATABASE PLUS ARCHIVELOG;
}
BACKUP DATAFILE
Datafile backup to multiple locations BACKUP DATAFILE <integer> [FORMAT '<location_and_name_format>']

BACKUP DATAFILE <integer> [TO '<location>']
RUN {
  ALLOCATE CHANNEL d1 DEVICE TYPE DISK;
  BACKUP DATAFILE 1 FORMAT '/u01/backups/%U', '/u02/backups/%U';
  BACKUP DATAFILE 6 TO '/u01/backups', '/u02/backups';
}
BACKUP DATAFILECOPY
Backup a datafile copy BACKUP DATAFILECOPY ....
RMAN> BACKUP DATAFILECOPY '/u01/oradata/orabase/uwdata01.dbf';
BACKUP DB_FILE_NAME_CONVERT
Converts ("Replaces") one string with another BACKUP AS COPY DB_FILE_NAME_CONVERT (<current_string, new_string>)
TABLESPACE <target_tablespace>
RMAN> BACKUP AS COPY DB_FILE_NAME_CONVERT ('/app/oracle/oradata/orabase/uwdata01.dbf', '/app/oracle/oradata/orcl/classdemo01.dbf')
TABLESPACE uwclass;
BACKUP DB_RECOVERY_FILE_DEST
Synonym for BACKUP RECOVERY AREA See BACKUP RECOVERY AREA below
BACKUP DEVICE TYPE
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 <DISK | SBT> ....
RMAN> {
  BACKUP DEVICE TYPE sbt
  DATAFILECOPY FROM TAG 'LATESTCOPY' FORMAT 'Datafile%f_Database%d';
  DELETE COPY TAG 'LATESTCOPY';
}
BACKUP DISKRATIO
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; -- enable
BACKUP DURATION
Backup will stop if it is not completed in the specified duration BACKUP DURATION <HH:MI> <backup_specification> [MINIMIZE <LOAD | TIME>]
BACKUP DURATION <HH:MI> <backup_specification> PARTIAL
RMAN> BACKUP DURATION 3:30 DATABASE;
BACKUP FILESPERSET
Specifies the maximum number of input files to include in each output backup set. This parameter is only relevant when BACKUP generates backup sets. BACKUP FILESPERSET <integer> ....;
RMAN> backup filesperset 5 archivelog all;

Starting backup at 22-AUG-16
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_05\ O1_MF_1_39_73SHKHNZ_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_05\ O1_MF_1_40_73SM7O4W_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_06\ O1_MF_1_41_73TOMX3F_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_06\ O1_MF_1_42_73TOMZBQ_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_06\ O1_MF_1_43_73TON4NJ_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_06\ O1_MF_1_44_73W88ZKL_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_07\ O1_MF_1_45_73WO26LK_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_07\ O1_MF_1_46_73XKB6MK_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_07\ O1_MF_1_47_73Y1Y9NJ_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_07\ O1_MF_1_48_73YCXQJ3_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_07\ O1_MF_1_49_73YCXXLK_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_07\ O1_MF_1_50_73YCYDSD_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_07\ O1_MF_1_51_73YFZ6Y8_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_07\ O1_MF_1_52_73YMTP6C_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_07\ O1_MF_1_53_73YMTR4W_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_07\ O1_MF_1_54_73YMTWKL_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_07\ O1_MF_1_55_73YWP90Z_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_08\ O1_MF_1_56_7412HMX9_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_08\ O1_MF_1_57_741HRVWB_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_09\ O1_MF_1_58_743CJG5V_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_09\ O1_MF_1_59_74471D2X_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_10\ O1_MF_1_60_7464B2D6_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_11\ O1_MF_1_61_749KV6QG_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_11\ O1_MF_1_62_749MMCSW_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_12\ O1_MF_1_63_74D16TWS_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_13\ O1_MF_1_64_74D8F300_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_14\ O1_MF_1_65_74JJTD6C_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_14\ O1_MF_1_66_74K11V98_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_15\ O1_MF_1_67_74MC0J3X_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_15\ O1_MF_1_68_74MYJJ1G_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_16\ O1_MF_1_69_74OC3HDP_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_16\ O1_MF_1_70_74PLR1LK_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_17\ O1_MF_1_71_74QXXFNJ_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_17\ O1_MF_1_72_74QY94C7_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_18\ O1_MF_1_73_74TK4200_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_18\ O1_MF_1_74_74TXM7GN_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_18\ O1_MF_1_75_74VZJJ7T_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_19\ O1_MF_1_76_74YHV0CQ_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_20\ O1_MF_1_77_74ZLSC4W_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_21\ O1_MF_1_78_753QZG00_.ARC; already backed up 1 time(s)
skipping archived log file C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_04_21\ O1_MF_1_79_753ROW4D_.ARC; already backed up 1 time(s)
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=80 RECID=42 STAMP=759841223
input archived log thread=1 sequence=81 RECID=43 STAMP=759880832
channel ORA_DISK_1: starting piece 1 at 22-AUG-16
channel ORA_DISK_2: starting archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=82 RECID=44 STAMP=759882877
channel ORA_DISK_2: starting piece 1 at 22-AUG-16
channel ORA_DISK_1: finished piece 1 at 22-AUG-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_04_22\ O1_MF_ANNNN_TAG20160422T223438_756GZHTV_.BKP tag=TAG20160422T223438 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08
channel ORA_DISK_2: finished piece 1 at 22-AUG-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_04_22\ O1_MF_ANNNN_TAG20160422T223438_756GZJX9_.BKP tag=TAG20160422T223438 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:07
Finished backup at 22-AP-16

Starting Control File and SPFILE Autobackup at 22-APR-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\AUTOBACKUP\2016_04_22\ O1_MF_S_759882888_756GZSYR_.BKP comment=NONE
Finished Control File and SPFILE Autobackup at 22-APR-16
BACKUP ... FOR RECOVER OF ...
This command will give me a level 1 backup to be used to recover level 0 backup to the latest level BACKUP ... FOR RECOVER OF COPY WITH TAG ....
RMAN > BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'incr_upd' DATABASE FORMAT '/oradata/rman/161932/inc_%d_%T_%t_%s_%p';
Alters the RECOVER COPY... WITH TAG to perform incomplete recovery of the datafile copies to the point in time in the past where you want your window of recoverability to begin -- maintain a 7 day window
RUN {
  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 <backup_specification>
RMAN> BACKUP FORCE DATABASE;
BACKUP FORMAT
Specify Backup Format BACKUP FORMAT <format_specification> ....
RMAN> BACKUP FORMAT = 'UW_%d/%t/%s/%p' ARCHIVELOG LIKE '%arc_dest%';
BACKUP FULL
Creates a backup of all blocks of datafiles included in the backup BACKUP FULL;
RMAN> BACKUP FULL;
BACKUP INCREMENTAL
Incremental Backup Level 0 BACKUP INCREMENTAL LEVEL <level_number> [CUMULATIVE | DIFFERENTIAL> ....
RMAN> BACKUP INCREMENTAL LEVEL 0 DATABASE;
Incremental Backup Level 1. Run to back up blocks that have changed since most recent level 0 or 1 RMAN> BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE;

RMAN> BACKUP INCREMENTAL LEVEL 1 DIFFERENTIAL TABLESPACE users;

RMAN> BACKUP INCREMENTAL LEVEL 1 CUMULATIVE SKIP INACCESSIBLE DATABASE;
BACKUP KEEP
The keepOption subclause is used to specify the status of a backup or copy in relation to a retention policy BACKUP KEEP <FOREVER | UNTIL TIME 'date_string'> [RESTORE POINT <restore_point_name>]
-- this demo contains an exception you must keep in mind if wishing to use this option
RMAN> BACKUP TABLESPACE UWDATA KEEP UNTIL TIME '10-SEP-2016';

Starting backup at 04-SEP-16
starting full resync of recovery catalog
full resync complete
current log archived

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=145 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=26 device type=DISK
backup will be obsolete on date 10-SEP-16
archived logs required to recover from this backup will be backed up
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=C:\ORACLE\ORADATA\ORABASE\UWDATA01.DBF
channel ORA_DISK_1: starting piece 1 at 04-SEP-16
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 09/04/2016 16:49:09
ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes
Copies two datafiles and 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;
BACKUP MAXSETSIZE
Use the MAXSETSIZE parameter of the CONFIGURE CHANNEL or ALLOCATE CHANNEL command to limit the size of backup pieces BACKUP ... MAXSETSIZE ....;
RMAN> BACKUP DEVICE TYPE disk MAXSETSIZE 10G ARCHIVELOG ALL;
BACKUP NOCHECKSUM
If you specify the NOCHECKSUM option, then RMAN does not perform a checksum of the blocks when writing the backup BACKUP NOCHECKSUM ...
RMAN> BACKUP NOCHECKSUM DATAFILE 5;

RMAN> BACKUP NOCHECKSUM TABLESPACE UWDATA PLUS ARCHIVELOG;

RMAN> BACKUP NOCHECKSUM TABLESPACE UWDATA;

Starting backup at 08-SEP-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=125 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=22 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=C:\ORACLE\ORADATA\ORABASE\UWDATA01.DBF
channel ORA_DISK_1: starting piece 1 at 08-SEP-16
channel ORA_DISK_1: finished piece 1 at 08-SEP-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_08\ O1_MF_NNNDF_TAG20160908T155925_76LL6HBQ_.BKP tag=TAG20160908T155925 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:23
Finished backup at 08-SEP-16

Starting Control File and SPFILE Autobackup at 08-SEP-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\AUTOBACKUP\2016_09_08\ O1_MF_S_761327971_76LL6NXS_.BKP comment=NONE
Finished Control File and SPFILE Autobackup at 08-SEP-16
BACKUP NOEXCLUDE
Do not exclude a tablespace previously excluded using CONFIGURE EXCLUDE BACKUP DATABASE NOEXCLUDE;
BACKUP DATABASE NOEXCLUDE;
BACKUP NOT BACKED UP
Backup not previously backed up by name or timestamp BACKUP NOT BACKED UP ...;
RMAN> BACKUP NOT BACKED UP TABLESPACE EXAMPLE;

RMAN> BACKUP NOT BACKED UP SINCE TIME 'SYSDATE-14' DATABASE PLUS ARCHIVELOG;
BACKUP POOL
Specifies the media pool in which the backup is stored. Consult your media management documentation to see whether POOL is supported. BACKUP POOL <integer> ....
RMAN> BACKUP POOL 1 VALIDATE ARCHIVELOG ALL;

Starting backup at 09-SEP-16
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=124 RECID=86 STAMP=761328242
input archived log thread=1 sequence=125 RECID=87 STAMP=761351587
channel ORA_DISK_2: starting archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=126 RECID=88 STAMP=761417042
input archived log thread=1 sequence=127 RECID=89 STAMP=761417817
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:00
List of Archived Logs
=====================
Thrd Seq     Status Blocks Failing Blocks Examined Name
---- ------- ------ -------------- --------------- ---------------
1    124     OK     0              820 C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_09_08\ O1_MF_1_124_76LLH2H4_.ARC
1    125     OK     0              81141 C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_09_08\ O1_MF_1_125_76M98HTC_.ARC
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:02
List of Archived Logs
=====================
Thrd Seq     Status Blocks Failing Blocks Examined Name
---- ------- ------ -------------- --------------- ---------------
1    126     OK     0              48214 C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_09_09\ O1_MF_1_126_76O9605V_.ARC
1    127     OK     0              5222 C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_09_09\ O1_MF_1_127_76O9Y9F5_.ARC
Finished backup at 09-SEP-16
BACKUP PROXY
Backs up the specified files with the proxy copy functionality, which gives the media management software control over the data transfer between storage devices and the datafiles on disk BACKUP DEVICE TYPE <device_type> PROXY <DATAFILE <integer> | ONLY <DATABASE | ARCHIVELOG ALL>>
BACKUP DEVICE TYPE sbt PROXY DATAFILE 42;

BACKUP DEVICE TYPE sbt PROXY ONLY ARCHIVELOG ALL;

BACKUP DEVICE TYPE sbt PROXY ONLY DATABASE;
BACKUP RECOVERY AREA
Back up the fast recovery area BACKUP RECOVERY AREA;
RMAN> BACKUP RECOVERY AREA;
BACKUP REUSE
REUSE enables RMAN to overwrite an already existing backup or copy with the same filename as the file that BACKUP is currently creating BACKUP REUSE ....
RMAN> BACKUP REUSE TABLESPACE example;

Starting backup at 09-SEP-16
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=C:\ORACLE\ORADATA\ORABASE\EXAMPLE01.DBF
channel ORA_DISK_1: starting piece 1 at 09-SEP-16
channel ORA_DISK_1: finished piece 1 at 09-SEP-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_09\ O1_MF_NNNDF_TAG20160909T201348_76OOHFFO_.BKP tag=TAG20160909T201348 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 09-SEP-16

Starting Control File and SPFILE Autobackup at 09-SEP-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\AUTOBACKUP\2016_09_09\ O1_MF_S_761429645_76OOHYSD_.BKP comment=NONE
Finished Control File and SPFILE Autobackup at 09-SEP-16
BACKUP SECTION (aka multisection backup)
Section large datafiles so that a backup need not backup an entire file at once but rather can do it in sections BACKUP SECTION SIZE <size_integer><magnitude_character> TABLESPACE <tablespace_name>;
RMAN> BACKUP SECTION SIZE 500M TABLESPACE uwdata;
BACKUP SKIP
Excludes datafiles or archived redo log files from the backup if they are inaccessible, offline, or read-only BACKUP SKIP <INACCESSIBLE | OFFLINE | READONLY >
RMAN> BACKUP DATABASE SKIP OFFLINE;

Starting backup at 23-SEP-16
starting full resync of recovery catalog
full resync complete
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=142 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=141 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=C:\ORACLE\ORADATA\ORABASE\SYSAUX01.DBF
input datafile file number=00005 name=C:\ORACLE\ORADATA\ORABASE\EXAMPLE01.DBF
input datafile file number=00004 name=C:\ORACLE\ORADATA\ORABASE\USERS01.DBF
input datafile file number=00003 name=C:\ORACLE\ORADATA\ORABASE\UNDOTBS01.DBF
channel ORA_DISK_1: starting piece 1 at 23-SEP-16
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00001 name=C:\ORACLE\ORADATA\ORABASE\SYSTEM01.DBF
input datafile file number=00006 name=C:\ORACLE\ORADATA\ORABASE\UWDATA01.DBF
input datafile file number=00007 name=C:\ORACLE\ORADATA\ORABASE\CATTBS01.DBF
channel ORA_DISK_2: starting piece 1 at 23-SEP-16
channel ORA_DISK_1: finished piece 1 at 23-SEP-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_23\ O1_MF_NNNDF_TAG20160923T201640_77TLWWD6_.BKP tag=TAG20160923T201640 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:48
channel ORA_DISK_2: finished piece 1 at 23-SEP-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_23\ O1_MF_NNNDF_TAG20160923T201640_77TLWY00_.BKP tag=TAG20160923T201640 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:01:56
Finished backup at 23-SEP-16

Starting Control File and SPFILE Autobackup at 23-SEP-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\AUTOBACKUP\2016_09_23\ O1_MF_S_762639523_77TM0O5C_.BKP comment=NONE
Finished Control File and SPFILE Autobackup at 23-SEP-16
BACKUP SPFILE
Backup the Server Parameter file to the default or specified location BACKUP SPFILE [TO DESTINATION <destination_path>]
RMAN> backup spfile to destination 'c:\stage';

Starting backup at 17-AUG-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=150 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 17-AUG-16
channel ORA_DISK_1: finished piece 1 at 17-AUG-16
piece handle=C:\STAGE\ORABASE\BACKUPSET\2016_08_17\O1_MF_NNSNF_TAG20160817T101852_74QXZX3F_.BKP tag=TAG20160817T101852 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 17-AUG-16
BACKUP TABLESPACE
Backup a named tablespace BACKUP TABLESPACE <tablespace_name>;
RMAN> backup tablespace users;

Starting backup at 02-SEP-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=144 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=151 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=C:\ORACLE\ORADATA\ORABASE\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 02-SEP-16
channel ORA_DISK_1: finished piece 1 at 02-SEP-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_02\ O1_MF_NNNDF_TAG20160902T204201_7638JCBQ_.BKP tag=TAG20160902T204201 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 02-SEP-16

Starting Control File and SPFILE Autobackup at 02-SEP-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\AUTOBACKUP\ 2016_09_02\O1_MF_S_760826527_7638JJQX_.BKP comment=NONE
Finished Control File and SPFILE Autobackup at 02-SEP-16
BACKUP TAG
Backup the database and apply a user specified tag, This is only supported with a recovery catalog. BACKUP TAG '<tag_name>' ....
RMAN> BACKUP TAG 'weekly_full_db_bkup' DATABASE MAXSETSIZE 2G;

RMAN> BACKUP TAG Q107 DATABASE KEEP FOREVER;
BACKUP VALIDATE
Verify backup components are valid BACKUP VALIDATE <ARCHIVELOG | AS .... | AUXILIARY | BACKUPSET | BACKUP | CHANNEL | CHECK | CONTROLFILECOPY | COPIES | COPY | CUMULATIVE | CURRENT DATABASE | DATAFILECOPY | DATAFILE | DB_FILE_NAME_CONVERT | DB_RECOVERY_FILE_DEST | DEVICE | DISKRATIO | DURATION | FILESPERSET | FORCE | FORMAT | FOR | FROM | FULL | INCREMENTAL | KEEP | MAXSETSIZE | NOCHECKSUM | NOEXCLUDE | NOKEEP | NOT | POOL | PROXY | RECOVERY | REUSE | SECTION | SKIP READONLY | SKIP | SPFILE | TABLESPACE | TAG | TO | VALIDATE>
RMAN> BACKUP VALIDATE CHECK LOGICAL DATABASE;

RMAN> BACKUP VALIDATE CHECK LOGICAL DATAFILE 2;

RMAN> BACKUP VALIDATE CHECK LOGICAL RECOVERY AREA;

RMAN> BACKUP VALIDATE DB_RECOVERY_FILE_DEST;

-- after any of these:
SELECT *
FROM v$database_block_corruption;
Verify the spfile for backup RMAN> BACKUP VALIDATE SPFILE;

Starting backup at 19-AUG-16
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
List of Control File and SPFILE
===============================
File Type    Status Blocks Failing Blocks Examined
------------ ------ -------------- ---------------
SPFILE       OK     0              2
Finished backup at 19-AUG-16
Verify a tablespace for backup RMAN> BACKUP VALIDATE TABLESPACE 'UWDATA';

Starting backup at 19-AUG-16
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=C:\ORACLE\ORADATA\ORABASE\UWDATA01.DBF
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
6 OK 0 23217 32000 5105383
File Name: C:\ORACLE\ORADATA\ORABASE\UWDATA01.DBF
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 6872
Index 0 968
Other 0 943

Finished backup at 19-AUG-16
 
CATALOG
Adds information about file copies and user-managed backups to the repository.
CATALOG ARCHIVELOG
Back the named archive log CATALOG ARCHIVELOG '<file_name_list>'
RMAN> catalog archivelog 'c:\oracle\fast_recovery_area\orabase\archivelog\2016_09_22\O1_MF_1_154_77R4NCMK_.ARC';

cataloged archived log
archived log file name=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_09_22\O1_MF_1_154_77R4NCMK_.ARC RECID=160 STAMP=762640802
CATALOG BACKUPPIECE
Catalogs the backup pieces in the new location CATALOG BACKUPPIECE <file_name_list>
RMAN> CATALOG BACKUPPIECE '/u01/c-874220581-20080315-01'
      USING target database control file instead of recovery catalog
      cataloged backup piece
      backup piece handle=/u01/c-874220581-20080315-01 RECID=8 STAMP=607695990;
CATALOG CONTROLFILECOPY
Catalog the control files identified CATALOG CONTROLFILECOPY <controlfilecopy_name_list>
RMAN> COPY CURRENT CONTROLFILE TO '/stage';

RMAN> CATALOG CONTROLFILECOPY '/stage/control01.ctl'
CATALOG DATAFILECOPY
Specifies that the datafile copy should be recorded as a level 0 incremental backup (0 is the only valid value of LEVEL) DATAFILECOPY <file_name_list> LEVEL <integer>
RMAN> CATALOG DATAFILECOPY '/stage/users01.dbf';
RMAN> CATALOG DATAFILECOPY '/u02/backup/users01.bak' LEVEL 0;
RMAN> LIST COPY;
CATALOG DB_RECOVERY_FILE_DEST
Catalog the Backup Pieces held in the location set by DB_RECOVERY_FILE_DEST CATALOG DB_RECOVERY_FILE_DEST
RMAN> CATALOG DB_RECOVERY_FILE_DEST;
CATALOG RECOVERY AREA
Catalog all files in the currently enabled fast recovery area CATALOG RECOVERY AREA [NOPROMPT];
RMAN> CATALOG RECOVERY AREA NOPROMPT;

searching for all files in the recovery area
no files found to be unknown to the database

List of files in Recovery Area not managed by the database
==========================================================
File Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\CONTROL02.CTL
RMAN-07526: Reason: File is not an Oracle Managed File

number of files not managed by recovery area is 1, totaling 9.31MB
CATALOG START WITH
Catalog all files in a named disk location CATALOG START WITH <path_name> [NOPROMPT];
RMAN> CATALOG START WITH '/u02/archivelog' 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 [ALL] ....
HOST 'mv $ORACLE_HOME/oradata/trgt/arch/* /fs2/arch';
RMAN> CHANGE ARCHIVELOG ALL UNCATALOG;
RMAN> CATALOG START WITH '/fs2/arch';
Crosscheck archivelogs. This should be run if archivelogs have been deleted and can not be recovered to tell the database to ignore the missing files. RMAN> CHANGE ARCHIVELOG ALL CROSSCHECK;
CHANGE BACKUP
Change the status of all backups of server parameter files created more than a day ago to UNAVAILABLE CHANGE BACKUP OF <ARCHIVELOG | SPFILE> ...
RMAN> CHANGE BACKUP OF SPFILE COMPLETED BEFORE 'SYSDATE-1' UNAVAILABLE;

RMAN> CHANGE BACKUP OF ARCHIVELOG ALL NOKEEP;
Associate proda with the primary database RMAN> CHANGE BACKUP FOR DB_UNIQUE_NAME proda RESET DB_UNIQUE_NAME;
Associate standby prodb with standby proda RMAN> CHANGE BACKUP FOR DB_UNIQUE_NAME prodb RESET DB_UNIQUE_NAME TO proda;
CHANGE BACKUPPIECE
Change the status of a backuppiece CHANGE BACKUPPIECE ...
RMAN>CHANGE BACKUPPIECE '/u04/oradata/09dtq55d_1_2' UNCATALOG;
CHANGE BACKUPSET & CHANGE BACKUP TAG
Change the status a backup set CHANGE BACKUPSET <backupset_number> [AVAILABLE | UNAVAILABLE];
RMAN> CHANGE BACKUPSET 42 UNAVAILABLE;
Change an ordinary backup into a permanent backup CHANGE BACKUP TAG <backupset_name> KEEP FOREVER [LOGS | NOLOGS];
RMAN> CHANGE BACKUP TAG 'consistent_db_bkup' KEEP FOREVER NOLOGS;
Change an ordinary backup into a longer-term backup CHANGE BACKUPSET <backupset_name> KEEP UNTIL TIME <TIMESTAMP> [LOGS | NOLOGS];
RMAN> CHANGE BACKUP TAG 'consistent_db_bkup' KEEP UNTIL 'SYSDATE+90' LOGS;
Remove the non-default keep status of a  backup CHANGE BACKUPSET <backupset_identifier> NOKEEP;
RMAN> CHANGE BACKUPSET '42' NOKEEP;
CHANGE CONTROLFILECOPY
Change a controlfile copy CHANGE CONTROLFILECOPY ...
RMAN> backup as copy current controlfile;

Starting backup at 25-SEP-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=125 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=30 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\CONTROLFILE\ O1_MF_TAG20160925T173734_77ZLBN7C_.CTL tag=TAG20160925T173734 RECID=2 STAMP=762802661
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 25-SEP-16

Starting Control File and SPFILE Autobackup at 25-SEP-16
piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\AUTOBACKUP\2016_09_25\ O1_MF_S_762802665_77ZLBT7V_.BKP comment=NONE
Finished Control File and SPFILE Autobackup at 25-SEP-16

RMAN> CHANGE CONTROLFILECOPY 'C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\CONTROLFILE\ O1_MF_TAG20160925T173734_77ZLBN7C_.CTL' AVAILABLE;

released channel: ORA_DISK_1
released channel: ORA_DISK_2
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=125 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=30 device type=DISK
changed control file copy available
control file copy file name=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\CONTROLFILE\ O1_MF_TAG20160925T173734_77ZLBN7C_.CTL RECID=2 STAMP=762802661
Changed 1 objects to AVAILABLE status
CHANGE COPY OF
Changes backup metadata in the catalog and/or controlfile CHANGE COPY ...
RMAN> CHANGE COPY OF ARCHIVELOG ALL UNCATALOG;

uncataloged archived log
archived log file name=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_09_22\ O1_MF_1_154_77R4NCMK_.ARC RECID=120 STAMP=762640802
uncataloged archived log
archived log file name=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_09_23\ O1_MF_1_155_77RP6GYR_.ARC RECID=117 STAMP=762577249
uncataloged archived log
archived log file name=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_09_23\ O1_MF_1_156_77S7G0MK_.ARC RECID=118 STAMP=762594896
uncataloged archived log
archived log file name=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_09_23\ O1_MF_1_157_77TL99G5_.ARC RECID=119 STAMP=762638779
uncataloged archived log
archived log file name=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_09_23\ O1_MF_1_158_77TS0L6T_.ARC RECID=121 STAMP=762645669
uncataloged archived log
archived log file name=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_09_24\ O1_MF_1_159_77X76B3F_.ARC RECID=122 STAMP=762725727
uncataloged archived log
archived log file name=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2016_09_25\ O1_MF_1_160_77ZB04BS_.ARC RECID=123 STAMP=762794136
Uncataloged 7 objects
CHANGE DATAFILECOPY
Update catalog information  on a datafile copy CHANGE DATAFILECOPY <path_and_file_name> [AVAILABLE | CATALOG | UNAVAILABLE];
RMAN> CHANGE DATAFILECOPY '/u01/oradata/orabase/uwdata01.dbf' CATALOG;

RMAN> CHANGE DATAFILECOPY '/u01/oradata/orabase/uwdata01.dbf' UNAVAILABLE;
CHANGE DB_UNIQUE_NAME
Change the DB_UNIQUE_NAME in the catalog CHANGE DB_UNIQUE_NAME FROM <db_unique_name> TO <db_unique_name>;
RMAN> CHANGE DB_UNIQUE_NAME FROM proda TO dgproda;
CHANGE FAILURE
Changes the status of a failure CHANGE FAILURE <ALL | CRITICAL | HIGH | LOW | <failure_number_list>> [EXCLUDE FAILURE <failure_number>] <CLOSED | PRIORITY <HIGH | LOW> [NOPROMPT]
RMAN> LIST FAILURE;

no failures found that match specification

RMAN> CHANGE FAILURE 1 CLOSED;

no failures found that match specification
 
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

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;
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/fast_recovery_area/snapshot.ctl';
CONFIGURE ARCHIVE
For Data Guard: Applies the deletion policy to the standby CONFIGURE ARCHIVE DELETION POLICY TO APPLIED ON STANDBY;
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
RMAN> CONFIGURE ARCHIVE DELETION POLICY TO APPLIED ON STANDBY;
CONFIGURE AUXNAME
Set and clear an auxiliary name for a datafile CONFIGURE AUXNAME FOR DATAFILE <data_file_number> TO <path_and_file_name>;
CONFIGURE AUXNAME FOR DATAFILE CLEAR;
RMAN> CONFIGURE AUXNAME FOR DATAFILE 5 TO '/home/oracle/auxfiles/aux1.f';

RMAN> CONFIGURE AUXNAME FOR DATAFILE 4 CLEAR;
CONFIGURE BACKUP OPTIMIZATION
Backup or don't backup unchanged files CONFIGURE BACKUP OPTIMIZATION <ON | OFF>;
See SHOW BACKUP OPTIMIZATION Demo
CONFIGURE CHANNEL
Configure a backup channel to tape CONFIGURE CHANNEL <DEVICE TYPE | INTEGER> <configuration | CLEAR>
RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' CLEAR;
CONFIGURE COMPRESSION
Configure a backup compression algorithm CONFIGURE COMPRESSION ALGORITHM <CLEAR | '<quoted_string>'>
SELECT algorithm_name, algorithm_description
FROM v$rman_compression_algorithm;

RMAN> CONFIGURE COMPRESSION ALGORITHM 'MEDIUM';

RMAN> CONFIGURE COMPRESSION ALGORITHM 'BASIC';
CONFIGURE CONTROLFILE AUTOBACKUP
Enable autobackup and configure the default autobackup format for a DISK device CONFIGURE CONTROLFILE AUTOBACKUP <ON | OFF | FORMAT FOR DEVICE ....>.;
CONFIGURE CONTROLFILE AUTOBACKUP ON;

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
Configure the location for controlfile autobackups CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u02/%F';
CONFIGURE DB_UNIQUE_NAME
Create a new connection to a physical standby CONFIGURE DB_UNIQUE_NAME '<db_unique_name>' <CLEAR | CONNECT IDENTIFIER '<quoted_string>'>
RMAN> CONFIGURE DB_UNIQUE_NAME 'PRODB' CONNECT IDENTIFIER 'REPOBETA';
Set and clear encryption CONFIGURE ENCRYPTION ALGORITHM <CLEAR | encryption_algorithm>
SQL> col algorithm_name format a20
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 Database or Tablespace Encryption CONFIGURE ENCRYPTION FOR <DATABASE | TABLESPACE <tablespace_name> <ON | OFF | CLEAR>
RMAN> CONFIGURE ENCRYPTION FOR DATABASE ON;

RMAN> CONFIGURE ENCRYPTION FOR TABLESPACE uwdata OFF;
CONFIGURE DEFAULT DEVICE TYPE TO
Changes the default device type to the default device type specified CONFIGURE DEFAULT DEVICE TYPE TO <disk | sbt>
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO disk;

new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
new RMAN configuration parameters are successfully stored
CONFIGURE DEVICE TYPE
Change the default configuration of a backup device CONFIGURE DEFAULT DEVICE TYPE <disk | sbt> ....;
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 2;

new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
CONFIGURE EXCLUDE FOR TABLESPACE
Exclude a tablespace from RMAN backup CONFIGURE EXCLUDE FOR TABLESPACE <tablespace_name>;
CONFIGURE EXCLUDE FOR TABLESPACE staging;
CONFIGURE RETENTION POLICY
Retention Policy CONFIGURE RETENTION POLICY TO REDUNDANCY <integer>;
See CONFIGURE ARCHIVE Demo Above
 
CONNECT
Creates a connection between RMAN and a target, auxiliary, or recovery catalog database.
CONNECT AUXILIARY
Auxiliary CONNECT AUXILIARY <user_id>/<password>@<instance>
$ rman auxiliary oracle/oracle1@prodb
CONNECT CATALOG & TARGET
Catalog CONNECT CATALOG
$ rman catalog repoomega/oracle1@repos

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

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

RMAN> connect target / catalog repoomega/oracle1@repos
Target without a Catalog CONNECT TARGET <user_id>/<password>@<instance> NOCATALOG
$ 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 DATABASE '<db_name>'
TRANSPORT SCRIPT '<script_location>'
TO PLATFORM '<platform_name>'
DB_FILE_NAME_CONVERT '<source_location> <destination_location>'
CONVERT DATABASE
NEW DATABASE 'prodb'
TRANSPORT SCRIPT '/tmp/convertdb/transportscript'
TO PLATFORM 'Linux IA (64-bit)'
DB_FILE_NAME_CONVERT '/u01/oradata', '/stage/dbfiles';
CONVERT DATAFILE
Converts the datafiles to be transported to the destination host format and deposits the results in /u02/oradata CONVERT DATAFILE <datafile_name_list>
DB_FILE_NAME_CONVERT '<source_location> <destination_location>'
FROM PLATFORM <original_platform_name>
CONVERT DATAFILE
'/tmp/transport_from_aix/u01/uwdata01.dbf',
'/tmp/transport_from_aix/u01/uwdata02.dbf',
'/tmp/transport_from_aix/u03/users01.dbf',
'/tmp/transport_from_aix/u03/users02.dbf'
DB_FILE_NAME_CONVERT
'/app/oracle/product/oradata','/stage/oradata',
'/tmp/transport_from_solaris/hr','/stage/oradata'
FROM PLATFORM 'Linux IA (64-bit)';
CONVERT TABLESPACE
Convert a tablespaces to 64 bit Linux CONVERT TABLESPACE <tablespace_name_list> TO PLATFORM <platform_name> FORMAT '<format_string>'
desc v$transportable_platform

SELECT platform_name, endian_format
FROM v$transportable_platform;

CONVERT TABLESPACE uwdata, users TO PLATFORM 'Linux IA (64-bit)'
FORMAT '/app/oracle/product/fast_recovery_area/linux64/%U';
 
CREATE
Initiates creation of RMAN public and virual private catalogs, scripts, and flashback database restore points.
CREATE CATALOG
Create a recovery catalog or a virtual private catalog CREATE [VIRTUAL] CATALOG;
C:\Documents and Settings\Owner>rman target / catalog repoomega/oracle1@pdbdev

Recovery Manager: Release 12.1.0.2.0 - Production on Thu Dec 29 10:37:33 2016

Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.

connected to target database: ORABASE (DBID=1984521206)
connected to recovery catalog database

RMAN> CREATE CATALOG;

recovery catalog created

RMAN> DROP CATALOG;

SQL> SELECT object_type, COUNT(*)
     FROM user_objects;
CREATE GLOBAL SCRIPT
Create and store a global script in the repository CREATE GLOBAL SCRIPT '<script_name>' [COMMENT '<comment>'] ....
RMAN> CREATE GLOBAL SCRIPT global_backup { BACKUP DATABASE PLUS ARCHIVELOG; }
CREATE RESTORE POINT
Create a restore point CREATE RESTORE POINT <restore_point_name>
RMAN> CREATE RESTORE POINT app_patch;
RMAN> DROP RESTORE POINT app_patch;
CREATE SCRIPT
Creates a stored script called backup_whole that backs up the database and archived redo logs CREATE [GLOBAL] SCRIPT '<script_name>'
COMMENT '<comment>'
{RMAN_command_list}
FROM FILE '<file_name>'
CREATE SCRIPT backup_whole
COMMENT "backup whole database and logs"
{
  BACKUP INCREMENTAL LEVEL 0 TAG b_whole_l0
  DATABASE PLUS ARCHIVELOG;
}

created script backup_whole
Creates a stored script called backup_whole that backs up the database and archived redo logs CREATE GLOBAL SCRIPT global_backup_db
COMMENT "backup any database from the recovery catalog, with logs"
{
  BACKUP DATABASE PLUS ARCHIVELOG;
}
Create a stored script from an O/S file RMAN> CREATE SCRIPT /u01/staging/global_backup_db;
CREATE VIRTUAL
Create a virtual private catalog. Only works when a catalog does not already exist CREATE VIRTUAL CATALOG ....
RMAN> CREATE VIRTUAL CATALOG;
 
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
AVAILABLE The Object is available for use by RMAN. For a backup set to be AVAILABLE, all set backup pieces must be AVAILABLE.
EXPIRED Object is not found either in file system (for DISK) or in the media manager (for sbt). Note that for a backup 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 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 <archivelogRecordSpecifier> ALL;
RMAN> RUN {
  ALLOCATE CHANNEL d1 FOR MAINTENANCE DEVICE TYPE DISK;
  CROSSCHECK ARCHIVELOG ALL;
  RELEASE CHANNEL;
}
CROSSCHECK BACKUP
Crosscheck all backup sets CROSSCHECK BACKUP;
RMAN> CROSSCHECK BACKUP;

using channel ORA_DISK_1
using channel ORA_DISK_2
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_08_21\ O1_MF_ANNNN_TAG20160821T220151_753RP3L2_.BKP RECID=3 STAMP=759794515
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_08_21\ O1_MF_ANNNN_TAG20160821T220151_753RPK00_.BKP RECID=4 STAMP=759794528
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_08_22\ O1_MF_ANNNN_TAG20160822T223438_756GZJX9_.BKP RECID=6 STAMP=759882880
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_08_22\ O1_MF_ANNNN_TAG20160822T223438_756GZHTV_.BKP RECID=7 STAMP=759882879
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_01\ O1_MF_ANNNN_TAG20160901T220144_760RSVXS_.BKP RECID=10 STAMP=760744907
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_01\ O1_MF_ANNNN_TAG20160901T220144_760RSWMK_.BKP RECID=11 STAMP=760744907
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_01\ O1_MF_ANNNN_TAG20160901T220144_760RTO1Y_.BKP RECID=12 STAMP=760744933
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_01\ O1_MF_ANNNN_TAG20160901T220144_760RTRQX_.BKP RECID=13 STAMP=760744933
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_01\ O1_MF_ANNNN_TAG20160901T220144_760RV4Y8_.BKP RECID=14 STAMP=760744948
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_01\ O1_MF_ANNNN_TAG20160901T220144_760RVBSW_.BKP RECID=15 STAMP=760744950
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_01\ O1_MF_ANNNN_TAG20160901T220144_760RVJC7_.BKP RECID=16 STAMP=760744959
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_01\ O1_MF_ANNNN_TAG20160901T220144_760RVN0Z_.BKP RECID=17 STAMP=760744963
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_01\ O1_MF_ANNNN_TAG20160901T220144_760RVW2G_.BKP RECID=18 STAMP=760744972
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_01\ O1_MF_ANNNN_TAG20160901T220540_760S15X9_.BKP RECID=20 STAMP=760745141
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\AUTOBACKUP\2016_09_01\ O1_MF_S_760745144_760S19CQ_.BKP RECID=21 STAMP=760745145
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\BACKUPSET\2016_09_02\ O1_MF_NNNDF_TAG20160902T204201_7638JCBQ_.BKP RECID=22 STAMP=760826523
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\AUTOBACKUP\2016_09_02\ O1_MF_S_760826527_7638JJQX_.BKP RECID=23 STAMP=760826528
Crosschecked 17 objects
Allocate a channel, crosscheck backups in a date range and release the channel after use CROSSCHECK BACKUP DEVICE ....
RMAN> RUN {
  ALLOCATE CHANNEL d1 FOR MAINTENANCE DEVICE TYPE DISK;
  CROSSCHECK BACKUP DEVICE TYPE DISK COMPLETED BETWEEN '01-JUL-16' AND '30-SEP-16';
  RELEASE CHANNEL;
}
Crosscheck a controlfile backup CROSSCHECK BACKUP OF CONTROLFILE;
RMAN> CROSSCHECK BACKUP OF CONTROLFILE;
Crosscheck all database datafile backups CROSSCHECK BACKUP OF DATABASE;
RMAN> CROSSCHECK BACKUP OF DATABASE;
Crosscheck a datafile backup CROSSCHECK BACKUP OF DATAFILE <datafile_number>;
RMAN> CROSSCHECK BACKUP OF DATAFILE 7;
Crosscheck the SPFILE backup CROSSCHECK BACKUP OF SPFILE;
RMAN> CROSSCHECK BACKUP OF SPFILE;
Crosscheck a tablespace backup CROSSCHECK BACKUP OF TABLESPACE <tablespace_name>;
RMAN> CROSSCHECK BACKUP OF TABLESPACE uwdata;
CROSSCHECK BACKUPPIECE
Checks that specific backuppieces still exist CROSSCHECK BACKUPPIECE <backuppiece_identifier>;
RMAN> CROSSCHECK BACKUPPIECE 4;
CROSSCHECK BACKUPSET
Checks that specific backupsets still exist CROSSCHECK BACKUPSET OF <backupset identifier>;
RMAN> CROSSCHECK BACKUPSET OF TABLESPACE UWDATA;
CROSSCHECK COPY
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. CROSSCHECK COPY OF ARCHIVELOG [ALL];
RMAN> CROSSCHECK COPY OF ARCHIVELOG ALL;
CROSSCHECK CONTROLFILECOPY
Checks that specific controlfile copies still exist CROSSCHECK CONTROLFILECOPY <control_file_identifier>;
RMAN> CROSSCHECK CONTROLFILECOPY 1;
CROSSCHECK DATAFILECOPY
Checks that specific datafile copies still exist CROSSCHECK DATAFILECOPY <ALL | INTEGER | LIKE | QUOTED_STRING>
RMAN> CROSSCHECK DATAFILECOPY ALL;
CROSSCHECK FOREIGN
Crosscheck all foreign archived redo logs CROSSCHECK FOREIGN ARCHIVELOG <ALL | FROM | HIGH | LOGSEQ | LOW | SCN | SEQUENCE | TIME | UNTIL> ....
RMAN> CROSSCHECK FOREIGN ARCHIVELOG ALL;
CROSSCHECK PROXY
Crosscheck the existence of a specific proxy copy CROSSCHECK PROXY ...
RMAN> CROSSCHECK PROXY 941;
 
DEBUG
This command is officially undocumented by Oracle.
Commands for the RMAN debugger DEBUG <ALL | DUPLICATE | OFF | ON | RECOVER | RESTORE | RESYNC | SQL>
RMAN> DEBUG ALL;
RMAN> DEBUG OFF;
 
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 <ALL | FROM | HIGH | LIKE | LOGSEQ | LOW | QUOTED_STRING | SCN | SEQUENCE | TIME | UNTIL> ....
RMAN> LIST ARCHIVELOG LIKE '%';
RMAN> CROSSCHECK ARCHIVELOG LIKE '%';
RMAN> DELETE ARCHIVELOG LIKE '%';
Delete archivelogs older than 7 days if they have been backed up to tape RMAN> DELETE NOPROMPT ARCHIVELOG ALL UNTIL 'SYSDATE-7' BACKED UP 1 TIMES TO TAPE;
DELETE BACKUP
Delete Backup Set DELETE [NOPROMPT] BACKUP OF DATABASE COMPLETED BEFORE '<timestamp>';
RMAN> DELETE NOPROMPT BACKUP OF DATABASE COMPLETED BEFORE 'SYSDATE-7';
DELETE BACKUPPIECE
Delete a BackupPiece DELETE [NOPROMPT] BACKUPPIECE <backuppiece_name>;
RMAN> DELETE NOPROMPT BACKUPPIECE '/u06/oracle_backups/oradata/orabaes/uwdata01.bak';
DELETE BACKUPSET
Delete both Disk and Tape Backup Sets DELETE BACKUPSET ....
# back up datafile to disk and tape
RMAN> BACKUP DEVICE TYPE DISK DATAFILE 1 TAG "weekly_bkup";
RMAN> BACKUP DEVICE TYPE sbt DATAFILE 1 TAG "weekly_bkup";

# manually allocate disk and sbt channels
RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;
RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE SBT;
RMAN> DELETE BACKUPSET TAG "weekly_bkup";
DELETE EXPIRED
Deletes expired backup records DELETE [FORCE | NOPROMPT] EXPIRED <maintenance_spec> [for db_unique_name_option];
RMAN> CROSSCHECK BACKUP;
RMAN> DELETE EXPIRED BACKUP;

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 FORCE
Force a requested deletion DELETE FORCE <ARCHIVELOG | BACKUPPIECE | BACKUPSET | BACKUP | CONTROLFILECOPY | COPY | DATAFILECOPY | EXPIRED | FOREIGN | NOPROMPT | OBSOLTE | PROXY> ....
RMAN> DELETE FORCE BACKUP;
DELETE OBSOLETE
Delete Obsolete DELETE [FORCE | NOPROMPT] OBSOLETE [obsOperandList] [device_type] [device_specifier];
RMAN> DELETE FORCE OBSOLETE;

starting full resync of recovery catalog
full resync complete
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=22 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=144 device type=DISK
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 140 17-AUG-16
Backup Piece 141 17-AUG-16 C:\STAGE\ORABASE\BACKUPSET\2016_08_17\O1_MF_NNSNF_TAG20160817T101852_74QXZX3F_.BKP
Backup Set 354 22-AUG-16
Backup Piece 357 22-AUG-16 C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\AUTOBACKUP\2016_08_22\O1_MF_S_759882888_756GZSYR_.BKP

Do you really want to delete the above objects (enter YES or NO)? YES
deleted backup piece
backup piece handle=C:\STAGE\ORABASE\BACKUPSET\2016_08_17\ O1_MF_NNSNF_TAG20160817T101852_74QXZX3F_.BKP RECID=1 STAMP=759406733
deleted backup piece
backup piece handle=C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\AUTOBACKUP\2016_08_22\ O1_MF_S_759882888_756GZSYR_.BKP RECID=8 STAMP=759882889
Deleted 2 objects
DELETE SCRIPT
Deletes a stored script b_whole_10 from the recovery catalog DELETE [GLOBAL] SCRIPT '<script_name>';
# rman TARGET / CATALOG rman/cat@catdb

RMAN> DELETE SCRIPT proda_backup_db;

RMAN> DELETE GLOBAL SCRIPT global_backup_db;
 
DESCRIBE
Use to list the column definitions of a table or view just as you would in SQL*Plus.

To access a table or view in another schema, you must have READ ANY TABLE or SELECT [ANY TABLE] privileges on the object or connect in AS SYSDBA mode. The SYSBACKUP privilege does not grant access to user tables or views.
Describe a table DESC[RIBE] [CATALOG] [SCHEMA].<table_or_view_name> [@<database_link>];
conn / as sysdba

# host

# rman target /

RMAN> describe tab$

RMAN> desc obj$
 
DROP
Command initiates dropping 3 of the 4 objects created with the CREATE command: an RMAN catalog, a database, or a flashback database restore point.
DROP CATALOG
Drops the current RMAN catalog DROP CATALOG;
See CREATE CATALOG Demo Above
DROP DATABASE
Use RMAN to issue the drop database command DROP DATABASE;
No demo is shown as this is something I recommend against doing within RMAN
DROP RESTORE POINT
Drop a restore point DROP RESTORE POINT <restore_point_name>;
See CREATE RESTORE POINT Demo Above
 
DUPLICATE
Use to create a full or subset copy of a source database as either a primary or standby database. Database duplication can be performed in any of the following modes:
  • Active Duplication: RMAN duplicates the files directly from either an open or mounted database. Active duplication can use image copies or backup sets. Backup sets offer several advantages, including unused block compression and encryption.
  • Backup-based duplication without a target connection: Creates duplicate files from pre-existing RMAN backups or copies. The DUPLICATE command must have been issued with the DATABASE clause. This form requires a connection to an auxiliary instance and a recovery catalog and is useful when the target database is not available or a connection to it is not desirable (as mandated by security policy restrictions or a firewall).
  • Backup-based duplication with a target connection: RMAN creates duplicate files from pre-existing RMAN backups and copies.
  • Backup-based duplication without a connection to target or a recovery catalog: RMAN creates duplicate files from RMAN backups and copies that were placed in a designated BACKUP LOCATION

This full syntax of the DUPLICATE command is extensive. Only a single example has been placed in the library for now and others will be added from time-to-time.

DUPLICATE
Duplicate Database DUPLICATE DATABASE TO <new_name>
LOGFILE '<redo_log_file_path_and_name>' SIZE <integer> <M | G>
[SKIP READONLY] [NOFILENAMECHECK];
TBD
Duplicate For DUPLICATE FOR [FARSYNC | STANDBY] <duplicate_options_list>;
TBD
Allocates auxiliary channels and duplicates the target database as newdb DUPLICATE [TARGET] DATABASE TO <new_name>
LOGFILE '<redo_log_file_path_and_name>' SIZE <integer> <M | G>
[SKIP READONLY] [NOFILENAMECHECK];
RUN {
  ALLOCATE AUXILIARY CHANNEL d1 DEVICE TYPE DISK;
  ALLOCATE AUXILIARY CHANNEL d2 DEVICE TYPE DISK;
  DUPLICATE TARGET DATABASE TO newdb
    LOGFILE
      '?/oradata/aux1/redo01.log' SIZE 150M,
      '?/oradata/aux1/redo02.log' SIZE 150M,
      '?/oradata/aux1/redo03.log' SIZE 150M
  SKIP READONLY
  NOFILENAMECHECK;
}
Duplicate To DUPLICATE TO '<database_name>' <duplicate_options_list>;
TBD
 
EXECUTE SCRIPT
Run a global or local RMAN script stored in the RMAN repository.
Run a script EXCUTE GLOBAL] SCRIPT '<script_name>' USING <string_or_numberic_substitution_parameter_values>;
RMAN> CREATE GLOBAL SCRIPT global_backup_db { BACKUP DATABASE PLUS ARCHIVELOG; }

starting full resync of recovery catalog
full resync complete
created global script global_backup_db

RMAN> PRINT SCRIPT global_backup_db;

printing stored global script: global_backup_db
{ BACKUP DATABASE PLUS ARCHIVELOG; }

RMAN> RUN { EXECUTE GLOBAL SCRIPT global_backup_db; }

executing global script: global_backup_db
 
EXIT
Exit from RMAN to the preceding environment
Exit RMAN EXIT [TARGET];
RMAN> target /
RMAN> EXIT;

or

RMAN> HOST;
*$ EXIT;
RMAN>
 
FLASHBACK DATABASE
Enables running the FLASHBACK DATABASE command from within RMAN
FLASHBACK DATABASE
Returns the database to its state state prior to a specific system change number FLASHBACK DATABASE TO BEFORE SCN <integer>;
RMAN> FLASHBACK DATABASE TO BEFORE SCN=42678315;
Returns the database to its state prior to a specific sequence FLASHBACK DATABASE TO BEFORE SEQUENCE <integer> [THREAD <integer>];
TBD
Returns the database to its state prior to a RESETLOGS statement FLASHBACK DATABASE TO BEFORE RESETLOGS;
RMAN> FLASHBACK DATABASE TO BEFORE RESETLOGS;
Returns the database to its state prior to a previous date and time FLASHBACK DATABASE TO BEFORE TIME '<date_time>'
RMAN> FLASHBACK DATABASE TO BEFORE TIME SYSDATE-1;
Returns the database to its state at a previous time or SCN FLASHBACK DATABASE TO BEFORE SCN <integer>;
RMAN> FLASHBACK DATABASE TO SCN=42678315;
Returns the database to its state after a specific sequence FLASHBACK DATABASE TO SEQUENCE <integer> [THREAD <integer>];
TBD
Returns the database to its state at a named RESTORE POINT FLASHBACK DATABASE TO RESTOREPOINT <restore_point_name>;
RMAN> FLASHBACK DATABASE TO RESTOREPOINT start_app_upgrade;
Returns the database to its state at a previous date and time FLASHBACK DATABASE TO TIME '<date_time>'
RMAN> FLASHBACK DATABASE TO TIME SYSDATE-1.25;
 
FLASHBACK PLUGGABLE DATABASE
Enables running the FLASHBACK DATABASE command from within RMAN
Returns a PDB to its state state prior to a specific system change number FLASHBACK PLUGGABLE DATABASE TO BEFORE SCN <integer>;
RMAN> FLASHBACK PLUGGABLE DATABASE pdbdev TO BEFORE SCN=42678315;
Returns a PDB to its state prior to a specific sequence FLASHBACK PLUGGABLE DATABASE TO BEFORE SEQUENCE <integer> [THREAD <integer>];
TBD
Returns a PDB to its state prior to a RESETLOGS statement FLASHBACK PLUGGABLE DATABASE TO BEFORE RESETLOGS;
RMAN> FLASHBACK PLUGGABLE DATABASE pdbdev TO BEFORE RESETLOGS;
Returns a PDB to its state prior to a previous date and time FLASHBACK PLUGGABLE DATABASE TO BEFORE TIME '<date_time>'
RMAN> FLASHBACK PLUGGABLE DATABASE pdbdev TO BEFORE TIME SYSDATE-1;
Returns a PDB to its state at a previous time or SCN FLASHBACK PLUGGABLE DATABASE TO BEFORE SCN <integer>;
RMAN> FLASHBACK PLUGGABLE DATABASE pdbdev TO SCN=42678315;
Returns a PDB to its state after a specific sequence FLASHBACK PLUGGABLE DATABASE TO SEQUENCE <integer> [THREAD <integer>];
TBD
Returns a PDB to its state at a named RESTORE POINT FLASHBACK PLUGGABLE DATABASE TO RESTOREPOINT <restore_point_name>;
RMAN> FLASHBACK PLUGGABLE DATABASE pdbdev TO RESTOREPOINT start_app_upgrade;
Returns a PDB to its state at a previous date and time FLASHBACK PLUGGABLE DATABASE TO TIME '<date_time>'
RMAN> FLASHBACK PLUGGABLE DATABASE pdbdev TO TIME SYSDATE-1.25;
 
GRANT
Find Desc
GRANT CATALOG
Grant privileges to a recovery catalog user GRANT CATALOG TO <schema_name>;
RMAN> GRANT CATALOG FOR DATABASE orabase TO repoomega;
GRANT REGISTER
Grant privileges to register a database with the catalog GRANT REGISTER TO <schema_name>;
RMAN> GRANT REGISTER DATABASE TO repoomega;
 
HOST
Find Desc
HOST
Shell out of RMAN to the operating system for command execution HOST
See EXIT Demo Above
 
IMPORT CATALOG
Find Desc
IMPORT CATALOG
Import the metadata from one recovery catalog to another based on connection string IMPORT CATALOG <connection_string> [DBID <dbid_number> | DB_NAME <db_name> | NO UNREGISTER]
RMAN> CATALOG backcat@remotesite;

RMAN> IMPORT CATALOG repoomega@catdb;
Imports the metadata from one recovery catalog to another based DBID RMAN> CATALOG backcat@remotesite;

RMAN> IMPORT CATALOG rcat@inst1 DBID=1824802046;
 
LIST
Find Desc
LIST ARCHIVELOG
List cataloged archived redo logs LIST ARCHIVELOG ...;
RMAN> LIST ARCHIVELOG ALL;

List of Archived Log Copies for database with db_unique_name ORABASE
=====================================================================

Key Thrd Seq S Low Time
------- ---- ------- - ---------
328 1 81 A 22-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_22\ O1_MF_1_81_756DZFMK_.ARC

334 1 82 A 22-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_22\ O1_MF_1_82_756GZD5V_.ARC

375 1 83 A 22-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_23\ O1_MF_1_83_75857O98_.ARC

376 1 84 A 23-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_23\ O1_MF_1_84_7591D1GN_.ARC

399 1 85 A 23-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_24\ O1_MF_1_85_75BPPFYR_.ARC

400 1 86 A 24-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_24\ O1_MF_1_86_75CNYOJM_.ARC

401 1 87 A 24-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_25\ O1_MF_1_87_75CXRLPG_.ARC

402 1 88 A 25-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_26\ O1_MF_1_88_75HBX57T_.ARC

403 1 89 A 26-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_26\ O1_MF_1_89_75J5VGJ3_.ARC

457 1 90 A 26-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_26\ O1_MF_1_90_75JYHMQG_.ARC

458 1 91 A 26-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_27\ O1_MF_1_91_75L0THTC_.ARC

459 1 92 A 27-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_28\ O1_MF_1_92_75OVMJL2_.ARC

460 1 93 A 28-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_28\ O1_MF_1_93_75P2KPCQ_.ARC

461 1 94 A 28-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_29\ O1_MF_1_94_75RTPH0Z_.ARC

462 1 95 A 29-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_29\ O1_MF_1_95_75RWGKC7_.ARC

463 1 96 A 29-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_30\ O1_MF_1_96_75VDJQ3V_.ARC

464 1 97 A 30-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_30\ O1_MF_1_97_75VLKJSC_.ARC

465 1 98 A 30-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_31\ O1_MF_1_98_75X31SPG_.ARC

466 1 99 A 31-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_31\ O1_MF_1_99_75Y4CRM1_.ARC

467 1 100 A 31-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_08_31\ O1_MF_1_100_75Y81LJM_.ARC

468 1 101 A 31-AUG-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_09_01\ O1_MF_1_101_760RNFGN_.ARC

469 1 102 A 01-SEP-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_09_01\ O1_MF_1_102_760RSMC7_.ARC

535 1 103 A 01-SEP-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_09_01\ O1_MF_1_103_760S131Y_.ARC

574 1 104 A 01-SEP-17
Name: C:\ORACLE\FAST_RECOVERY_AREA\ORABASE\ARCHIVELOG\2017_09_02\ O1_MF_1_104_762PBWH4_.ARC
LIST BACKED
   
 
LIST BACKUP
List cataloged backups LIST BACKUP ...;
RMAN> LIST BACKUP SUMMARY;

List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
238 B A A DISK 21-AUG-17 1 1 NO TAG20170821T220151
239 B A A DISK 21-AUG-17 1 1 NO TAG20170821T220151
340 B A A DISK 22-AUG-17 1 1 NO TAG20170822T223438
341 B A A DISK 22-AUG-17 1 1 NO TAG20170822T223438
474 B A A DISK 01-SEP-17 1 1 NO TAG20170901T220144
475 B A A DISK 01-SEP-17 1 1 NO TAG20170901T220144
476 B A A DISK 01-SEP-17 1 1 NO TAG20170901T220144
477 B A A DISK 01-SEP-17 1 1 NO TAG20170901T220144
478 B A A DISK 01-SEP-17 1 1 NO TAG20170901T220144
479 B A A DISK 01-SEP-17 1 1 NO TAG20170901T220144
480 B A A DISK 01-SEP-17 1 1 NO TAG20170901T220144
481 B A A DISK 01-SEP-17 1 1 NO TAG20170901T220144
482 B A A DISK 01-SEP-17 1 1 NO TAG20170901T220144
542 B A A DISK 01-SEP-17 1 1 NO TAG20170901T220540
553 B F A DISK 01-SEP-17 1 1 NO TAG20170901T220544
579 B F A DISK 02-SEP-17 1 1 NO TAG20170902T204201
588 B F A DISK 02-SEP-17 1 1 NO TAG20170902T204207
LIST BACKUPPIECE
  LIST BACKUPPIECE <INTEGER | STRING | TAG>...;
RMAN> LIST BACKUPPIECE 12;
LIST BACKUPSET
List cataloged backup sets LIST BACKUPSET [COMPLETED BEFORE <date_string>];
# rman target /

RMAN> LIST BACKUPSET;

using target database control file instead of recovery catalog

List of Backup Sets
===================

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
1 1.09G DISK 00:00:14 19-JAN-17
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20170119T160739
Piece Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\ORABETA\BACKUPSET\2017_01_19\O1_MF_ANNNN_TAG20170119T160739_8HPFBDK8_.BKP

List of Archived Logs in backup set 1
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 187 4737810 09-JAN-17 4770516 09-JAN-17
1 188 4770516 09-JAN-17 4775662 09-JAN-17
1 189 4775662 09-JAN-17 4787602 09-JAN-17
1 190 4787602 09-JAN-17 4794385 09-JAN-17
1 191 4794385 09-JAN-17 4796860 10-JAN-17
1 192 4796860 10-JAN-17 4819480 10-JAN-17
1 193 4819480 10-JAN-17 4825498 10-JAN-17
1 194 4825498 10-JAN-17 4834069 10-JAN-17
1 195 4834069 10-JAN-17 4841406 11-JAN-17
1 196 4841406 11-JAN-17 4852658 11-JAN-17
1 197 4852658 11-JAN-17 4876637 11-JAN-17
1 198 4876637 11-JAN-17 4883031 11-JAN-17
1 199 4883031 11-JAN-17 4887495 11-JAN-17
1 200 4887495 11-JAN-17 4917339 12-JAN-17
1 201 4917339 12-JAN-17 4927869 12-JAN-17
1 202 4927869 12-JAN-17 4937428 12-JAN-17
1 203 4937428 12-JAN-17 4949597 12-JAN-17
1 204 4949597 12-JAN-17 4958541 12-JAN-17
1 205 4958541 12-JAN-17 4970869 17-JAN-17
1 206 4970869 17-JAN-17 4982311 17-JAN-17
1 207 4982311 17-JAN-17 4986468 17-JAN-17
1 208 4986468 17-JAN-17 4996295 17-JAN-17
1 209 4996295 17-JAN-17 5008309 14-JAN-17
1 210 5008309 14-JAN-17 5029782 14-JAN-17
1 211 5029782 14-JAN-17 5043750 14-JAN-17
1 212 5043750 14-JAN-17 5051206 15-JAN-17
1 217 5051206 15-JAN-17 5081000 15-JAN-17
1 214 5081000 15-JAN-17 5097490 15-JAN-17
1 215 5097490 15-JAN-17 5109931 15-JAN-17
1 216 5109931 15-JAN-17 5114371 15-JAN-17
1 217 5114371 15-JAN-17 5123180 16-JAN-17
1 218 5123180 16-JAN-17 5175743 16-JAN-17
1 219 5135743 16-JAN-17 5150448 16-JAN-17
1 220 5150448 16-JAN-17 5154369 16-JAN-17
1 221 5154369 16-JAN-17 5159265 16-JAN-17
1 222 5159265 16-JAN-17 5171914 17-JAN-17
1 223 5171914 17-JAN-17 5189943 17-JAN-17

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
2 301.34M DISK 00:00:04 19-JAN-17
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20170119T160807
Piece Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\ORABETA\BACKUPSET\2017_01_19\O1_MF_ANNNN_TAG20170119T160807_8HPFC7P7_.BKP

List of Archived Logs in backup set 2
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 223 5171914 17-JAN-17 5189943 17-JAN-17
1 224 5189943 17-JAN-17 5193978 17-JAN-17
1 225 5193978 17-JAN-17 5198547 17-JAN-17
1 226 5198547 17-JAN-17 5204441 17-JAN-17
1 227 5204441 17-JAN-17 5216279 18-JAN-17
1 228 5216279 18-JAN-17 5231822 18-JAN-17
1 229 5231822 18-JAN-17 5237194 19-JAN-17
1 230 5237194 19-JAN-17 5243523 19-JAN-17
1 231 5243523 19-JAN-17 5251374 19-JAN-17
1 232 5251774 19-JAN-17 5257469 19-JAN-17
List cataloged backups before date RMAN> LIST BACKUPSET COMPLETED BEFORE '23-SEP-2017';
LIST CONTROLFILECOPY
  LIST CONTROLFILECOPY < INTEGER | STRING | TAG> ...;
RMAN> LIST CONTROLFILECOPY 12;
LIST COPY
List cataloged backup copies LIST COPY ...;
RMAN> LIST COPY;

specification does not match any datafile copy in the repository
specification does not match any control file copy in the repository
List of Archived Log Copies for database with db_unique_name ORABASE
=====================================================================

Key Thrd Seq S Low Time
------- ---- ------- - ---------
47 1 233 A 19-JAN-17
Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\ORABETA\ARCHIVELOG\2017_01_20\O1_MF_1_233_8HRCMOM2_.ARC

48 1 234 A 20-JAN-17
Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\ORABETA\ARCHIVELOG\2017_01_20\O1_MF_1_234_8HRCNSX0_.ARC

49 1 235 A 20-JAN-17
Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\ORABETA\ARCHIVELOG\2017_01_20\O1_MF_1_235_8HRT86S3_.ARC

50 1 236 A 20-JAN-17
Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\ORABETA\ARCHIVELOG\2017_01_20\O1_MF_1_236_8HSPFVLF_.ARC

51 1 237 A 20-JAN-17
LIST DATAFILECOPY
  LIST DATAFILECOPY <ALL | LIKE | TAG>;
RMAN> LIST DATAFILECOPY ALL;

specification does not match any datafile copy in the repository
LIST DB_UNIQUE_NAME
List all database unique names LIST DB_UNIQUE_NAME ...;
RMAN> LIST DB_UNIQUE_NAME ALL;

List of Databases
 DB Key DB Name             DB ID Database Role   Db_unique_name
------- ------- ----------------- --------------- ------------------
      1 ORABASE        1824802046 PRIMARY         ORABASE
LIST EXPIRED
List expired backups for database standby1 LIST EXPIRED <ARCHIVELOG | BACKUP | BACKUPPIECE | BACKUPSET | CONTROLFILECOPY | COPY | DATAFILECOPY | FOREIGN | PROXY> [<ALL | FROM | HIGH | LIKE | LOW | SCN | SEQUENCE | TIME | UNTIL>;
RMAN> CONNECT target / CATALOG repoomega/oracle1@catbd;

connected to recovery catalog database

RMAN> LIST EXPIRED ARCHIVELOG ALL;

RMAN> LIST EXPIRED BACKUP FOR DB_UNIQUE_NAME standby1;

specification does not match any backup in the repository
LIST FAILURE
List backup and copy failures LIST FAILURE ...;
RMAN> CONNECT target / CATALOG repoomega/oracle1@catbd;

connected to recovery catalog database

RMAN> LIST FAILURE;

Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
2103 CRITICAL OPEN 15-JAN-17 SQL dictionary health check: check seq$.partcount range 106 on object SEQ$ failed
2100 CRITICAL OPEN 15-JAN-17 SQL dictionary health check: check seq$.partcount range 106 on object SEQ$ failed
2097 CRITICAL OPEN 15-JAN-17 SQL dictionary health check: check seq$.partcount range 106 on object SEQ$ failed
2094 CRITICAL OPEN 15-JAN-17 SQL dictionary health check: check seq$.partcount range 106 on object SEQ$ failed
1194 CRITICAL OPEN 15-JAN-17 SQL dictionary health check: obj$.type# 48 on object OBJ$ failed
1188 CRITICAL OPEN 15-JAN-17 SQL dictionary health check: obj$.namespace 47 on object OBJ$ failed
1048 CRITICAL OPEN 08-JAN-17 SQL dictionary health check: ecol$.tabobj#,colnum fk 146 on object ECOL$ failed
1045 CRITICAL OPEN 08-JAN-17 SQL dictionary health check: check seq$.partcount range 106 on object SEQ$ failed

-- also see Advise Failure Demo Above
LIST FOREIGN
  LIST FOREIGN ARCHIVELOG <ALL | FROM | HIGH | LIKE | LOW | SCN | SEQUENCE | TIME | UNTIL> ....;
RMAN> LIST FOREIGN ARCHIVELOG ALL;

specification does not match any foreign archived log in the repository
LIST GLOBAL
List global scripts stored in the catalog LIST GLOBAL SCRIPT ...;
RMAN> CONNECT target / CATALOG repoomega/oracle1@catbd;

RMAN> LIST GLOBAL SCRIPT NAMES;

List of Stored Scripts in Recovery Catalog

No scripts in recovery catalog
LIST INCARNATION
  LIST INCARNATION;
RMAN> LIST INCARNATION;

List of Database Incarnations
DBKey   Inc Key DB Name  DB ID       STATUS   Reset SCN  Reset Time
------- ------- -------- ----------- -------- ---------- ----------
1       1       ORABETA  2611279002  PARENT   1          27-SEP-16
2       2       ORABETA  2611279002  CURRENT  2265381    03-DEC-16
LIST RECOVERABLE
  LIST RECOVERABLE <ARCHIVELOG | BACKED | BACKUP | BACKUPSET | COMPLETED | COPY | DEVICE | ....
RMAN> LIST RECOVERABLE ARCHIVELOG ALL;
LIST RESTORE
  LIST RESTORE POINT <ALL | IDENTIFIER | STRING>;
SQL> CREATE RESTORE POINT safra;
SQL> host

# rman target /

RMAN> LIST RESTORE POINT ALL;

SCN              RSP Time  Type       Time      Name
---------------- --------- ---------- --------- ----
10967051         13-JUN-17                      SAFRA

RMAN> drop restore point safra;

Statement processed
LIST SCRIPT
  LIST SCRIPT <SCRIPT_NAME>;
 
LIST TAG
  LIST TAG <IDENTIFIER | STRING> ....;
 
 
PRINT
Find Desc
PRINT GLOBAL SCRIPT
Display a named global script stored in the RMAN catalog PRINT GLOBAL SCRIPT <IDENTIFIER | STRING>;
RMAN> PRINT GLOBAL SCRIPT global_backup_db;
PRINT SCRIPT
Display a named script stored in the RMAN catalog PRINT SCRIPT <IDENTIFIER | STRING> ....;
RMAN> PRINT SCRIPT backup_whole;

printing stored script: backup_whole
{
  BACKUP INCREMENTAL LEVEL 0 TAG b_whole_l0
  DATABASE PLUS ARCHIVELOG;
}

RMAN> PRINT SCRIPT global_backup_db TO FILE '/u01/staging/global_backup_db.rman';
 
QUIT
Exit the RMAN executable QUIT
RMAN> QUIT;
 
RECOVER
Formerly BLOCKRECOVER this was renamed as of version 11.1.0.6.

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
RECOVER ALLOW
  RECOVER ALLOW ....
 
RECOVER ARCHIVELOG
  RECOVER ARCHIVELOG ....
 
RECOVER AUXILIARY
  RECOVER AUXILIARY ....
 
RECOVER CHECK
  RECOVER CHECK <LOGICAL | READONLY> ....;
 
RECOVER CLEAR
  RECOVER CLEAR ....
 
RECOVER COPY
  RECOVER COPY ....
 
RECOVER CORRUPTION LIST
Block recover corrupt database blocks RECOVER CORRUPTION LIST;
RMAN> RECOVER CORRUPTION LIST;

Starting recover at 13-JUN-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=128 device type=DISK

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 13-JUN-17
RECOVER DATABASE
  RECOVER DATABASE ....
 
RECOVER DATAFILE
Recover corrupt blocks in 3 data files RECOVER DATAFILE <data_file_number> BLOCK <block_list>
RMAN> RECOVER DATAFILE 2 BLOCK 12,13;

RMAN> RECOVER DATAFILE 2 BLOCK 12,13 DATAFILE 3 BLOCK 5,98,99 DATAFILE 4 BLOCK 19;
Limit block recovery by restoration type RECOVER DATAFILE <data_file_number> BLOCK <block_list> TABLESPACE <tablespace_name> FROM DATAFILECOPY
RUN {
  RECOVER DATAFILE 3 BLOCK 2,3,4,5 TABLESPACE uwdata DBA 4194405, 4194409, 4194412
  FROM DATAFILECOPY;
}
RECOVER DATAFILECOPY
  RECOVER DATAFILECOPY ....
 
RECOVER DELETE
  RECOVER DELETE ....
 
RECOVER DEVICE
  RECOVER DEVICE ....
 
RECOVER EXCLUDE
  RECOVER EXCLUDE ....
 
RECOVER FROM
  RECOVER FROM ....
 
RECOVER NOFILEUPDATE
  RECOVER NOFILEUPDATE ....
 
RECOVER NOPARALLEL
  RECOVER NOPARALLEL ....
 
RECOVER NOREDO
  RECOVER NOREDO ....
 
RECOVER PARALLEL
  RECOVER PARALLEL ....
 
RECOVER RESTORE
  RECOVER RESTORE <HIGH | TO_RESTORE_POINT | UNTIL | UNTIL RESTORE_POINT> ....;
 
RECOVER SAVE
  RECOVER SAVE ....
 
RECOVER SKIP READONLY
  RECOVER SKIP READONLY ....
 
RECOVER STANDBY
  RECOVER STANDBY ....
 
RECOVER TABLESPACE
Limit block recovery by backup tag RECOVER TABLESPACE <tablespace_name> ...
RECOVER TABLESPACE SYSTEM DBA 4194404, 4194405 FROM TAG "weekly_backup";
Limit block recovery by time RECOVER TABLESPACE <tablespace_name> ...
RECOVER TABLESPACE SYSTEM DBA 4194404, 4194405 RESTORE UNTIL TIME 'SYSDATE-2';
Repair all corrupt blocks in the database using v$database_block_corruption RECOVER CORRUPTION LIST;
RMAN> BACKUP VALIDATE DATABASE;
RMAN> RECOVER CORRUPTION LIST;

Starting recover at 26-AUG-17
using channel ORA_DISK_1
using channel ORA_DISK_2

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 26-AUG-17
RECOVER TEST
  RECOVER TEST ....
 
RECOVER UNDO
  RECOVER UNDO ....
 
RECOVER VALIDATE HEADER
  RECOVER VALIDATE HEADER ....
 
 
REGISTER
REGISTER DATABASE
Register a Target in the Database Recovery Catalog REGISTER DATABASE;
RMAN> REGISTER DATABASE;
 
RELEASE
RELEASE CHANNEL
Release a channel that was allocated with an ALLOCATE CHANNEL command RELEASE CHANNEL;
See Allocate Channel Demos Above
 
REPAIR
REPAIR FAILURE
Repair one or more failures recorded in the automated diagnostic repository REPAIR FAILURE [<NO | NOPROMPT | PREVIEW | USING>
See Advise Failure Demo Above
 
REPLACE
Find Desc
REPLACE GLOBAL
? may not exist REPLACE GLOBAL ....
TBD
REPLACE SCRIPT
Replace an existing script stored in the recovery catalog. If the script does not exist, then REPLACE SCRIPT creates it REPLACE SCRIPT ....
TBD
 
REPORT
Find Desc
REPORT NEED BACKUP
Report objects whose backup is not current REPORT NEED BACKUP [DEVICE TYPE <device_type_name>];
RMAN> REPORT NEED BACKUP;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of files with less than 1 redundant backups
File #bkps Name
---- ----- -----------------------------------------
1 0 C:\ORACLE\ORADATA\ORABASE\SYSTEM01.DBF
2 0 C:\ORACLE\ORADATA\ORABASE\SYSAUX01.DBF
3 0 C:\ORACLE\ORADATA\ORABASE\UNDOTBS01.DBF
4 0 C:\ORACLE\ORADATA\ORABASE\USERS01.DBF
5 0 C:\ORACLE\ORADATA\ORABASE\EXAMPLE01.DBF
6 0 C:\ORACLE\ORADATA\ORABASE\UWDATA01.DBF
7 0 C:\ORACLE\ORADATA\ORABASE\CATTBS01.DBF

RMAN> REPORT NEED BACKUP DEVICE TYPE DISK;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of files with less than 1 redundant backups
File #bkps Name
---- ----- -----------------------------------------
1 0 C:\ORACLE\ORADATA\ORABASE\SYSTEM01.DBF
2 0 C:\ORACLE\ORADATA\ORABASE\SYSAUX01.DBF
3 0 C:\ORACLE\ORADATA\ORABASE\UNDOTBS01.DBF
4 0 C:\ORACLE\ORADATA\ORABASE\USERS01.DBF
5 0 C:\ORACLE\ORADATA\ORABASE\EXAMPLE01.DBF
6 0 C:\ORACLE\ORADATA\ORABASE\UWDATA01.DBF
7 0 C:\ORACLE\ORADATA\ORABASE\CATTBS01.DBF
REPORT OBSOLETE
Reports obsolete backups found REPORT OBSOLETE;
RMAN> REPORT OBSOLETE;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
no obsolete backups found
REPORT SCHEMA
Performs a catalog resync and reports on permanent, undo, and temp tablespaces REPORT SCHEMA;
RMAN> REPORT SCHEMA;

Report of database schema for database with db_unique_name ORABASE

List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 730 SYSTEM *** C:\ORACLE\ORADATA\ORABASE\SYSTEM01.DBF
2 660 SYSAUX *** C:\ORACLE\ORADATA\ORABASE\SYSAUX01.DBF
3 65 UNDOTBS1 *** C:\ORACLE\ORADATA\ORABASE\UNDOTBS01.DBF
4 5 USERS *** C:\ORACLE\ORADATA\ORABASE\USERS01.DBF
5 345 EXAMPLE *** C:\ORACLE\ORADATA\ORABASE\EXAMPLE01.DBF
6 250 UWDATA *** C:\ORACLE\ORADATA\ORABASE\UWDATA01.DBF

List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 32767 C:\ORACLE\ORADATA\ORABASE\TEMP01.DBF
REPORT UNRECOVERABLE
Report unrecoverable objects REPORT UNRECOVERABLE
RMAN> REPORT UNRECOVERABLE;

Report of files that need backup due to unrecoverable operations
File Type of Backup Required Name
---- ----------------------- -----------------------------------
5 full C:\ORACLE\ORADATA\ORABASE\EXAMPLE01.DBF
 
RESET
RESET DATABASE
Reset the incarnation of the target database in the RMAN repository to a previous database incarnation RESET DATABASE TO INCARNATION <incarnation_identifier>;
$ rman target / nocatalog
RMAN> STARTUP NOMOUNT;
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
Find Desc
Restore files from backup sets or from disk copies to the default or a new location RESTORE <ARCHIVELOG | CHANNEL | CHECK | CONTROLFILE | DATABASE | DATAFILE | DEVICE | FORCE | FROM | HIGH | PREVIEW [SUMMARY] | PRIMARY | SKIP READONLY | SPFILE | STANDBY | TABLESPACE | TO RESTORE POINT | UNTIL | UNTIL RESTORE POINT | VALIDATE>;
RESTORE ARCHIVELOG
Restore an Archived Redo Log RESTORE ARCHIVELOG FROM <system_change_number> [PREVIEW];
RMAN> restore archivelog from SCN 376192 preview;
RESTORE DATABASE
Restore Database RESTORE DATABASE [PREVIEW] [SUMMARY];
RMAN> target / catalog rman/rman@rman

RMAN> backup database;

RMAN> validate backupset 1;

SQL> conn scott/tiger

SQL> DELETE FROM emp WHERE rownum < 6;

SQL> COMMIT;

RMAN> restore database;
Preview a restore before running it RMAN> target / catalog rman/rman@rman

RMAN> restore database preview summary;

Starting restore at 04-APR-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK

datafile 13 will be created automatically during restore operation
datafile 17 will be created automatically during restore operation
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 04/04/2017 08:15:37
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 16 found to restore
RMAN-06023: no backup or copy of datafile 15 found to restore
RMAN-06023: no backup or copy of datafile 14 found to restore
RMAN-06023: no backup or copy of datafile 12 found to restore
RMAN-06023: no backup or copy of datafile 11 found to restore
RMAN-06023: no backup or copy of datafile 10 found to restore
RMAN-06023: no backup or copy of datafile 9 found to restore
RMAN-06023: no backup or copy of datafile 8 found to restore
RMAN-06023: no backup or copy of datafile 7 found to restore
RMAN-06023: no backup or copy of datafile 6 found to restore
RMAN-06023: no backup or copy of datafile 5 found to restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore

RMAN> restore database preview;
 
 
RESYNC
??? ???
   
 
 
REVOKE
??? ???
   
 
 
RMAN
??? ???
   
 
 
RUN
??? ???
   
 
 
SEND
??? ???
   
 
 
SET
??? ???
   
 
 
SHOW
??? ???
   
 
 
SHUTDOWN
??? ???
   
 
 
SPOOL
??? ???
   
 
 
SQL
??? ???
   
 
 
STARTUP
??? ???
   
 
 
SWITCH
??? ???
   
 
 
TRANSPORT TABLESPACE
??? ???
   
 
 
UNREGISTER
??? ???
   
 
 
UPGRADE
??? ???
   
 
 
VALIDATE
??? ???
   
 

Related Topics
Archivelogs
Backup & Recovery
Block Change Tracking
Data Guard
DBMS_BACKUP_RESTORE
DBMS_IR
DBMS_RCVCAT
DBMS_RCVMAN
DDL Event Triggers
Dynamic Performance Views
Flashback Database
Flashback Query
Flashback Table
RMAN Demo
System Event Triggers
What's New In 12cR1
What's New In 12cR2

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2017 Daniel A. Morgan All Rights Reserved