Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common BACKUP parameters of RMAN in Oracle

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article is to share with you about the common BACKUP parameters of RMAN in Oracle. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The backup command is used to generate backups, and you can specify a number of properties for backups when you execute backup. The syntax of the backup command is very rich in the official documentation, but it is not necessary to master it one by one. First of all, you need to understand some basic usage, special parameters, and cram temporarily when you need it.

Let's pick some commonly used parameters to illustrate.

BACKUP parameter options

Full

The server session copies all blocks to the backup set, skipping only data texts that have never been used

Pieces. When backing up archived redo logs or control files, the server session does not skip any blocks. A full backup is not an incremental backup.

Incremental

Level

Integer

The server session replicates blocks that have changed since the last level n incremental backup, where n is any integer from 1 to 4. When performing an incremental backup greater than level 0, the server process checks in the BACKUP command for the existence of a level 0 backup or a level 0 copy of each data file. "if you specify increments, you must set one of the following parameters in the backup description: DATA FILE, DATA FILECOPY, TABLESPACE, or DATABASE." Recovery Manager does not support incremental backups of control files, archive redo logs, or backup sets.

Filesperset

Integer

If the FILESPERSET parameter is specified, the recovery Manager compares the FILESPERSET value with the calculated value (the ratio of the number of files backed up to the number of channels) and takes the smaller of the two, ensuring that all channels are used. If you do not specify FILESPERSET, the recovery manager compares the calculated value (the ratio of the number of files to the number of allocated channels) with the default value of 64 and takes the smaller of the two. When there are more channels than files to back up, the extra channels will remain idle. The input file cannot be split between channels.

Skip

Specify this parameter to exclude some data files or archive redo logs from the backup set. This parameter has the following options:

Offline: excludes offline data files from the backup set.

Readonly: excludes data files that belong to read-only tablespaces.

Inaccessible: excludes data files or archive duplicates that cannot be read due to an iAccord O error

Keep a journal.

Maxsetsize

Integer

Specify the maximum size of the backup set in bytes (default), kilobytes (K), megabytes (M), or gigabytes (G). The recovery Manager tries to limit all backup sets to the specified size.

Delete

Input

Delete the input file after the backup set is successfully created. Only when backing up and archiving redo logs and data texts

This option is specified only when there is a copy or backup set. It is equivalent to executing for all input files

CHANGE. . . The DELETE command.

Include

Current

Controlfile

Creates a snapshot of the current control file and places it in each backup set generated by this clause. The format of the Format output name. Format parameters can be used alone or in combination. Backup with PLUS ARCHIVELOG and ARCHIVELOG

COPIES integer multiple backups, that is, multiple copies of the backup set. Value of integer is 1-4. Default is 1.

Let's demonstrate the usage of skip, filesperset, maxsetsize, COPIES, etc.

Skip skips read-only files

SQL > ALTER TABLESPACE IDX READONLY; Tablespace altered.RMAN > BACKUP DATABASE SKIP READONLY Starting backup at 2015-07-09 03:39:49allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=1 device type=DISKskipping read-only file 6channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setinput datafile file number=00001 name=/u01/app/oracle/oradata/devdb/system01.dbfinput datafile file number=00002 name=/u01/app/oracle/oradata/devdb/sysaux01.dbfinput datafile file number=00005 name=/u01/app/oracle/oradata/devdb/example01.dbfinput datafile file number=00003 name=/u01/ App/oracle/oradata/devdb/undotbs01.dbfinput datafile file number=00004 name=/u01/app/oracle/oradata/devdb/users01.dbfchannel ORA_DISK_1: starting piece 1 at 2015-07-09 03:39:49channel ORA_DISK_1: finished piece 1 at 2015-07-09 03:41:45piece handle=/u01/app/oracle/fast_recovery_area/DEVDB/backupset/2015_07_09/o1_mf_nnndf_TAG20150709T033949_bstz45xk_.bkp tag=TAG20150709T033949 comment=NONEchannel ORA_DISK_1: backupset complete Elapsed time: 00:01:56channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setincluding current control file in backup setincluding current SPFILE in backup setchannel ORA_DISK_1: starting piece 1 at 2015-07-09 03:41:46channel ORA_DISK_1: finished piece 1 at 2015-07-09 03:41:47piece handle=/u01/app/oracle/fast_recovery_area/DEVDB/backupset/2015_07_09/o1_mf_ncsnf_TAG20150709T033949_bstz7toh_.bkp tag=TAG20150709T033949 comment=NONEchannel ORA_DISK_1: backupset complete Elapsed time: 00:00:01Finished backup at 2015-07-09 03:41:47

FILEPERSET limits the maximum number of files contained in a backup set.

