Alter Database Archivelog Enable

When a database is in archive log mode chances of data loss are minimal. Here is a step by step procedure of how to enable archive logging in an Oracle database. First and foremost this requires you to change a few parameters in the parameter file and also shut down the database. RMAN Switching to Archivelog Mode. The Oracle database stores all the changes that are done in the redo log files. These files are used in the cyclical manner and the background process LGWR. (log writer) keeps on writing to them again and again. By Ahmed Abdel Fattah This is a quick post about the steps required to enable the ARCHIVELOG mode for an oracle database (Single Instance or RAC) To check if the archive log mode is enabled or not, use the following command: SYS@XPS 01-SEP-18 SQL archive log list.

Note: It is recommended to perform a backup of the database (after a shutdown normal or immediate) prior to changing the archive status of a database.

Grande

Alter

If you would like to perform these tasks using Database Console see the post Enable/Disable Archive Log Mode 10g/11g using Database Console.

Enable Archive Log Mode

The following are the steps required to enable archive log mode on an Oracle 10g or 11g database.

Verify the database log mode.

The log mode is No Archive Mode. Note that Archive destination is USE_DB_RECOVERY_FILE_DEST. You can determine the path by looking at the parameter RECOVERY_FILE_DEST.

By default, archive logs will be written to the flash recovery area. If you do not want to write archive logs to the flash recovery area you can set the parameter LOG_ARCHIVE_DEST_n to the location in which you wish to write archive logs.

Alter system archivelog disable

Now we shutdown the database and bring it backup in mount mode.

Lastly all that is needed it set archive log mode and open the database.

EnableAlter

We can now see that archive log mode is enabled. Notice that Automatic archive is enabled as well. In Oracle 9i an earlier another parameter needed to be set in order to enable automatic archiving. This in no longer the case in 10g and 11g as automatic archiving is enabled when the database is placed in archive log mode.

Database

You can switch to the log file to see that an archive is written to archive log location.

Disable Archive Log Mode

Note: It is recommended to perform a backup of the database (after a shutdown normal or immediate) prior to changing the archive status of a database.

The following are the steps required to disable archive log mode on an Oracle 10g or 11g database.

Verify the database log mode.

The Database log mode is Archive mode. Next we shut down the database and bring up back up in mount mode.

Alter Database Archivelog Enable Mysql

All that is left is to disable archive log mode and open the database.

Alter Database Archivelog Enable

As you can see, ARCHIVELOG mode has been disabled.