rman恢复目录的使用
Posted wukc
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了rman恢复目录的使用相关的知识,希望对你有一定的参考价值。
环境:linux、oracle12c
1、将目标数据库注册到恢复目录
将恢复目录表中创建记录 将目标数据库中控制文件的数据复制到恢复目录 将恢复目录和控制文件同步 [oracle@12c oracle]$ rman target sys/oracle@orcl catalog rman_catalog_user01/oracle@catalog connected to target database: ORCL (DBID=1567775293) connected to recovery catalog database RMAN> register database; database registered in recovery catalog starting full resync of recovery catalog full resync complete [oracle@12c backup]$ sqlplus rman_catalog_user01/oracle@catalog SQL> SELECT * FROM rc_database;
2、将其他备份文件加入到恢复目录
catalog可以将元数据不在控制文件中的备份文件加入的恢复目录中 rman> catalog archivelog, backuppiece, backup, controlfilecopy, datafilecopy, db_recovery_file_dest, device, recovery, start" RMAN>catalog recovery area; --将快速恢复区中所有的文件列入的恢复目录中 RMAN>catalog start with ‘/u02/app/oracle/backup/‘; --将/u02/app/oracle/backup目录下所有文件都加入的恢复目录中 RMAN>catalog start with ‘/u02/app/oracle/backup‘; --将/u01/app/oracle目录以backup开头的所有文件加入到恢复目录中
3、将目标数据库从恢复目录中注销
[oracle@12c oracle]$ rman target sys/oracle@orcl catalog rman_catalog_user01/oracle@catalog connected to target database: ORCL (DBID=1567775293) connected to recovery catalog database RMAN> unregister database;
4、手动同步恢复目录
目录数据库的物理结构发生变化、自动同步恢复目录不可用 RMAN> resync catalog; starting full resync of recovery catalog full resync complete