RMAN Backup Clause
Back up database files, archive logs, backups, or copies.
Syntax:
BACKUP FULL Options
BACKUP FULL AS (COPY | BACKUPSET) Options
BACKUP INCREMENTAL LEVEL [=] integer Options
BACKUP INCREMENTAL LEVEL [=] integer AS (COPY | BACKUPSET) Options
BACKUP AS (COPY | BACKUPSET) Options
BACKUP AS (COPY | BACKUPSET) (FULL | INCREMENTAL LEVEL [=] integer) Options
Options:
[ []...]
[]...
[PLUS ARCHIVELOG [ []...]];
backupOperand::=
{ FORMAT [=] 'format_string' [, 'format_string']...
| CHANNEL ['] channel_id [']
| CUMULATIVE
| MAXSETSIZE [=] integer [ K | M | G ]
| TAG [=] ['] tag_name [']
| keepOption
| SKIP { OFFLINE | READONLY | INACCESSIBLE }
| VALIDATE
| NOT BACKED UP [SINCE TIME [=] 'date_string']
| COPIES [=] integer
| DEVICE TYPE deviceSpecifier
.
.
.
}
backupSpec::=
[(]
{ BACKUPSET
{ {ALL | completedTimeSpec }
| primary_key) [, primary_key]...
}
| COPY OF { DATABASE
| TABLESPACE ['] tablespace_name ['] [, ['] tablespace_name
[']]...
| DATAFILE datafileSpec [, datafileSpec]...
}
| DATAFILE datafileSpec [, datafileSpec]...
| DATAFILECOPY 'filename' [, 'filename']...
| DATAFILECOPY FROM TAG [=] ['] tag_name ['] [, ['] tag_name [']]...
| DATAFILECOPY { ALL | LIKE 'string_pattern' }
| TABLESPACE ['] tablespace_name ['] [, ['] tablespace_name [']]...
| DATABASE
| archivelogRecordSpecifier
| CURRENT CONTROLFILE [FOR STANDBY]
| CONTROLFILECOPY 'filename'
| SPFILE
}
[ []...]
backupSpecOperand::=
{ FORMAT [=] 'format_string' [, 'format_string']...
| CHANNEL ['] channel_id [']
| CUMULATIVE
| MAXSETSIZE [=] integer [ K | M | G ]
| TAG [=] ['] tag_name [']
| keepOption
| SKIP { OFFLINE | READONLY | INACCESSIBLE }
| NOT BACKED UP [ SINCE TIME [=] 'date_string'
| integer TIMES
]
| DELETE [ALL] INPUT
.
.
.
}
.
You should configure default devices and channels in advance of running RMAN Backup.
Examples
Back up the database, and then the control file: (which contains a record of the backup) RMAN> BACKUP DATABASE;
RMAN> BACKUP CURRENT CONTROLFILE; Backup datafiles: RMAN> BACKUP AS BACKUPSET DATAFILE 'ORACLE_HOME/oradata/trgt/users01.dbf', 'ORACLE_HOME/oradata/trgt/tools01.dbf'; Backup all datafiles in the database: (bit-for-bit copies, created on disk) RMAN> BACKUP AS COPY DATABASE; Backup archive logs: RMAN> BACKUP ARCHIVELOG COMPLETION TIME BETWEEN 'SYSDATE-28' AND 'SYSDATE-7'; Backup tablespace: RMAN> BACKUP TABLESPACE system, users, tools; Backup controlfile: RMAN> BACKUP CURRENT CONTROLFILE TO '/backup/cntrlfile.copy'; Backup parameter file: RMAN> BACKUP SPFILE; Backup everything: RMAN> BACKUP BACKUPSET ALL; Create a consistent backup and keep the backup for 1 year: (exempt from the retention policy) RMAN> SHUTDOWN;
RMAN> STARTUP MOUNT;
RMAN> BACKUP DATABASE UNTIL 'SYSDATE+365' NOLOGS;
Backup Validation confirms that a backup could be run, by confirming that all database files exist and are free of physical and logical corruption, this does not generate any output.
Example:
RMAN> BACKUP VALIDATE DATABASE ARCHIVELOG ALL;
"It's a very sobering feeling to be up in space and realize that one's safety factor was determined by the lowest bidder on a government contract" - Alan Shepherd
Related:
CHANGE - Update the status of a backup in the RMAN repository.
CONFIGURE - Persistent RMAN settings.
CROSSCHECK - Check whether backup items still exist.
RECOVER - Perform. media recovery from RMAN backups and copies.
RESTORE - Restore RMAN backups and copies.
RUN - Some RMAN commands are only valid inside a RUN block.
SET - Settings for the current RMAN session.
SHOW - Display the current configuration
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23898243/viewspace-694019/ ,如需转载,请注明出处,否则将追究法律责任。