--恢复数据文件2的块12,13,你可以指定多少数据文件
BLOCKRECOVER DATAFILE 2 BLOCK 12, 13 DATAFILE 3 BLOCK 5, 98, 99 DATAFILE 4 BLOCK 19;
---恢复数据文件多个块,表空间多个块(tablespace多个块,以dba为标记)
RUN
{
BLOCKRECOVER DATAFILE 3 BLOCK 2,3,4,5 TABLESPACE sales DBA 4194405, 4194409, 4194412
FROM DATAFILECOPY;
}
----从标记,恢复表空间system相关块
BLOCKRECOVER TABLESPACE SYSTEM DBA 4194404, 4194405 FROM TAG "weekly_backup";
---从2天前开始恢复system表空间数据块(相关)
BLOCKRECOVER TABLESPACE SYSTEM DBA 4194404, 4194405 RESTORE UNTIL TIME 'SYSDATE-2';
----验证是否可以备份数据库,恢复利用v$database_block_corruption所有的损坏块
The following example runs a backup validation to populate V$DATABASE_BLOCK_CORRUPTION, then repairs any corrupt blocks recorded in the view:
BACKUP VALIDATE DATABASE;
BLOCKRECOVER CORRUPTION LIST;
---catalog 一系列的归档日志到rman的资料库
CATALOG ARCHIVELOG '?/oradata/archive1_30.dbf', '?/oradata/archive1_31.dbf',
'?/oradata/archive1_32.dbf';
---catalog数据文件镜像作为level 0的基础
CATALOG DATAFILECOPY '?/oradata/users01.bak' LEVEL 0;
Note that you can create datafile copies either using the RMAN BACKUP AS COPY command, or by using operating system utilities in conjunction with ALTER TABLESPACE BEGIN/END BACKUP.
---catalog (模糊匹配)以/tmp/arch为类型的文件
CATALOG START WITH '/tmp/arch_logs';
---catalog恢复区域,并不提示
CATALOG RECOVERY AREA NOPROMPT;
---catalog备份片
CATALOG BACKUPPIECE '?/oradata/01dmsbj4_1_1.bcp';
list backup;--以默认方式显示所有的备份
list backup summary;--以概要方式显示所的备份
list backup by file;---以不同的文件备份类型显示所有的备份(数据文件,归档日志,spfile,控制文件)
list copy of database;--显示数据库的所有拷贝
list copy of archivelog all;---显示归档日志的拷贝
list backup of datafile 3 summary;--显示数据文件备份的概要
list incarnation;--显示存储在恢复目录中的数据库版本信息记录
list all script. names;---显示所有的存储脚本,必须是rman catalog
---让备份集100为不可用(一般用于是这个备份集找不到了,所以为了更新rman配置库中的信息
CHANGE BACKUPSET 100 UNAVAILABLE;
CHANGE BACKUP OF SPFILE COMPLETED BEFORE 'SYSDATE-1' UNAVAILABLE;
You do not need to allocate a maintenance channel.
---利用mv移动了归档日志,然后从rman资料库中nocatalog,最后加入rman资料库
HOST 'mv $ORACLE_HOME/oradata/trgt/arch/* /fs2/arch';
CHANGE ARCHIVELOG ALL UNCATALOG;
CATALOG START WITH '/fs2/arch';
---改变以标记consi为永远不过期,永远保存,不删除
CHANGE BACKUP TAG 'consistent_db_bkup'
KEEP FOREVER NOLOGS;
BLOCKRECOVER DATAFILE 2 BLOCK 12, 13 DATAFILE 3 BLOCK 5, 98, 99 DATAFILE 4 BLOCK 19;
---恢复数据文件多个块,表空间多个块(tablespace多个块,以dba为标记)
RUN
{
BLOCKRECOVER DATAFILE 3 BLOCK 2,3,4,5 TABLESPACE sales DBA 4194405, 4194409, 4194412
FROM DATAFILECOPY;
}
----从标记,恢复表空间system相关块
BLOCKRECOVER TABLESPACE SYSTEM DBA 4194404, 4194405 FROM TAG "weekly_backup";
---从2天前开始恢复system表空间数据块(相关)
BLOCKRECOVER TABLESPACE SYSTEM DBA 4194404, 4194405 RESTORE UNTIL TIME 'SYSDATE-2';
----验证是否可以备份数据库,恢复利用v$database_block_corruption所有的损坏块
The following example runs a backup validation to populate V$DATABASE_BLOCK_CORRUPTION, then repairs any corrupt blocks recorded in the view:
BACKUP VALIDATE DATABASE;
BLOCKRECOVER CORRUPTION LIST;
---catalog 一系列的归档日志到rman的资料库
CATALOG ARCHIVELOG '?/oradata/archive1_30.dbf', '?/oradata/archive1_31.dbf',
'?/oradata/archive1_32.dbf';
---catalog数据文件镜像作为level 0的基础
CATALOG DATAFILECOPY '?/oradata/users01.bak' LEVEL 0;
Note that you can create datafile copies either using the RMAN BACKUP AS COPY command, or by using operating system utilities in conjunction with ALTER TABLESPACE BEGIN/END BACKUP.
---catalog (模糊匹配)以/tmp/arch为类型的文件
CATALOG START WITH '/tmp/arch_logs';
---catalog恢复区域,并不提示
CATALOG RECOVERY AREA NOPROMPT;
---catalog备份片
CATALOG BACKUPPIECE '?/oradata/01dmsbj4_1_1.bcp';
list backup;--以默认方式显示所有的备份
list backup summary;--以概要方式显示所的备份
list backup by file;---以不同的文件备份类型显示所有的备份(数据文件,归档日志,spfile,控制文件)
list copy of database;--显示数据库的所有拷贝
list copy of archivelog all;---显示归档日志的拷贝
list backup of datafile 3 summary;--显示数据文件备份的概要
list incarnation;--显示存储在恢复目录中的数据库版本信息记录
list all script. names;---显示所有的存储脚本,必须是rman catalog
---让备份集100为不可用(一般用于是这个备份集找不到了,所以为了更新rman配置库中的信息
CHANGE BACKUPSET 100 UNAVAILABLE;
CHANGE BACKUP OF SPFILE COMPLETED BEFORE 'SYSDATE-1' UNAVAILABLE;
You do not need to allocate a maintenance channel.
---利用mv移动了归档日志,然后从rman资料库中nocatalog,最后加入rman资料库
HOST 'mv $ORACLE_HOME/oradata/trgt/arch/* /fs2/arch';
CHANGE ARCHIVELOG ALL UNCATALOG;
CATALOG START WITH '/fs2/arch';
---改变以标记consi为永远不过期,永远保存,不删除
CHANGE BACKUP TAG 'consistent_db_bkup'
KEEP FOREVER NOLOGS;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-614938/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9240380/viewspace-614938/