Sunday, January 23, 2011

Archive LOG Mode Database


ARCHIVELOG mode

An Oracle database could be in ARCHIVELOG or NON ARCHIVELOG mode. When the database is in ARCHIVELOG mode one or more ARC process(es)  are taking backups of the redo log files when the redo logs are full or switched. That assure that all the database operations are kept in 2 places (in data files and in archive log files). Having the database in ARCHIVELOG mode assure us that the data will not be lost even if the original data (from datafiles) will become inaccessible or will be deleted accidentally. In other words it is guarantee to recover the database till the time of failure.



Is my database in ARCHIVELOG mode ?

To see if the database is in archivelog mode the following command could be used:

select NAME, LOG_MODE, ARCHIVELOG_CHANGE# from v$database;


How could I enable the ARCHIVELOG mode ?

1)  assure that we have the following parameters in init.ora:
      log_archive_start=TRUE                  -->obsolete for 10g and higher.

2)  startup mount
3)  alter database archivelog;  (enable automatic archiving)
     alter database archivelog MANUAL;  
(ALTER SYSTEM ARCHIVE LOG ALL;  must be run to archive the log files) 


How could I disable the ARCHIVELOG mode ?

1)  startup mount
2)  alter database noarchivelog; 


Automatic/ Manual Archiving

ARCHIVE LOG LIST;       ->  Show the Status of Automatic Archiving.
ARCHIVE LOG START;   ->  Start Automatic Archiving.
ARCHIVE LOG STOP;     ->  Stop Automatic Archiving.


Views used in managing database ARCHIVELOG mode

V$ARCHIVE_DEST      ->  Show the places where the archive logs are shipped. 
V$ARCHIVED_LOG     ->  Show the history of archived log files 
V$ARCHIVE_PROCESSES  ->  Show information about the current archiving process

No comments:

Post a Comment