ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 11g rman增强(一)

11g rman增强(一)

原创 Linux操作系统 作者:安佰胜 时间:2011-12-07 16:16:27 0 删除 编辑
 
11g rman增强(一)
 
------------------------------
 
1、坏块处理命令blockrecover废弃
 
11g中不再使用blockrecover命令
代替的是功能更强的recover...block...
例:
recover datafile 5 block 22;
坏块具体的处理方法可以参考如下:
http://space.itpub.net/13177610/viewspace-671253
 
-----------------------------------
 
2、rman中使用替换变量
 
如下脚本中包含&1和&2两个可替换变量
使用可替换变量后可以使一套脚本适合在多个环境中使用
对于管理多个库或者使用catalog库集中管理的环境很适用
调用时只需要加上using子句就可以
示例如下:

--脚本内容
[oracle@localhost baks]$ more rman.sh
connect target /
run{
backup as compressed backupset full database tag &1
format '/mnt/hgfs/vmfiles/baks/full_&2%U.bkp'
;
}
exit;

--调用。两个替换变量分别使用了fullbak和db11_full作为替换值
[oracle@localhost baks]$ rman @rman.sh using fullbak db11_full
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Dec 7 15:40:06 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
RMAN> connect target *
2> run{
3> backup as compressed backupset full database tag fullbak
4> format '/mnt/hgfs/vmfiles/baks/full_db11_full%U.bkp'
5> ;
6> }
7> exit;
connected to target database: DB11 (DBID=1298141643)
Starting backup at 07-DEC-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=39 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oracle/oradata/db11/db11/system01.dbf
input datafile file number=00002 name=/oracle/oradata/db11/db11/sysaux01.dbf
input datafile file number=00003 name=/oracle/oradata/db11/db11/undotbs01.dbf
input datafile file number=00004 name=/oracle/oradata/db11/db11/users01.dbf
input datafile file number=00005 name=/oracle/oradata/db11/db11/tbs_an001.dbf
channel ORA_DISK_1: starting piece 1 at 07-DEC-11
channel ORA_DISK_1: finished piece 1 at 07-DEC-11
piece handle=/mnt/hgfs/vmfiles/baks/full_db11_full0qmtkdmo_1_1.bkp tag=FULLBAK comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:57
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 07-DEC-11
channel ORA_DISK_1: finished piece 1 at 07-DEC-11
piece handle=/mnt/hgfs/vmfiles/baks/full_db11_full0rmtkds9_1_1.bkp tag=FULLBAK comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 07-DEC-11
Recovery Manager complete.
--------------------------
 
3、rman配置中的新参数
 
在rman中使用show all;之后会发现
11g中增加了如下新参数
 
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
 
第一个参数是控制备份压缩方式的,系统中允许的备份压缩设置可以在动态性能视图中查询
在rman中可以使用configure命令替换压缩模式
如下:

--系统允许的压缩模式
SQL>  select algorithm_name,ALGORITHM_DESCRIPTION,IS_VALID from v$rman_compression_algorithm
ALGORITHM_NAME                 ALGORITHM_DESCRIPTION                                            IS_
------------------------------ ---------------------------------------------------------------- ---
BASIC                          good compression ratio                                           YES
LOW                            maximum possible compression speed                               YES
MEDIUM                         balance between speed and compression ratio                      YES
HIGH                           maximum possible compression ratio                               YES
 
--修改当前压缩模式
RMAN> configure compression algorithm 'HIGH';

----------------------------------------------------
 
第二个参数是控制归档日志文件自动删除策略机制的
大多数dba通常选择在脚本中使用backup...delete input的方式使用脚本自动删除已经备份过的归档日志文件
当然也有人通过手动的方式使用delete...archivelog的方式删除
但有些时候,如dg中或者要存多份归档日志文件备份的情况下这些方式可能不是最优的
11g中通过设置参数可以做到新的归档日志删除机制
 
--归档日志文件备份两次到磁带\磁盘中后自动删除
configure archivelog deletion policy to backed up 2 times to sbt;
configure archivelog deletion policy to backed up 2 times to disk;
 
--归档日志在应用到远程目的后即删除
--第一条命令应用于所需的备用,第二天命令用于所有的备用目的
configure archivelog deletion policy applied on standby;
configure archivelog deletion policy applied on all standby;
 
--归档日志先传送到备用节点后再应用再删除
--第一条命令应用于所需的备用,第二天命令用于所有的备用目的
configure archivelog deletion policy shipped on standby;
configure archivelog deletion policy shipped on all standby;
 
--删除所有归档日志删除策略
configure archivelog deletion policy to none;

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

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

注册时间:2009-08-26

  • 博文量
    215
  • 访问量
    607602