Monday, December 14, 2009

ARCHIVELOG AND NOARCHIVELOG MODE

All transactions are recorded in the online redo log file.
If the database is configured for NORACHIVELOG mode, no redo history is saved to archive log files and recovery operations are limited and a loss of transaction work may occur.

Configure your database in ARCHIVELOG mode ,so that a history of redo information is maintained in archived files.By default the database is in NOARCHIVELOG mode.

Changing the Archiving Mode:

Alter database [archivelog | noarchivelog]

To change the archiving more follow the steps
1) shutdown immediate
2) startup mount
3) alter database archivelog;
4) alter database open;

After database is set in ARCHIVELOG mode you can choose the mode of archiving i.e. automatic or manual archiving . In automatic archiving , the ARCn process is enabled and copy the redo files as they are filled.In manual archiving you have to use SQL *Plus or Oracle Enterprise Manager to copy the files.

You can specify upto 10 ARCn processes by

LOG_ARCHIVE_MAX_PROCESSES parameter

Start or Stop Additional Processes

Alter system set log_archive_max_processes=4;

Enabling Automatic Archiving at Instance Startup

LOG_ARCHIVE_START= [true | false]

Enabling Automatic Archiving After Instance Startup

Alter system archive log start;

Disabling Automatic Archiving

Alter system archive log stop

Manually Archiving Online Redo Log Files

Alter system archive log current;

Archive Log Destination

Use LOG_ARCHIVE_DEST_n to specify up to ten archival destinations.

Additional Options

Log_archive_dest_1=”LOCATION=/archive/ MANDATORY REOPEN”
Log_archive_dest_2=”SERVICE=standby_mydb MANDATORY REOPEN=600”
Log_archive_dest_3=”LOCATION =/archive001/ OPTIONAL”

MANDATORY implies that archiving to this destination must complete successfully before an online redo log file can be overwritten.

OPTIONAL implies that an online redo log file can be reused even if it has not been successfully archived to this destination. This is default.

REOPEN defines whether archiving to a destination must be reattempted inc ase of failure.The default is 300 seconds.If REOPEN is not specified ,errors at optional destination are recorded and ignored.

Log_archive_dest_state_1= DEFER

To stop arching to a mandatory location temporarily when an error has occurred ,the state of that destination can be set to DEFER.
To enable it

Log_archive_dest_state_1= ENABLE

1 comment:

Anonymous said...
This comment has been removed by a blog administrator.