Enabling Archive log mode

3 views
Skip to first unread message

sampath

unread,
Nov 26, 2008, 2:26:01 AM11/26/08
to Ask Oracle DBA
1)Check the current archive log mode in the database

SQL> SELECT LOG_MODE FROM SYS.V$DATABASE;

LOG_MODE
------------
NOARCHIVELOG

2)Specify the destination directory for your archives by including the
initialization parameter LOG_ARCHIVE_DEST_1 in the initialization
file.

If you are using spfile, then execute the following command.

alter system set log_archive_dest_1="LOCATION=<backup directory>"
scope=spfile;

If you are using pfile then make changes in the pfile

$ORACLE_HOME/dbs/initSID.ora (For UNIX systems)

$ORACLE_HOME\database\initSID.ora (For Windows systems)

Change the LOG_ARCHIVE_DEST_1 parameter to:

LOG_ARCHIVE_DEST_1="LOCATION=<backup directory>"

(Optional) The default filename format for archive logs is:

For UNIX systems:

%t_%s_%r.dbf

For Windows systems:

ARC%S_%R.%T

If you would like to use a different format, include the
initialization parameter LOG_ARCHIVE_FORMAT in the initialization
file, for example:

LOG_ARCHIVE_FORMAT = 'log%t_%r_%s.arc'

In the preceding example, t represents the thread number, r represents
the reset log ID, and s represents the log sequence number.

3)Perform a clean, normal shutdown of the database instance.
SQL> shutdown

4)Start up the instance and mount, but do not open the database.
SQL> startup mount;

5)Enable database ARCHIVELOG mode.
SQL> alter database archivelog;

6)Shut down and restart the database instance.
SQL> shutdown
SQL> startup

7)Verify the database is now in ARCHIVELOG mode.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /disk1/oraHome/archive
Oldest on-line log sequence 197
Next log sequence to archive 199
Current log sequence 199

Reply all
Reply to author
Forward
0 new messages