ITPub博客

首页 > 数据库 > Oracle > rman总结(包含10g rman中的新特性)

rman总结(包含10g rman中的新特性)

原创 Oracle 作者:watershed 时间:2006-05-26 15:32:40 0 删除 编辑

正在不断更新中......

[@more@]

1>10grman在backup的时候将当前没有用的到block跳过,不备份.而在以前的版本中rman只是跳过never been allocated blocks.


2>The CONFIGURE DEVICE TYPE ... PARALLELISM command specifies the number of
automatic channels to allocate for a specified device type. For example, if you configure parallelism to 3 for a device type, then RMAN allocates three channels for the device type when using automatic channels.


3>并行通道的个数应该和物理设备的match,也就是说如果只有一个磁带设备,那么sbt通道就不能并行,如果只有一个物理disk,那么disk通道就不能并行.


4>rman在备份archive log的时候如果一个归档路径失败或者一个log有损坏,那么rman将去另外的归档路径下寻找可用的archive log,直到备份成功.


5>The only difference between a level 0 incremental backup and a full backup is that a full backup is never included in an incremental strategy.


6>如果compatibility>=10.0.0,那么当Differential Incremental Backups时发现没有可用的level 0 backup,rman将备份自从文件创建以来的所有改变过的block,如果compatibility<10.0.0,那么rman将产生一次level 0备份

7>当自从上一次level 0备份以来数据块的改变已经大于或者等于总块数的20%时,就需要再做一次level 0 backup.
以下语句是查看在备份集中备份块数超过50%的数据文件:
SELECT FILE#, INCREMENTAL_LEVEL, COMPLETION_TIME, BLOCKS, DATAFILE_BLOCKS
FROM V$BACKUP_DATAFILE
WHERE INCREMENTAL_LEVEL > 0
AND BLOCKS / DATAFILE_BLOCKS > .5
ORDER BY COMPLETION_TIME;


9>Backup Optimization for SBT Backups with Recovery Window Retention Policy:
当backup optimization enable,那么当用rman备份文件到磁带的时候,rman备份比recovery window 旧的文件,即使在增量备份策略中自从上次备份以来数据没有修改过.


10>BACKUP DURATION 4:00 TABLESPACE users:参数duration将备份控制在4个小时之内,如果4个小时没有备份完成,那么未完成的backup set将中止并被丢弃,4小时只能完成的其他backup set是可用的,但是如果这个backup 命令是写在run block里面的,到达4小时的时候rman将会报错,这条命令以后的其他命令也将中止,不再继续.如果用了以下命令(加了参数PARTIAL):
BACKUP DURATION 4:00 PARTIAL TABLESPACE users FILESPERSET 1; 即使这个backup 命令是写在run block里面的,到达4小时的时候rman不会报错,只是出现一个message,显示哪些文件还没有备份,然后这个备份命令中止,而在这个命令后面的包含在run block里面的其他命令将继续执行.

注意上面的那条命令: also the use of FILESPERSET 1 in this example. With this option, RMAN puts each file into its own backupset. This way, when a backup is interrupted at the end of
the backup window, only the backup of the file currently being backed up is lost. All backup sets completed during the window are saved, minimizing the lost work due to the end of the backup window.

另:用DURATION可以得到最好的backup performance(在规定的时间内最快的完成备份)以及控制backup在规定的时间内准确完成(可以用来降低备份速度,让备份准确的在较长的时间段内完成,以降低在备份过程中rman造成的系统,这一点不宜用在tape streaming中),具体的用法如下:
To maximize performance, use the MINIMIZE TIME option with DURATION, as shown in this example:

BACKUP DURATION 4:00 PARTIAL MINIMIZE TIME DATABASE FILESPERSET 1;

To extend the backup to use the full time available, use the MINIMIZE LOAD option,as in this example:

BACKUP DURATION 4:00 PARTIAL MINIMIZE LOAD DATABASE FILESPERSET 1;

RMAN monitors the progress of the running backup, and periodically estimates how long the backup will take to complete at its present rate. If RMAN estimates that the backup will finish before the end of the backup window, it slows down the rate of backup so that the full available duration will be used. This reduces the overhead on the database associated with the backup

10> MAXCORRUPT:在一个文件中允许的逻辑坏块和物理坏块的总和.当坏块数小于这个参数时rman备份能够成功,并且记录这些坏块的信息在controlfile和catalog中,并且用户可以通过访问v$database_block_corruption视图来查看坏块的信息.
如果这个文件中的坏块总数超过了maxcorrupt的设置值,那么rman备份将失败,并且不会记录坏块信息.所以要想查看坏块信息就必须将这个参数设置的足够大.

