Start/Close Database archive (archivelog) mode __ Database

Source: Internet
Author: User
Oracle databases can be run in 2 modes: Archive mode (Archivelog) and non-archive mode (Noarchivelog)
  
Archiving mode can improve the recoverability of Oracle databases, the production database should run in this mode, the archive mode should be combined with the corresponding backup strategy, only the archive mode without corresponding backup strategy will only cause trouble.
  
This article provides a brief description of how to enable and close the archive mode for a database.
  
   1.shutdown Normal or shutdown immediate shut down the database
  
[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, 2002, Oracle Corporation. All rights reserved.
  
Connected to:
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 database to Mount State
  
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 archiving mode
  
If you want to enable archive mode, use this here
  
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 archiving mode, use this here:
  
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 corresponding initialization parameters
  
Before oracle10g, you also need to modify initialization parameters to keep the database in automatic archive 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 archive mode.
  
You can also do this manually during the database startup process:
  
Archive Log Start
  
Enable automatic archiving of the database, but the database is still in manual archive mode after the reboot.
  
Starting with oracle10g, Log_archive_start parameters have been abolished

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.