今天打開數據庫,想修改oracle的歸檔模式結果出現以下錯誤:
- SQL> alter database archivelog;
- alter database archivelog
- *
- ERROR at line 1:
- ORA-00265: instance recovery required, cannot set ARCHIVELOG mode
上網查了下,原來是上次系統的非正常關閉導致。需要重新打開數據庫,使數據文件,控制文件,日誌文件同步,再修改歸檔模式。
- 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 301305856 bytes
- Fixed Size 1336148 bytes
- Variable Size 167775404 bytes
- Database Buffers 125829120 bytes
- Redo Buffers 6365184 bytes
- Database mounted.
- SQL> alter database archivelog;
- Database altered.
- SQL> alter database open;
- 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 6
- Next log sequence to archive 8
- Current log sequence 8
OK!