Archive log mode: query, enable, disable

 

 

Determine archive log mode

SQL> archive log list

 

SQL> select log_mode from v$database;

 

 

 

Enable archive log mode

 

If archiving is not enabled you need to shut down the database in order to

enable archiving.

 

oracle@host> export ORACLE_SID=SID_name

oracle@host> sqlplus / as sysdba

 

SQL> shutdown immediate;

SQL> startup mount;

SQL> alter database archivelog;

SQL> alter database open;

SQL> alter system archive log start;   OR   SQL> archive log start;

 

If the automatic archiving is not enabled (last command above) the DBA

need to manually archive the logs:

 

SQL> alter system archive log current;

SQL> alter system archive log all;

 

To make the automatic archiving permanent you need to issue:

 

SQL> alter system set log_archive_start=TRUE scope=spfile;

 

And then restart the database. In earlier versions need to modify init.ora

 

Disable archive log mode

 

This example is for versions > 9.2 where you using spfile and not init.ora

 

SQL> alter system set log_archive_start=False scope=spfile;

SQL> create pfile from spfile;

SQL> shutdown immediate;

 

SQL> startup mount excluseve;

SQL> alter database noarchivelog;

SQL> alter database open;

 

Force log file switch

 

SQL> alter system switch logfile;

 

If the database is in archive log mode you’ll see a new log generated.

 

 

Archive log related init.ora parameters

 

log_archive_dest

log_archive_dest_1

log_archive_format

archive_log_lag_target 

 

Rounded Rectangle: Home Page