ora 06026 06023

本文介绍了RMAN如何使用Flash Recovery Area进行数据库备份与恢复的过程,包括如何设置相关参数以确保备份的有效性和可用性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

如果备份文件没有问题,那么问题出在
If we start a RESTORE database with a BACKUP controlfile and FlashRecovery Area is defined, RMAN execute and implicit 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 controlfilethen changes 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 incarnation
RMAN considers backup availble for being restored if the backup incarnation and CURRENT incarnation in controlfile are the same.

根据文档说明,我设置了db_recovery_file_destdb_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                      TYPE      VALUE

------------------------------- ------------------------------

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='e:\archive';

 

Systemaltered.

 

SYS@ tsid> alter system set log_archive_dest_1='e:\archive1';

altersystem set log_archive_dest_1='e:\archive1'

*

ERROR atline 1:

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'

*

ERROR atline 1:

ORA-02097:parameter cannot be modified because specified value is invalid

ORA-16019:cannot use db_recovery_file_dest with LOG_ARCHIVE_DEST orLOG_ARCHIVE_DUPLEX_DEST

SYS@ tsid> alter system set log_archive_dest='';

Systemaltered.

SYS@ tsid> alter system setdb_recovery_file_dest='E:\oracle\product\10.2.0\flash_recovery_area';

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.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

黑头人

你的鼓励是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值