10g启动归档模式及报ORA-00265错处理

1)问题原因及现象简单说明:
因虚拟机非正常关机(数据库也非正常关机),再次启动startup mount,修改为archivel模式的时候提示
SQL> alter database archivelog;    
alter database archivelog
*
ERROR at line 1:
ORA-00265: instance recovery required, cannot set ARCHIVELOG mode
2)正常启动数据库,然后再正常关闭
SQL> alter database open;

Database altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
3)mount数据库,再alter为archivel模式则恢复正常
SQL> alter database archivelog;

Database altered.

SQL> select log_mode from v$database;

LOG_MODE
------------------------
ARCHIVELOG

SQL>
4)查看归档信息
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>
5)修改归档位置
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>
6)修改最大log_archive个数
SQL> alter system set log_archive_max_processes = 5;

System altered.

SQL>
7)修改log_archive格式
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>


你可能感兴趣的:(archive_log)