Enable/disable ARCHIVELOG Mode

Source: Internet
Author: User

 

  Oracle databases can run in two modes: archivelog and noarchivelog)
  
The archive mode can improve the recoverability of Oracle databases. Production Databases should all run in this mode. The Archive mode should be combined with the corresponding backup policies, only when the archive mode does not have a corresponding backup policy will it be troublesome.
  
This document describes how to enable and disable the archive mode of a database.
  
1. shutdown normal or shutdown immediate
  
[Oracle @ jumper oracle] $ sqlplus "/as sysdba"
  
SQL * Plus: Release 9.2.0.4.0-Production on Sat Oct 15 15:48:36 2005
  
Copyright (c) 1982,200 2, Oracle Corporation. All rights reserved.
  
Connected:
Oracle9i Enterprise Edition Release 9.2.0.4.0-Production
With the Partitioning option
JServer Release 9.2.0.4.0-Production
  
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
  
2. Start the database to the mount status.
  
SQL> startup mount;
ORACLE instance started.
  
Total System Global Area 101782828 bytes
Fixed Size 451884 bytes
Variable Size 37748736 bytes
Database Buffers 62914560 bytes
Redo Buffers 667648 bytes
Database mounted.
  
3. Enable or stop archive Mode
  
To enable the archive mode, use
  
Alter database archivelog command.
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/opt/oracle/oradata/conner/archive
Oldest online log sequence 148
Next log sequence to archive 151
Current log sequence 151
  
If you need to stop the archive mode, use:
  
Alter database noarchivelog command.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
  
Total System Global Area 101782828 bytes
Fixed Size 451884 bytes
Variable Size 37748736 bytes
Database Buffers 62914560 bytes
Redo Buffers 667648 bytes
Database mounted.
SQL> alter database noarchivelog;
  
Database altered.
  
SQL> alter database open;
  
Database altered.
  
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Enabled
Archive destination/opt/oracle/oradata/conner/archive
Oldest online log sequence 149
Current log sequence 152
  
4. Modify the initialization parameters.
  
Before Oracle10g, you also need to modify the initialization parameters so that the database is in the automatic archiving mode.
  
Set the following parameters in pfile/spfile:
  
Log_archive_start = true
  
Restart the database. This parameter takes effect when the database is in automatic archiving mode.
  
You can also 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.
  
The log_archive_start parameter has been abolished since Oracle10g.

 

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.