Professional Documents
Culture Documents
NOARCHIVELOG (Default)
ARCHIVELOG (Optional)
Archiving:
The redo log files contain a record of all the changes that occur in the database.
These can CREATE, ALTER, DROP, TRUNCATE, INSERT, UPDATE, DELETE, MERGE, GRANT,
REVOKE, COMMIT, or ROLLBACK statements.
These changes are written to the redo log files by the Log Writer (LGWR) background processes.
Let us assume there are two redo log groups in the HRDEV database. The LGWR initially begins
writing to the first redo log file.
When this redo log file becomes full, Oracle performs a log switch and the LGWR starts writing
to the second redo log group.
When the second redo log file becomes full, it once again performs a log switch and returns to
the first redo log group.
At this point LGWR will overwrite the previous contents of the log file based on the archiving
mode of the database.
In noarchivelog mode the LGWR process can overwrite the contents of the first redo log file
without first saving its contents.
When a database is operating in archivelog mode, the LGWR will overwrite the contents of the
redo log file, only after the contents of the redo log file have been stored to an offline file called
the archive file.
An archive file is a copy of the redo log file, before it can be overwritten.
Archive files are used for recovering a database in the event of media failure.
ORACLE-PEOPLESOFT DBA SCHOOL, E-508 KEERTHI APTS, BEHIND SARATHI STUDIOS,
AMEERPET, FACULTY: SATYA SEELAM (HARI) PH: 9966293445
It is highly recommended that archive files be stored in an offline site in a fireproof storage
facility.
Archive files are created automatically by the ARCH background process whenever a log switch
occurs. This is known as automatic archiving.
LGWR
ARCH
REDO LOG 1
LOGSWITCH
REDO LOG 2
The backup and recovery strategies available to a database administrator vary depending on
the archiving mode of the database.
ORACLE-PEOPLESOFT DBA SCHOOL, E-508 KEERTHI APTS, BEHIND SARATHI STUDIOS,
AMEERPET, FACULTY: SATYA SEELAM (HARI) PH: 9966293445
SQL>STARTUP MOUNT;
F. Exit SQL*Plus
SQL>EXIT
NOARCHIVELOG Mode
In NOARCHIVELOG mode, the online redo log files are overwritten each time an online
redo log file is filled, and log switches occur.
LGWR does not write a redo log group until the checkpoint for that group is completed.
ARCHIVELOG MODE
If the database is configured to run in ARCHIVELOG mode, active groups of filled online redo log
files must be archived.
Because all changes made to the database are recorded in the online redo log files, the
database administrator can use the physical backup and the archived online Redolog files to
recover the database without losing any committed data.
ORACLE-PEOPLESOFT DBA SCHOOL, E-508 KEERTHI APTS, BEHIND SARATHI STUDIOS,
AMEERPET, FACULTY: SATYA SEELAM (HARI) PH: 9966293445
SQL>SHUTDOWN;
$vi $ORACLE_HOME/dbs/initHRDEV.ora
LOG_ARCHIVE_DEST=/disk1/oradata/HRDEV/ARCH
3. Create a directory for the archive log file.
$mkdir /disk1/oradata/HRDEV/ARCH
4. Start the Database in MOUNT state and issue the following command
SQL>STARTUP MOUNT
SQL>ALTER DATABASE ARCHIVELOG;
SQL>ALTER DATABASE OPEN;
To check whether the database is in archive log mode:
SQL>ARCHIVE LOG LIST