If we start a RESTORE database with a BACKUP controlfile and FlashRecovery Area is defined,RMAN execute andimplicit crosscheck and catalog of all the objects in the Flash RecoveryArea.
RMAN will catalog any objects in the Flash Recovery Area that will not be registered in the controlfile and if any of this files belongs to an incarnation different from CURRENT incarnation in the controlfilethenchanges controlfile CURRENT incarnation to the one found in the file that is being cataloged.
This prevents database from restoring backups that belong to old CURRENT incarnationRMAN considers backup availble for being restored if the backup incarnation and CURRENT incarnation in controlfile are the same.
根据文档说明,我设置了db_recovery_file_dest和db_recovery_file_dest_size参数并重新还原了控制文件然后在还原时将catalog指向我的备份文件所在目录:
alter system set db_recovery_file_dest='';
alter system set log_archive_dest='';
alter system set db_recovery_file_dest='D:\app\Administrator\log';
alter system set log_archive_dest_1='location=D:\app\Administrator\log';
重新开始还原即可。
LOG_ARCHIVE_DEST:指定归档文件存放的路径,该路径只能是本地磁盘,默认为’’。
LOG_ARCHIVE_DEST_n:默认值为’’。Oracle最多支持把日志文件归档到10个地方,n从1到10。归档地址可以为本地磁盘,或者网络设备。
DB_RECOVERY_FILE_DEST:指定闪回恢复区路径。
三者关系:
1、如果设置了DB_RECOVERY_FILE_DEST,就不能设置LOG_ARCHIVE_DEST,默认的归档日志存放于DB_RECOVERY_FILE_DEST指定的闪回恢复区中。可以设置LOG_ARCHIVE_DEST_n,如果这样,那么归档日志不再存放于DB_RECOVERY_FILE_DEST中,而是存放于LOG_ARCHIVE_DEST_n设置的目录中。如果想要归档日志继续存放在DB_RECOVERY_FILE_DEST中,可以通过如下命令:alter system set log_archive_dest_1=’location=USE_DB_RECOVERY_FILE_DEST’;
2、如果设置了LOG_ARCHIVE_DEST,就不能设置LOG_ARCHIVE_DEST_n和DB_RECOVERY_FILE_DEST。如果设置了LOG_ARCHIVE_DEST_n,就不能设置LOG_ARCHIVE_DEST。也就是说,LOG_ARCHIVE_DEST参数和DB_RECOVERY_FILE_DEST、LOG_ARCHIVE_DEST_n都不共存。而DB_RECOVERY_FILE_DEST和LOG_ARCHIVE_DEST_n可以共存。
3、LOG_ARCHIVE_DEST只能与LOG_ARCHIVE_DUPLEX_DEST共存。这样可以设置两个归档路径。LOG_ARCHIVE_DEST设置一个主归档路径,LOG_ARCHIVE_DUPLEX_DEST设置一个从归档路径。所有归档路径必须是本地的。
4、如果LOG_ARCHIVE_DEST_n设置的路径不正确,那么Oracle会在设置的上一级目录归档。比如设置LOG_ARCHIVE_DEST_1=’location=C:\archive1’,而OS中并没有archive1这个目录,那么Oracle会在C盘归档。
--===============================================================
测试:
SYS@ tsid> show parameter db_recovery_file_dest
NAME TYPEVALUE
------------------------------- ------------------------------
db_recovery_file_deststring E:\oracle\product\10.2.0\flash
_recovery_area
SYS@ tsid> alter system set log_archive_dest='e:\archive';
altersystem set log_archive_dest='e:\archive'
*
ERROR atline 1:
ORA-02097:parameter cannot be modified because specified value is invalid
ORA-16018:cannot use LOG_ARCHIVE_DEST with LOG_ARCHIVE_DEST_n or DB_RECOVERY_FILE_DEST
SYS@ tsid> alter system set db_recovery_file_dest='';
Systemaltered.
SYS@ tsid> alter system set log_archive_dest_1='e:\archive1';
altersystem set log_archive_dest_1='e:\archive1'
ORA-32017:failure in updating SPFILE
ORA-16179:incremental changes to "log_archive_dest_1" not allowed with SPFILE
SYS@ tsid> alter system setdb_recovery_file_dest='E:\oracle\product\10.2.0\flash_recovery_area';
altersystem set db_recovery_file_dest='E:\oracle\product\10.2.0\flash_recovery_area'
ORA-16019:cannot use db_recovery_file_dest with LOG_ARCHIVE_DEST orLOG_ARCHIVE_DUPLEX_DEST
SYS@ tsid> alter system set log_archive_dest='';
SYS@ tsid> alter system set log_archive_dest_1='location=e:\archive1';
Systemaltered
SYS@ tsid> alter system switch logfile;
System altered.
E盘中没有archive1目录,直接在E盘下生成了归档日志文件,验证了上面第4点。
SYS@ tsid> alter system set log_archive_dest_1='';
Systemaltered.
原文链接:https://www.f2er.com/oracle/207607.html