RMAN > BACKUP DATABASE filesperset 2 Starting backup at 2015-07-09 03:45:11using channel ORA_DISK_1channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setinput datafile file number=00001 name=/u01/app/oracle/oradata/devdb/system01.dbfinput datafile file number=00006 name=/u01/app/oracle/oradata/devdb/idx01.dbfchannel ORA_DISK_1: starting piece 1 at 2015-07-09 03:45:11channel ORA_DISK_1: finished piece 1 at 2015-07-09 03:45:46piece Handle=/u01/app/oracle/fast_recovery_area/DEVDB/backupset/2015_07_09/o1_mf_nnndf_TAG20150709T034511_bstzg7tn_.bkp tag=TAG20150709T034511 comment=NONEchannel ORA_DISK_1: backupset complete Elapsed time: 00:00:35channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setinput datafile file number=00002 name=/u01/app/oracle/oradata/devdb/sysaux01.dbfinput datafile file number=00004 name=/u01/app/oracle/oradata/devdb/users01.dbfchannel ORA_DISK_1: starting piece 1 at 2015-07-09 03:45:46channel ORA_DISK_1: finished piece 1 at 2015-07-09 03:46:11piece handle=/u01/app/oracle/fast_recovery _ area/DEVDB/backupset/2015_07_09/o1_mf_nnndf_TAG20150709T034511_bstzhc17_.bkp tag=TAG20150709T034511 comment=NONEchannel ORA_DISK_1: backupset complete Elapsed time: 00:00:26channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setinput datafile file number=00005 name=/u01/app/oracle/oradata/devdb/example01.dbfinput datafile file number=00003 name=/u01/app/oracle/oradata/devdb/undotbs01.dbfchannel ORA_DISK_1: starting piece 1 at 2015-07-09 03:46:12channel ORA_DISK_1: finished piece 1 at 2015-07-09 03:46:27piece handle=/u01/app/oracle/fast_recovery _ area/DEVDB/backupset/2015_07_09/o1_mf_nnndf_TAG20150709T034511_bstzj460_.bkp tag=TAG20150709T034511 comment=NONEchannel ORA_DISK_1: backupset complete Elapsed time: 00:00:15channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setincluding current control file in backup setincluding current SPFILE in backup setchannel ORA_DISK_1: starting piece 1 at 2015-07-09 03:46:28channel ORA_DISK_1: finished piece 1 at 2015-07-09 03:46:29piece handle=/u01/app/oracle/fast_recovery_area/DEVDB/backupset/2015_07_09/o1_mf_ncsnf_TAG20150709T034511_bstzjnbx_.bkp tag=TAG20150709T034511 comment=NONEchannel ORA_DISK_1: backupset complete Elapsed time: 00:00:01Finished backup at 2015-07-09 03:46:29

Maxsetsize sets backup set maximum

RMAN > backup database maxsetsize 200M starting backup at 2015-07-09 03:52:02using channel ORA_DISK_1RMAN-00571: = = RMAN-00569: = ERROR MESSAGE STACK FOLLOWS = RMAN-00571: = = RMAN-03002: failure of backup command at 07 Greater 09 03:52:02RMAN-06183: datafile or datafile copy / u01/app/oracle/oradata/devdb/system01.dbf (file number 1) larger than MAXSETSIZE

The maximum size of the backup set cannot be less than the size of any data file.

RMAN > backup database maxsetsize 1G Starting backup at 2015-07-09 03:58:47allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=1 device type=DISKchannel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setinput datafile file number=00002 name=/u01/app/oracle/oradata/devdb/sysaux01.dbfinput datafile file number=00005 name=/u01/app/oracle/oradata/devdb/example01.dbfchannel ORA_DISK_1: starting piece 1 at 2015-07-09 03:58:48channel ORA_DISK_1: finished piece 1 at 2015-07-09 03:59:23piece handle=/u01/app/oracle/fast_recovery_area/DEVDB/backupset/2015_07_09/o1_mf_nnndf_TAG20150709T035847_bsv07r5l_.bkp tag=TAG20150709T035847 comment=NONEchannel ORA_DISK_1: backupset complete Elapsed time: 00:00:35channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setinput datafile file number=00001 name=/u01/app/oracle/oradata/devdb/system01.dbfinput datafile file number=00003 name=/u01/app/oracle/oradata/devdb/undotbs01.dbfinput datafile file number=00004 name=/u01/app/oracle/oradata/devdb/users01.dbfinput datafile file number=00006 name=/u01/app/oracle/oradata/devdb/idx01.dbfchannel ORA_DISK_1: starting piece 1 at 2015-07-09 03:59:23channel ORA_DISK_1: finished piece 1 at 2015-07-09 03:59:58piece handle=/u01/app/oracle/fast_recovery_area/DEVDB/backupset/2015_07_09/o1_mf_nnndf_TAG20150709T035847_bsv08vcs_.bkp tag=TAG20150709T035847 comment=NONEchannel ORA_DISK_1: backupset complete Elapsed time: 00:00:35channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setincluding current control file in backup setincluding current SPFILE in backup setchannel ORA_DISK_1: starting piece 1 at 2015-07-09 03:59:59channel ORA_DISK_1: finished piece 1 at 2015-07-09 04:00:00piece handle=/u01/app/oracle/fast_recovery_area/DEVDB/backupset/2015_07_09/o1_mf_ncsnf_TAG20150709T035847_bsv09zlm_.bkp tag=TAG20150709T035847 comment=NONEchannel ORA_DISK_1: backupset complete Elapsed time: 00:00:01Finished backup at 2015-07-09 04:00:00SQL > select name,bytes/1024/1024 | | 'MB' from v$datafile NAME BYTES/1024/1024 | | 'MB' -/ u01/app/oracle/oradata/devdb/system01.dbf 770MB/u01/app/oracle/oradata/devdb/sysaux01.dbf 580MB/u01/app/oracle/oradata/devdb/undotbs01.dbf 95MB/u01/app/oracle/oradata/devdb/users01.dbf 16.25MB/u01/app/oracle/oradata/devdb/example01.dbf 345.625MB/u01/app/oracle/oradata/devdb/idx01.dbf 10MB

