How to Enable ARCHIVELOG Mode in Oracle

Most of the High Availability features of Oracle require you to enable ARCHIVELOG mode for your database. When you enable this mode redo logs will be archived instead of overwritten. Archive logs are utilized by RMAN, Data Guard, Flashback and many others.

Enabling archive mode is simple, just connect to your database in mounted but closed mode (start up mount) and alter the database. But if you don't tune a little you'll run into problems down the road, so lets specify some parameters too. Namely, consider LOG_ARCHIVE_DEST.

  •  SQL> shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    
     
  • Start up the database in mount mode and put it in archive log mode.
  •  SQL> startup mount;
    ORACLE instance started.
    
    Total System Global Area  417546240 bytes
    Fixed Size                  2213936 bytes
    Variable Size             301991888 bytes
    Database Buffers          109051904 bytes
    Redo Buffers                4288512 bytes
    Database mounted.
    
    SQL> alter database archivelog;
    
    Database altered.
  • Open the database and check the result.
  •  SQL> alter database open;
    
    Database altered.
    
    SQL>
    SQL> select log_mode from v$database;
    
    LOG_MODE
    ------------
    ARCHIVELOG
    
     

    There are several system views that can provide us with information regarding archives, such as:

  • V$DATABASE
  • Identifies whether the database is in ARCHIVELOG or NOARCHIVELOG mode and whether MANUAL (archiving mode) has been specified.
  • V$ARCHIVED_LOG
  • Displays historical archived log information from the control file. If you use a recovery catalog, the RC_ARCHIVED_LOG view contains similar information.
  • V$ARCHIVE_DEST
  • Describes the current instance, all archive destinations, and the current value, mode, and status of these destinations.
  • V$ARCHIVE_PROCESSES
  • Displays information about the state of the various archive processes for an instance.
  • V$BACKUP_REDOLOG
  • Contains information about any backups of archived logs. If you use a recovery catalog, the RC_BACKUP_REDOLOG contains similar information.
  • V$LOG
  • Displays all redo log groups for the database and indicates which need to be archived.
  • V$LOG_HISTORY
  • Contains log history information such as which logs have been archived and the SCN range for each archived log.