Rman相关命令

show all;

----显示目标数据库的备份配置信息用策略。

 

report用于判断数据库当前可恢复状态、以及数据库已有备份的信息。

RMAN> report schema;   --表空间

Report of database schema for database with db_unique_name ORCL

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    710      SYSTEM               ***     +DATA/orcl/datafile/system.260.834214595
2    600      SYSAUX               ***     +DATA/orcl/datafile/sysaux.261.834214997
3    345      UNDOTBS1             ***     +DATA/orcl/datafile/undotbs1.262.834215347
4    5        USERS                ***     +DATA/orcl/datafile/users.264.834215541

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    64       TEMP                 32767       +DATA/orcl/tempfile/temp.263.834215483

 

RMAN> report obsolete;  -- 过期备份

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
no obsolete backups found

 

 

 

RMAN> report unrecoverable;  --报告不可恢复的

Report of files that need backup due to unrecoverable operations
File Type of Backup Required Name
---- ----------------------- -----------------------------------

 

 

 

RMAN> report need backup;    --报告需要备份的


RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of files with less than 1 redundant backups
File #bkps Name
---- ----- -----------------------------------------------------
1    0     +DATA/orcl/datafile/system.260.834214595
2    0     +DATA/orcl/datafile/sysaux.261.834214997
3    0     +DATA/orcl/datafile/undotbs1.262.834215347
4    0     +DATA/orcl/datafile/users.264.834215541

 

 

 

 

RMAN> report need backup days=3;    --报告最近三天没有备份的

Report of files whose recovery needs more than 3 days of archived logs
File Days  Name
---- ----- -----------------------------------------------------
1    146   +DATA/orcl/datafile/system.260.834214595
2    146   +DATA/orcl/datafile/sysaux.261.834214997
3    146   +DATA/orcl/datafile/undotbs1.262.834215347
4    146   +DATA/orcl/datafile/users.264.834215541

 

 

RMAN> report need backup incremental=3;  --如果出了问题 需要多少个增量备份文件才能恢复的数据文件 。(如果出问题,这些数据文件将需要3个增量备份才能恢复)


Report of files that need more than 3 incrementals during recovery
File Incrementals Name
---- ------------ ----------------------------------------------

 

 

 

backup常用命令

 

backup database tag='20140510_bak_all';    ----备份整个库 并且打上tag  tag需要唯一

 

backup database keep forever;                  --永久保留备份文件

 

backup database keep until time='sysdate+7'; --保存备份7天

 

 

 

run{
  allocate channel c1 device type disk;
  allocate channel c2 device type disk;
  allocate channel c3 device type disk;
  allocate channel c4 device type disk;
  backup database format 'bak/full_%u_%T.bak';
  backup spfile format 'bak/spfile_%u_%T.bak';
  backup current controlfile format 'bak/ctl_%u_%T.bak';
  sql 'alter system archive log current';
  backup archivelog all delete input format 'bak/arc_%u_%T.bak';
  release channel c1;
  release channel c2;
  release channel c3;
  release channel c4;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值