COPIES

RMAN > backup copies 2 database format'/ backup/full_%U' Starting backup at 2015-07-09 04:06:29using channel ORA_DISK_1channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setinput datafile file number=00001 name=/u01/app/oracle/oradata/devdb/system01.dbfinput datafile file number=00002 name=/u01/app/oracle/oradata/devdb/sysaux01.dbfinput datafile file number=00005 name=/u01/app/oracle/oradata/devdb/example01.dbfinput datafile file number=00003 name=/u01/app/oracle/oradata/devdb/undotbs01.dbfinput datafile file number=00004 name= / u01/app/oracle/oradata/devdb/users01.dbfinput datafile file number=00006 name=/u01/app/oracle/oradata/devdb/idx01.dbfchannel ORA_DISK_1: starting piece 1 at 2015-07-09 04:06:29channel ORA_DISK_1: finished piece 1 at 2015-07-09 04:08:04 with 2 copies and tag TAG20150709T040629piece handle=/backup/full_3bqbj5m5_1_1 comment=NONEpiece handle=/backup/full_3bqbj5m5_1_2 comment=NONEchannel ORA_DISK_1: backup set complete Elapsed time: 00:01:35channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setincluding current control file in backup setincluding current SPFILE in backup setchannel ORA_DISK_1: starting piece 1 at 2015-07-09 04:08:05channel ORA_DISK_1: finished piece 1 at 2015-07-09 04:08:06 with 2 copies and tag TAG20150709T040629piece handle=/backup/full_3cqbj5p4_1_1 comment=NONEpiece handle=/backup/full_3cqbj5p4_1_2 comment=NONEchannel ORA_DISK_1: backup set complete Elapsed time: 00:00:01Finished backup at 2015-07-09 04:08:06

If the backup set is placed in the default fast recovery area, the copies parameter is not allowed

RMAN > backup copies 2 database Starting backup at 2015-07-09 04:11:37using channel ORA_DISK_1channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setinput datafile file number=00001 name=/u01/app/oracle/oradata/devdb/system01.dbfinput datafile file number=00002 name=/u01/app/oracle/oradata/devdb/sysaux01.dbfinput datafile file number=00005 name=/u01/app/oracle/oradata/devdb/example01.dbfinput datafile file number=00003 name=/u01/app/oracle/oradata/devdb/undotbs01.dbfinput datafile file number=00004 name= / u01/app/oracle/oradata/devdb/users01.dbfinput datafile file number=00006 name=/u01/app/oracle/oradata/devdb/idx01.dbfchannel ORA_DISK_1: starting piece 1 at 2015-07-09 04:11:37RMAN-03009: failure of backup command on ORA_DISK_1 channel at 07/09/2015 04:11:38ORA-19806: cannot make duplex backups in recovery areacontinuing other job steps Job failed will not be re-runchannel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setincluding current control file in backup setincluding current SPFILE in backup setchannel ORA_DISK_1: starting piece 1 at 2015-07-09 04:11:39RMAN-00571: = = RMAN-00569: = ERROR MESSAGE STACK FOLLOWS = RMAN-00571: = = RMAN-03009: failure of backup command on ORA_DISK_1 channel at 07 04:11:40ORA-19806 09 04:11:40ORA-19806: cannot make duplex backups in recovery area Thank you for reading! This is the end of this article on "what are the common parameters of RMAN in Oracle?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report