11>rman如何备份不一致的block(fractured block),也就是当备份的时候正在被修改的block:
RMAN does not require that you put datafiles into backup mode. During an RMAN backup, a database server session reads each block of the datafile and checks whether each block is fractured by comparing the block header and footer. If a block is fractured, the session re-reads the block. If the same fracture is found, then the block is considered permanently corrupt. If MAXCORRUPT is exceeded, the backup stops.

12>Block Media Recovery with RMAN
these restrictions of block media recovery:
■ You can only perform block media recovery with RMAN. No
interface is available.
■ You can only perform complete recovery of individual blocks.
cannot stop recovery before all redo has been applied to the
■ You can only recover blocks marked media corrupt. The V$DATABASE_CORRUPTION view indicates which blocks in a file were marked most recent BACKUP or BACKUP ... VALIDATE command was
■ You must have a full RMAN backup. Incremental backups are
media recovery. Proxy backups are also not used by block media
full backups and archived log files are used.
■ Block media recovery is able to restore blocks from parent incarnation
and recover the corrupted blocks through a RESETLOGS.

当某个redo log 丢失,Block Media Recovery在读到这个redo的时候并不是马上报错而停止recovery.而是继续读后面的redo,因为如果后面的redo里删除了这个block上的表,那么就算丢失的redo里再怎么修改这个表上的记录,在下一个redo里其实是把这个block标识成了一个新块.也就是后一个redo覆盖了前面丢失的redo,所以block recovery可以继续下去.

12>to add a flash recovery area to an open database:
必须先设置参数DB_RECOVERY_FILE_DEST_SIZE,再设置DB_RECOVERY_FILE_DEST
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 10G SCOPE=BOTH SID='*';
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = '/disk1/flash_recovery_area' SCOPE=BOTH SID='*';
如何Disabling the Flash Recovery Area:
ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='' SCOPE=BOTH SID="*";
取消Flash Recovery Area以后,在其中存储的backup等等还可以被rman识别.

13>10g rman新功能:block change tracking
change tracking 记录块的变化,用于增量备份时rman不用扫描整个datafile,而是直接读这个change tracking file.
change tracking 是以level 0 backup为基础,也就是说level 0 backup还是要扫描整个数据文件,但是在level 基础上的增量或者累积备份就可以应用这个特性.

Enabling Change Tracking:
如果设置了DB_CREATE_FILE_DEST,那么可以直接SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;
否则必须指定文件名称和路径:
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '/mydir/rman_change_track.f' REUSE;

Disabling Change Tracking:
SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;
可以查询v$block_change_tracking视图来确定是否使用了block change tracking

Moving the Change Tracking File:
(1). If necessary, determine the current name of the change tracking file:
SELECT filename
FROM V$BLOCK_CHANGE_TRACKING;
(2). Shut down the database. For example:
SHUTDOWN IMMEDIATE
(3). Using host operating system commands, move the change tracking file to its new location.
(4). Mount the database and move the change tracking file to a location that has more space. For example:
ALTER DATABASE RENAME FILE
'ora_home/dbs/change_trk.f' TO '/new_disk/change_trk.f';
(5). Open the database:
ALTER DATABASE OPEN;
运用以上这样的步骤可以保留change tracking file里面原有的内容.但是如果数据库不允许停机,那么就得用一下方法,那么change tracking file里面原有的内容将会丢失,以后的增量备份都必须扫描datafile,直到做了一次level 0 backup:
(1).ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;
(2).ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE 'new_location';

14>影响archivelog路径的因素:
(1)如果LOG_ARCHIVE_DEST (and, optionally, LOG_ARCHIVE_DUPLEX_DEST) is set,那么archivelog的路径只遵循此参数的设置.
(2)如果 DB_RECOVERY_FILE_DEST is specified (that is, if a flash recovery area is
configured) 而且没有设置 LOG_ARCHIVE_DEST_n, then LOG_ARCHIVE_DEST_10参数隐含设置为 flash recovery area.
(You can override this behavior by explicitly setting LOG_ARCHIVE_DEST_10 to an empty string.)
(3)如果设置了任何一个LOG_ARCHIVE_DEST_n参数,那么archivelog的路径只遵循此参数的设置.如果想让archivelog路径为配置好的flash recovery area,那么可以将LOG_ARCHIVE_DEST_n参数配置为LOCATION=USE_DB_RECOVERY_FILE_DEST
(4)如果没有设置以下任何一个参数:LOG_ARCHIVE_DEST, LOG_ARCHIVE_DEST_n, orDB_RECOVERY_FILE_DEST,
那么redo logs are archived to a default location that is platform-specific. On Solaris, for example, the default is ?/dbs.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/75730/viewspace-838019/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-07-25

  • 博文量
    35
  • 访问量
    1389808