Saturday 23 February 2013

Putting Database in ARCHIVELOG mode

Archiving the filled up redo logs is important and enables us to perform a point in time recovery (PITR).

1) Setting initialization parameters:

First we set the location and format for archive logs.

SQL> alter system set log_archive_dest_1 = 'location=/home/oracle/archive';


SQL> alter system log_archive_format='arch_%s_%t_%r_%d.arc';


From Oracle documentation these format values are as follows -
%s log sequence number
%S log sequence number, zero filled
%t thread number
%T thread number, zero filled
%a activation ID
%d database ID
%r resetlogs ID that ensures unique names are constructed for the archived log files across multiple incarnations of the database

2) Shutdown Database.

SQL> shut immediate;

3) Startup in mount mode.

SQL> startup mount;

4) Enabling ARCHIVELOG mode.

SQL> alter database archivelog;

5) Opening the database.

SQL> alter database open;

No comments:

Post a Comment