You are on page 1of 3

22/08/13

Document 69739.1

In this Document Purpose Scope Details Turning Archiving On and Off Setting the Initial Database Archiving Mode Changing the Database Archiving Mode To Prepare to Switch Database Archiving Mode

APPLIES TO:
Oracle Server - Enterprise Edition - Version 10.2.0.1 to 11.2.0.4 [Release 10.2 to 11.2] Information in this document applies to any platform. ***Checked for relevance on 01-Mar-2011***

PURPOSE
This article gives an overview of database archiving.

In case you may want or need more about your current topic - please also access the Backup & Recover Community of Customers and Oracle Specialists directly via: https://communities.oracle.com/portal/server.pt/community/database_backup_and_recovery/243

SCOPE
The intended audience is database administrators.

DETAILS
Turning Archiving On and Off
You set a database's initial archiving mode as part of database creation. Usually, you can use the default of NOARCHIVELOG mode at database creation because there is no need to archive the redo information generated at that time. After creating the database, decide whether to change from the initial archiving mode. After a database has been created, you can switch the database's archiving mode on demand. However, you should generally not switch the database between archiving modes. NOTE: If a database is automatically created during Oracle installation, the initial archiving mode of the database is operating system specific. See your operating system-specific Oracle documentation. ARCHIVELOG mode is necessary for creating on-line backups and for certain types of database recovery. Configuring the database to operate in ARCHIVELOG mode allows the user to perform complete and point-in-time recovery from media (disk) failures using off-line or on-line backups. If ARCHIVELOG mode is disabled, the database can be restored from a backup in case of failure, but it cannot be rolled forward from that to a point when failure occurred. Oracle recommends ARCHIVELOG mode for all production databases

Setting the Initial Database Archiving Mode


When you create the database, you set the initial archiving mode of the redo log in the CREATE DATABASE statement. If you do not specify
https://support.oracle.com/epmos/faces/ui/km/DocTextDisplay.jspx?_afrLoop=1003084147304797&type=DOC&id=69739.1&_afrWindowMode=0&_adf.ctrl-state= 1/3

22/08/13

Document 69739.1

either ARCHIVELOG or NOARCHIVELOG, NOARCHIVELOG is the default. To verify database mode, execute following statement:
S Q L >S e l e c tN A M E ,C R E A T E D ,L O G _ M O D E ,C H E C K P O I N T _ C H A N G E # ,A R C H I V E _ C H A N G E # f r o mV $ D A T A B A S E N A M EC R E A T E DL O G _ M O D EC H E C K P O I N T _ C H A N G E #A R C H I V E _ C H A N G E # ----O 1 1 21 9 M A R 0 9N O A R C H I V E L O G1 4 3 8 4 2 61 3 5 9 6 1

Changing the Database Archiving Mode


There are "init.ora" parameters you need to modify in order to properly handle your database being in archive log mode. They are: L O G _ A R C H I V E _ D E S TL O G _ A R C H I V E _ F O R M A T LOG_ARCHIVE_DEST: This parameter specifies the directory where your archive logs will be placed. LOG_ARCHIVE_FORMAT: This parameter names the archive logs in this format. For example, if your format is: arch%s.arc Your log files will be called: arch1.arc, arch2.arc, arch3.arc where the '1', '2', '3', etc is the sequence number.

To Prepare to Switch Database Archiving Mode


1. Shut down the database instance.
S Q L >s h u t d o w ni m m e d i a t e

An open database must be closed and dismounted and any associated instances shut down before the database's archiving mode can be switched. Archiving cannot be disabled if any datafiles need media recovery. 2. Backup the database. This backup can be used with the archive logs that you will generate. 3. Perform any operating system specific steps (optional). 4. Start up a new instance and mount, but do not open the database.
S Q L >s t a r t u pm o u n t

NOTE: If you are using the Real Application Cluster (RAC), then you must mount the database exclusively using one instance to switch the database's archiving mode. 5. Put the database into archivelog mode
S Q L >a l t e rd a t a b a s ea r c h i v e l o g ;

NOTE: You can also use


S Q L >a l t e rd a t a b a s en o a r c h i v e l o g

to take the database out of archivelog mode 6. Open the database.


S Q L >a l t e rd a t a b a s eo p e n ;

7. Verify your database is now in archivelog mode.


S Q L >a r c h i v el o gl i s t D a t a b a s el o gm o d e A u t o m a t i ca r c h i v a l A r c h i v ed e s t i n a t i o n O l d e s to n l i n el o gs e q u e n c e

A r c h i v eM o d e E n a b l e d U S E _ D B _ R E C O V E R Y _ F I L E _ D E S T 2 2
2/3

https://support.oracle.com/epmos/faces/ui/km/DocTextDisplay.jspx?_afrLoop=1003084147304797&type=DOC&id=69739.1&_afrWindowMode=0&_adf.ctrl-state=

22/08/13

Document 69739.1

N e x tl o gs e q u e n c et oa r c h i v e C u r r e n tl o gs e q u e n c e

2 4 2 4

8. Archive all your redo logs at this point.


S Q L >a r c h i v el o ga l l ;

9. Ensure these newly created Archive log files are added to the backup process. See the Administration guide & Backup and Recovery guide for more information about switching the archiving mode when using the Real Application Cluster (RAC).

https://support.oracle.com/epmos/faces/ui/km/DocTextDisplay.jspx?_afrLoop=1003084147304797&type=DOC&id=69739.1&_afrWindowMode=0&_adf.ctrl-state=

3/3

You might also like