Configure the database archive mode (ARCHIVELOG/NOARCHIVELOG)

Source: Internet
Author: User
This article describes how to enable or disable the archive mode of a database. Oracle databases can run in two modes: archivelog and noarchivelog) for the differences between archive and non-archive, see ORACLE documentation. The database uses LOG files cyclically. If the database is in non-archive LOG mode, when the LOG file is used

This article describes how to enable or disable the archive mode of a database. Oracle databases can run in two modes: archivelog and noarchivelog) for the differences between archive and non-archive, see ORACLE documentation. The database uses LOG files cyclically. If the database is in non-archive LOG mode, when the LOG file is used

This topic describes how to enable or disable the database archive mode.
OracleThe database can run in two modes: Archive mode (Archivelog) And non-archive mode (Noarchivelog)
For the differences between archive and non-archive, see ORACLE documentation.
The database uses LOG files cyclically. If the database is in the "non-archive LOG" mode, when the LOG file is used, the redo information recorded in the file will be overwritten. Archive must be enabled to restore the database.
The archive mode can improve the recoverability of Oracle databases. Production Databases should all run in this mode. The Archive mode should be consistent with the correspondingBackupWhen policies are combined, only the archive mode does not have the corresponding backup policy, which will only cause trouble.

[System environment]
OS Version:
Microsoft Window XP Professional 2002 Service Pack 3

Oracle Version:
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

[Procedure]

1. Set NOARCHIVELOG ---> ARCHIVELOG
1. Confirm the current data mode
SQL> select dbid, name, log_mode from v $ database;

Dbid name LOG_MODE
-------------------------------
1182163329 ORCL NOARCHIVELOG
Note: Query v $ database to check the current database mode.

2. Shut down the database (shutdown normal or shutdown immediate)
SQL> shutdown normal
The database has been closed.
The database has been detached.
The ORACLE routine has been disabled.

3. Start the database to the MOUNT status.
(A) Start the database to the NOMOUNT status
SQL> startup nomount
The ORACLE routine has been started.

Total System Global Area 209715200 bytes
Fixed Size 1248140 bytes
Variable Size 79692916 bytes
Database Buffers 125829120 bytes
Redo Buffers 2945024 bytes

(B) Execute alter database mount to change the data to the MOUNT status.
SQL> alter database mount;
The database has been changed.
Note: The database is started to the MOUNT State through step-by-step operations.

4. Set the database to ARCHIVELOG (alter database archivelog)
(A) Status Before change:
SQL> archive log list
Database Log mode non-archive Mode
Disable automatic archiving
Archiving end point USE_DB_RECOVERY_FILE_DEST
The earliest online log sequence 6
Current Log sequence 8

(B) run the alter database archivelog command.
SQL> alter database archivelog;
The database has been changed.

(C) Status after modification:
SQL> archive log list
Database Log mode archiving Mode
Enable automatic archiving
Archiving end point USE_DB_RECOVERY_FILE_DEST
The earliest online log sequence 6
Next archive log sequence 8
Current Log sequence 8

5. Open the database
SQL> alter database open;
The database has been changed.


Ii. Set ARCHIVELOG ---> NOARCHIVELOG
1. Confirm the current data mode
SQL> archive log list
Database Log mode archiving Mode
Enable automatic archiving
Archiving end point USE_DB_RECOVERY_FILE_DEST
The earliest online log sequence 6
Next archive log sequence 8
Current Log sequence 8

2. Shut down the database (shutdown normal or shutdown immediate)
SQL> shutdown immediate
The database has been closed.
The database has been detached.
The ORACLE routine has been disabled.

3. Start the database to the MOUNT status.
SQL> startup mount
The ORACLE routine has been started.

Total System Global Area 209715200 bytes
Fixed Size 1248140 bytes
Variable Size 79692916 bytes
Database Buffers 125829120 bytes
Redo Buffers 2945024 bytes
The database has been loaded.

4. Set the database to NOARCHIVELOG (alter database noarchivelog)
(A) Status Before change:
SQL> archive log list
Database Log mode archiving Mode
Enable automatic archiving
Archiving end point USE_DB_RECOVERY_FILE_DEST
The earliest online log sequence 6
Next archive log sequence 8
Current Log sequence 8

(B) run the alter database noarchivelog command.
SQL> alter database noarchivelog;
The database has been changed.

(C) Status after modification:
SQL> archive log list
Database Log mode non-archive Mode
Disable automatic archiving
Archiving end point USE_DB_RECOVERY_FILE_DEST
The earliest online log sequence 6
Current Log sequence 8

5. Open the database
SQL> alter database open;
The database has been changed.


[Description]
1. Before Oracle10g, you also need to modify the initialization parameters so that the database is in the automatic archiving mode. There are two methods:
(A) set the following parameters in pfile:
Log_archive_start = true
Restart the database. This parameter takes effect when the database is in automatic archiving mode.
(B) manually execute the following commands during database startup:
Archive log start
Enable automatic archiving for the database, but the database is still in manual archiving mode after restart.

2. The log_archive_start parameter has been abolished since Oracle10g.

[Reference]
How to enable or disable ARCHIVELOG Mode
Author: eygle
Link: http://www.eygle.com/archives/2004/10/oracle_howtoeci.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.