【小错误】起归档是遇到ORA-00265: instance recovery required, cannot set ARCHIVELOG mode

今天在起归档时遇到ORA-00265: instance recovery required, cannot set ARCHIVELOG mode的错误

从错误我们能够看到是由于datafile,controlfile,redolog中的SCN号不一致导致无法开启归档,那么导致该问题的解决办法是由于我重新启动数据库到mount的时候采用的是startup force mount;由于这个命令实际上是做了两步操作。分别例如以下:
1、shutdown abort    ---强制关闭数据库
2、startup mount

 既然我们隐含的做了shutdown abort操作之后。也就意味着datafile。controlfile。redolog这里面的SCN号肯定不一致,须要在open数据库的过程中做recover,因为他们的SCN号不一致,所以会导致无法在mount状态下开启archivelog,例如以下:

SQL> alter database archivelog;
alter database archivelog
*
ERROR at line 1:
ORA-00265: instance recovery required, cannot set ARCHIVELOG mode

解决办法如下:
将数据库起到open状态,正常关闭shutdown immediate,再起到mount状态:

SQL> alter database open ;

Database altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started. Total System Global Area 830930944 bytes
Fixed Size 2257800 bytes
Variable Size 536874104 bytes
Database Buffers 289406976 bytes
Redo Buffers 2392064 bytes
Database mounted.
SQL> alter database archivelog; Database altered. SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 5
Next log sequence to archive 7
Current log sequence 7

解决,Bingo~~~~

上一篇:(2)《Head First HTML与CSS》学习笔记---img与基于标准的HTML5


下一篇:Swift Core Data 图片存储与读取Demo