1. format parameters
During the backup process, you can specify the format parameter to customize the command rules for backup fragments, for example:
RMAN> backup database format 'd: \ backup \ % U ';
RMAN> backup database format ‘D:\backup\%U%‘;启动 backup 于 12-10月-14使用通道 ORA_DISK_1通道 ORA_DISK_1: 正在启动全部数据文件备份集通道 ORA_DISK_1: 正在指定备份集内的数据文件输入数据文件: 文件号=00001 名称=D:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF输入数据文件: 文件号=00002 名称=D:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF输入数据文件: 文件号=00003 名称=D:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF输入数据文件: 文件号=00005 名称=D:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF输入数据文件: 文件号=00006 名称=D:\RUSKY\RUSKY_DATA01,DBF输入数据文件: 文件号=00004 名称=D:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF通道 ORA_DISK_1: 正在启动段 1 于 12-10月-14通道 ORA_DISK_1: 已完成段 1 于 12-10月-14段句柄=D:\BACKUP\1NPKT080_1_1% 标记=TAG20141012T182048 注释=NONE通道 ORA_DISK_1: 备份集已完成, 经过时间:00:01:25完成 backup 于 12-10月-14启动 Control File Autobackup 于 12-10月-14段 handle=D:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\C-1385990360-20141012-0A comment=NONE完成 Control File Autobackup 于 12-10月-14RMAN>
FORMAT可配置的参数变量如下:
%c:备份片的拷贝数(从1开始编号);%d:数据库名称;%D:位于该月中的天数 (DD);%M:位于该年中的月份 (MM);%F:一个基于DBID 唯一的名称,这个格式的形式为c-IIIIIIIIII-YYYYMMDD-QQ,其中IIIIIIIIII 为该数据库的DBID,YYYYMMDD 为日期,QQ 是一个1-256 的序列;%n:数据库名称,并且会在右侧用x字符进行填充,使其保持长度为8;%u:是一个由备份集编号和建立时间压缩后组成的8字符名称。利用%u可以为每个备份集生成一个唯一的名称;%p:表示备份集中备份片段的编号,从1 开始编号;%U:是%u_%p_%c的简写形式,利用它可以为每一个备份片段(即磁盘文件)生成一个唯一名称,这是最常用的命名方式;%s:备份集的号;%t:备份集时间戳;%T:年月日格式(YYYYMMDD);s注:如果在BACKUP命令中没有指定FORMAT选项,则RMAN默认使用%U为备份片段命名。
Ii. Configure configuration items
1. Run the show all command to view the current configuration.
RMAN> connect catalog rcat/[email protected];连接到恢复目录数据库RMAN> connect target rusky/[email protected];连接到目标数据库: ORCL (DBID=1385990360)RMAN> show all;db_unique_name 为 ORCL 的数据库的 RMAN 配置参数为:CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default-----配置备份保留策略CONFIGURE BACKUP OPTIMIZATION ON;CONFIGURE DEFAULT DEVICE TYPE TO DISK;CONFIGURE CONTROLFILE AUTOBACKUP ON;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘%F‘; # defaultCONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # defaultCONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultCONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultCONFIGURE CHANNEL DEVICE TYPE DISK FORMAT ‘D:\oracle_bak_test\%U‘;CONFIGURE MAXSETSIZE TO UNLIMITED; # defaultCONFIGURE ENCRYPTION FOR DATABASE OFF; # defaultCONFIGURE ENCRYPTION ALGORITHM ‘AES128‘; # defaultCONFIGURE COMPRESSION ALGORITHM ‘BASIC‘ AS OF RELEASE ‘DEFAULT‘ OPTIMIZE FOR LOAD TRUE ; # defaultCONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # defaultCONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘D:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\SNCFORCL.ORA‘; # default
2. Restore the modified configuration item to the initial default value.
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP CLEAR;旧的 RMAN 配置参数:CONFIGURE CONTROLFILE AUTOBACKUP ON;RMAN 配置参数已成功重置为默认值正在启动全部恢复目录的 resync完成全部 resync
RMAN> Configure retention policy clear
Old rman configuration parameters:
Configure retention policy to recovery window of 3 days
The RMAN configuration parameter has been successfully reset to the default value.
3. configuration details
3.1 configure retention policy configure backup retention policy
Time-based:
Configure retention policy to recovery window of N days;
Redundancy-based quantity:
Configure retention policy to redundancy N;
You can also cancel the backup retention policy:
Configure retention policy to none;
3.2 configure backup Optimization Configuration backup Optimization
Turn on backup optimization:
Configure backup Optimization on;
Disable backup optimization:
Configure backup optimization off;
3.3 configure Default device type configure the IO Device Type
RMAN supports two types of I/O devices: disk and SBT. The default type is disk.
Use disk devices:
Configure Default device type to disk;
Tape settings:
Configure Default device type to SBT;
Note that if the I/O device changes, the related configuration items also need to be modified. For example:
RMAN> Configure device type disk parallelism 2;
3.4 configure controlfile autobackup configuration control file automatic backup
whether automatic backup is performed, including two statuses: off and on
enable automatic backup
Configure controlfile autobackup on
disable automatic backup
Configure controlfile autobackup off
You can also specify the backup control the format and path. For example,
Configure controlfile autobackup format for device type disk to 'd:/backup/% F';
a snapshot of the control file is generated during Backup, this snapshot can be configured as follows:
Configure snapshot controlfile name to 'd:/backup/snrusky. ora ';
3.5 configure device type to set parallel backup
RMAN supports parallel backup and recovery. You can also specify the default parallel degree in the configuration. For example:
Configure device type disk parallelism 2;
Specify that in future backup and recovery, the degree of parallelism will be 2, and two channels will be enabled for backup and recovery at the same time, of course, you can also specify the path in run to determine the parallel degree of backup and recovery.
The number of parallel threads determines the number of opened channels. If channel configuration is specified, the specified channel is used. If no channel is specified, the default Channel configuration is used.
By default, the degree of parallelism of the automatically allocated channel is 1. If you set the parallel channel to 2 by setting parallelism, In the run block, if you do not specify a channel through the allocate channel command, two parallel channels are used by default.
If you specify several allocate channels in the Run Command block, RMAN will follow the channel you set when executing the BACKUP command, regardless of the number of parallel channels configured in configure. Note that the BACKUP command
There is a filesperset parameter. This parameter refers to the maximum number of backup segments (Disk Files) that can be contained in each backup set created by RMAN. The default value of this parameter is 64, if this parameter value is not specified when the BACKUP command is executed, RMAN will only
Use the first channel for backup, and other channels will be idle. There is also a size relationship between the number of channels and the value of filesperset. If the logic is slightly more complex, there is not much nonsense. In a word, the value of filesperset should not be smaller than the value you set.
Number of channels.
3.6 configure datafile backup copies set backup file Redundancy
3.7 configure maxsetsize configure the maximum size of the Backup set
This configuration limits the maximum size of the Backup set on the channel. The Unit is bytes, K, M, and G. The default value is unlimited.
Iii. Dynamic Performance Table related to RMAN backup
V $ archived_log: This view contains the creation, backup, and other information of all archived and redone log files.
V $ backup_corruption uption: This view shows which backup sets of RMAN have found corrupted data. When you use the backup validate command to check the backup set, if damaged data blocks are found, RMAN will write records in this view.
V $ copy_corruptio: This view shows which image copy backup files are damaged.
V $ backup_datafile: this view is usually used to obtain the number of non-blank data blocks in each data file, which helps you create a backup set with the same size. In addition, the view also contains information about damaged data blocks in the data file.
V $ backup_redolog: This view shows the archived and redone log files in the existing backup set.
V $ backup_set: This view displays the information of the created backup set.
V $ backup_piect: This view displays the information of the created backup fragments.
You can use the following SQL statement to obtain the status of an image copy operation:
Select Sid,
Serial #,
Context,
SOFAR,
Totalwork,
Round (SOFAR/totalwork * 100, 2) "% complete"
From v $ session_longops
Where opname like 'rman: %'
And opname not like 'rman: Aggregate %'
Run the following SQL statement to obtain the SID and spid information of the service process that RMAN uses to perform backup operations:
Select Sid, spid, client_info
From v $ PROCESS p, V $ session s
Where p. ADDR = S. paddr
And client_info like '% id = RMAN %'
Table of RMAN-FORMAT-CONFIGURE and dynamic performance