1)问题原因及现象简单说明:
3)mount数据库,再alter为archivel模式则恢复正常
4)查看归档信息
5)修改归档位置
6)修改最大log_archive个数
7)修改log_archive格式
因虚拟机非正常关机(数据库也非正常关机),再次启动startup mount,修改为archivel模式的时候提示
2)正常启动数据库,然后再正常关闭
SQL> alter database archivelog;
alter database archivelog
*
ERROR at line 1:
ORA-00265: instance recovery required, cannot set ARCHIVELOG mode
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>
Database altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> alter database archivelog;
Database altered.
SQL> select log_mode from v$database;
LOG_MODE
------------------------
ARCHIVELOG
SQL>
Database altered.
SQL> select log_mode from v$database;
LOG_MODE
------------------------
ARCHIVELOG
SQL>
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 4
Next log sequence to archive 6
Current log sequence 6
SQL>
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 4
Next log sequence to archive 6
Current log sequence 6
SQL>
SQL> alter system set log_archive_dest_1='location=/opt/oracle/archive_log/archive_log';
System altered.
SQL>show parameter log_archive_dest_1
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
log_archive_dest_1 string location=/opt/oracle/archive_l
og/archive_log
log_archive_dest_10 string
SQL>
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /opt/oracle/archive_log/archive_log
Oldest online log sequence 4
Next log sequence to archive 6
Current log sequence 6
SQL>
System altered.
SQL>show parameter log_archive_dest_1
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
log_archive_dest_1 string location=/opt/oracle/archive_l
og/archive_log
log_archive_dest_10 string
SQL>
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /opt/oracle/archive_log/archive_log
Oldest online log sequence 4
Next log sequence to archive 6
Current log sequence 6
SQL>
SQL> alter system set log_archive_max_processes = 5;
System altered.
SQL>
System altered.
SQL>
SQL> show parameter log_archive_format
NAME TYPE VALUE
------------------------------------ ---------- ------------------------------
log_archive_format string %t_%s_%r.dbf
SQL> alter system set log_archive_format = "archive_%t_%s_%r.log" scope=spfile;
System altered.
SQL> show parameter log_archive_format
NAME TYPE VALUE
------------------------------------ ---------- ------------------------------
log_archive_format string %t_%s_%r.log
SQL>
NAME TYPE VALUE
------------------------------------ ---------- ------------------------------
log_archive_format string %t_%s_%r.dbf
SQL> alter system set log_archive_format = "archive_%t_%s_%r.log" scope=spfile;
System altered.
SQL> show parameter log_archive_format
NAME TYPE VALUE
------------------------------------ ---------- ------------------------------
log_archive_format string %t_%s_%r.log
SQL>
本文出自 “Focus on Oracle” 博客,请务必保留此出处http://alexy.blog.51cto.com/6115453/1072670