Enable/Disable Archive Log Mode 10g/11g

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.

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.

[oracle@ora1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 8 12:02:52 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     25
Current log sequence           27
SQL>

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.

SQL> show parameter recovery_file_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /u01/app/oracle/flash_recovery
                                                 _area
db_recovery_file_dest_size           big integer 3852M
SQL>

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.

SQL> alter system set log_archive_dest_1='LOCATION=/u02/app/oracle/oradata/orcl/arch' scope = both;

System altered.

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u02/app/oracle/oradata/orcl/arch
Oldest online log sequence     25
Current log sequence           27
SQL> 

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

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  849530880 bytes
Fixed Size                  1339824 bytes
Variable Size             511708752 bytes
Database Buffers          331350016 bytes
Redo Buffers                5132288 bytes
Database mounted.
SQL>

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

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u02/app/oracle/oradata/orcl/arch
Oldest online log sequence     25
Next log sequence to archive   27
Current log sequence           27
SQL>

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.

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

SQL> alter system switch logfile;

System altered.

SQL> host 
[oracle@ora1 ~]$ ls /u02/app/oracle/oradata/orcl/arch
1_27_711369564.dbf
[oracle@ora1 ~]$ exit
exit

SQL>

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.

[oracle@ora1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 8 12:54:05 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u02/app/oracle/oradata/orcl/arch
Oldest online log sequence     26
Next log sequence to archive   28
Current log sequence           28
SQL>

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

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  849530880 bytes
Fixed Size                  1339824 bytes
Variable Size             511708752 bytes
Database Buffers          331350016 bytes
Redo Buffers                5132288 bytes
Database mounted.
SQL>

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

SQL> alter database noarchivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u02/app/oracle/oradata/orcl/arch
Oldest online log sequence     26
Current log sequence           28
SQL>

As you can see, ARCHIVELOG mode has been disabled.

50 thoughts on “Enable/Disable Archive Log Mode 10g/11g”

  1. While enabling archivelog mode, there is an Listner error.
    Below are the steps followed:

    SQL> alter system set log_archive_dest_1=’location=D:\oracle\product\10.2.0\flash_recovery_area’ sco
    pe=both;

    System altered.

    SQL> archive log list;
    Database log mode No Archive Mode
    Automatic archival Disabled
    Archive destination D:\oracle\product\10.2.0\flash_recovery_area
    Oldest online log sequence 8
    Current log sequence 10
    SQL> shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup mount;
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

    Oracle version is
    SQL> select * from v$version ;

    BANNER
    —————————————————————-
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Prod
    PL/SQL Release 10.2.0.1.0 – Production
    CORE 10.2.0.1.0 Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 – Production
    NLSRTL Version 10.2.0.1.0 – Production

    Please provide me solution how to resovlve this error.

    Regards
    Swathi.

  2. HI Swati,

    You are using 32 bit windows server may 2003 & Oracle 10g.2.

    Click on windows start button–> then select Run—>then write–>cmd
    —> then write lsnrctl start, then your listener is go start…
    after is you can issue your command.
    sql> archive log list;
    sql> shut immediate;
    sql> startup mount;
    sql> alter database archivelog;
    sql> archive log list #
    sql> show parameter log_

    Thanks & Regards,
    Ranvir Meshram
    +919890673586

  3. Dear Eric,

    What is the advantage to enable archive mode in oracle?

    Regards,
    Purvesh Prajapati

  4. Dear Eric,

    I have done the archiv log enble on our UAT server. I will do the monitoring and get back if any issue.

    Thanks for your instructions to enable archive.

    Regards,
    Purvesh Prajapati

  5. Hello Purvesh,

    Enabling archive log mode allows you to employ high availability features in Oracle such data guard and flashback database. Archive log mode also allows you to perform database backups while the database is online and allows point in time recovery.

  6. Hello Purvesh,

    One thing to monitor in your UAT environment is the LOG_ARCHIVE_DEST_1 directory. Make sure that location has enough space to hold a days worth of archive logs. If the location is filled with archive logs the database will not be able to write archive logs and will hang until space is available.

    The easiest way to clear the archive logs is to back them up. See the post Quick RMAN configuration for disk based backups for a quick tutorial on setting up RMAN. After that all you need to do is issues the command in RMAN.

    backup archivelog all delete input;
    

    This will backup the archive logs to the configured location and delete archive logs in the archive log directory.

  7. I have a new Oracle 11g DB on an AIX platform and the DB was not in archive log mode so that import would not fill up the archive log space. I now want to put the DB in archivelog mode. After following the steps above, I attempted to backup the DB and it failed because it expected an archivelog file to exist that did not. What did I miss? I then attempted to backup just the archive logs with RMAN and received the same message. Any assistance would be reatly appreciated. I am new to 11g. Ann

    RMAN> backup archivelog all delete input;

    Starting backup at 25-APR-11
    current log archived
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=398 device type=DISK
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of backup command at 04/25/2011 10:47:30
    RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
    ORA-19625: error identifying file /u05/oradata/oaktst11/archive/1_104_742662353.arc
    ORA-27037: unable to obtain file status
    IBM AIX RISC System/6000 Error: 2: No such file or directory
    Additional information: 3

  8. Hi Ann,

    This is possible that some one has edited the file or deleted the required archive log file, you can do two things if you have a file backup from os you can put it back at the same location or you can unregister rman delete all the log file and then register rman * only if database is running fine

    Regards

  9. I have Oracle 11g R2 installed in Windows 2008 R2.The instance is running in noarchivelog mode now. It is running fine.
    I need to put it in archivelog mode but I am having issue trying to get it startup in mount mode since it has to have the OracleServiceORCL started.
    Once this service is started the database is in OPEN mode.
    Anyone knows, How to put OracleServiceORCL in windows to start in mount mode so I can put the database in Archivelog mode?
    I gave shutdown immediate – it went down properly
    SQL>
    SQL> shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup nomount;
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

    At this point, I have to start OracleServiceORCL to start it but it will go straight to OPEN mode.

    Thank you

  10. Hello David,

    It looks like you are connected using “connect sys/password@dbsid”. When the database is down it is no longer registered with the listener hence the error. There are two things you can do to resolve this issue.

    1. Connect to the db without using a network connection “connect / as sysdba”
    2. Statically register the database with the listener. I have document on how to do this: Configure Static Service Information for a Database

    Eric Jenkinson

  11. Pingback: WiSch GbR
  12. Hello Eric,

    I like your demosntrations, I would like to know how to display the out put with numbers in the clip board. Is there any software to do it?

  13. Hi Eric,

    Very nice explanation, thank you for your time in sharing your knowledge. I guess I’m a late visitor to this site πŸ™‚

    I feel very nice about your website.

    Thanks again

    Vamsi

  14. hi sir,

    nice explanation, i have a small doubt

    why should we put database in “mount state” to change database from ‘no archive’ to ‘archive’ and ‘archive’ to ‘no archive'(i mean why dont we put it in nomount or open state).

    Thanku and regards,
    Srinivasa Reddy.A

  15. Hi,

    I followed your instruction but with this you cannot enable Flash area recovery, how can we enable both?

  16. Swathi (December 20, 2010 3:23 am)
    While enabling archivelog mode, there is an Listner error.
    Below are the steps followed:

    SQL> alter system set log_archive_dest_1=’location=D:\oracle\product\10.2.0\flash_recovery_area’ sco
    pe=both;

    System altered.

    SQL> archive log list;
    Database log mode No Archive Mode
    Automatic archival Disabled
    Archive destination D:\oracle\product\10.2.0\flash_recovery_area
    Oldest online log sequence 8
    Current log sequence 10
    SQL> shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup mount;
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

    Oracle version is
    SQL> select * from v$version ;

    BANNER
    β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”-
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Prod
    PL/SQL Release 10.2.0.1.0 – Production
    CORE 10.2.0.1.0 Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 – Production
    NLSRTL Version 10.2.0.1.0 – Production

    Please provide me solution how to resovlve this error.

    Regards
    Swathi.

    solution for the problem
    *************************

    connect sys user without connection_String

    instead of sys@conn_string as sysdba
    connect like given below

    conn sys/sys as sysdba

    that is connect sys user without connection string

    then the above problem will solve

  17. Swathi (December 20, 2010 3:23 am)
    While enabling archivelog mode, there is an Listner error.
    Below are the steps followed:

    SQL> alter system set log_archive_dest_1=’location=D:\oracle\product\10.2.0\flash_recovery_area’ sco
    pe=both;

    System altered.

    SQL> archive log list;
    Database log mode No Archive Mode
    Automatic archival Disabled
    Archive destination D:\oracle\product\10.2.0\flash_recovery_area
    Oldest online log sequence 8
    Current log sequence 10
    SQL> shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup mount;
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

    Oracle version is
    SQL> select * from v$version ;

    BANNER
    β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”-
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Prod
    PL/SQL Release 10.2.0.1.0 – Production
    CORE 10.2.0.1.0 Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 – Production
    NLSRTL Version 10.2.0.1.0 – Production

    Please provide me solution how to resovlve this error.

    Regards
    Swathi.

    solution for the problem
    *************************

    connect sys user without connection_String

    instead of sys@conn_string as sysdba
    connect like given below

    conn sys/sys as sysdba

    that is connect sys user without connection string

    then the above problem will solve

    Thanks & Regards,

    P.RAJASEKAR

  18. archivelog set then, system alterd .
    it returns error:

    please let me know to solve the issue…

    SQL> alter database archivelog
    2 ;
    alter database archivelog
    *
    ERROR at line 1:
    ORA-00265: instance recovery required, cannot set ARCHIVELOG mode

  19. I am learning on 10g and keep getting an error when trying to do backup with RMAN. Can not backup open file in noarchivelog. I have shutdown, mount and enabled archive mode Oracle says it is in archivelog mode. Also checked em, also shows enabled yet I continue to get this error. After searching threads I have come up empty for this issue.

  20. I want to start archivelog mode automatically when issue startup? So write
    the required entries in pfile?

  21. when i write ‘alter database archivelog;’
    then oracle gives me error like ‘instance recovery required, cannot set ARCHIVELOG mode’
    now what should i do to fix this type of error.

  22. some time have to use location parameter.

    alter system set log_archive_dest_1=’location=C:\oracle\product\10.2.0\oradata\orcl’ scope = both

    thanks.

  23. Till now in my life as a dba manager I have read lots and lots of articles which never ever worked as crisp as yours, cheers mate, you rock πŸ™‚

  24. RMAN> recover database;

    Starting recover at 09-MAR-16
    using channel ORA_DISK_1

    starting media recovery

    unable to find archived log
    archived log thread=1 sequence=11
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of recover command at 03/09/2016 16:33:41
    RMAN-06054: media recovery requesting unknown archived log for thread 1 with seq
    uence 11 and starting SCN of 1204963

    How to resolve this error

  25. Assume Internal read fails occurred on a data file of a database. What dictionary views a DBA can use to find out the error.
    Explain the way to find it.
    Explain three more usage of that view.

Leave a Reply

Your email address will not be published. Required fields are marked *