Skip to main content

How to enable archive logs on oracle database?

Its very simple, just one thing to note down here is you need to bring down database to enable/disable archive log.

Step 1: Login to sqlplus and shutdown database.
Step 2: Start database in mount mode.
Step 3: Alter database archive log enable.
Step 4: Open the database from mount to normal for read-write.

oracle:myhost> sqlplus "/as sysdba"

SQL> SHUTDOWN IMMEDIATE;

SQL> STARTUP MOUNT;

SQL>  ALTER DATABASE ARCHIVELOG;

SQL> ALTER DATABASE OPEN;

And we are done with Enabling archive log on database.

Query to validate database archive logs are:
1) Listing archive log list, result in first line shows weather your database is open in archivelog mode or not.
Example:
SQL> ARCHIVE LOG LIST;
    Database log mode ====> Archive Mode
    Automatic archival  =====> Enabled
    Archive destination  =====> log_archive_dest_1 path

if defined on v$parameters
oldest log sequence and next log sequence number to archive with current log sequence number.

2) Query on database with following sql to validate database is in archive log mode or not.
SELECT log_mode FROM SYS.V$DATABASE;

Above query will return ARCHIVELOG/NOARCHIVELOG.

Comments