Oracle Learning Notes-Archive mode

Source: Internet
Author: User

What is archive mode

The Oracle database has an online redo log, which records changes made to the database, such as inserting, deleting, updating data, etc., which are recorded in the online redo log. A generic database must have at least 2 online redo log groups. When an online redo log group is written full, a log switch occurs, the online redo log Group 2 becomes the currently used log, when the online redo log Group 2 is full, the log switch, to write online redo log Group 1, so repeated.
If the database is in non-archive mode, the online log is discarded when it switches. In archive mode, when a log switch occurs, the log that is toggled is archived. For example, in the current use of online redo log 1, when 1 is full, a log switch occurs, start to write online redo log 2, the contents of online redo log 1 will be copied to another specified directory. This directory is called the Archive directory, and the copied files are called archive redo logs.
A database can be run with an archive for catastrophic recovery.

Note: The archive mode can improve the recoverability of the Oracle database, the production database should run in this mode, the archiving mode should be combined with the corresponding backup strategy, only the archive mode does not have a corresponding backup strategy will only cause trouble.

Opening and closing of archive mode

1. Connect to the database as an administrator

C:\users\administrator>sqlplus Sys/[email protected] as Sysdbasql*plus:release 11.2.0.1.0 Production on Tue June 17 23: 50:55 2014Copyright (c) 1982, Oracle.  All rights reserved.  Connected to:oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit productionwith The partitioning, OLAP, Data Mining and Real Application testing options

2. View current archive mode, archive or non-archive

Sql> Archive Log list;database log mode              No archive modeautomatic archival disabledarchive             Destination            Use_db_recovery_file_destoldest Online log sequence     228Current log sequence           230

3. Close the database

sql> shutdown immediate;database closed. Database dismounted. ORACLE instance shut down.

4. Start the database to Mount state

Sql> Startup Mount;oracle instance started. Total System Global area 3423965184 bytesfixed size                  2180544 bytesvariable size            2013268544 bytesdatabase buffers< c2/>1392508928 Bytesredo buffers               16007168 bytesdatabase mounted.

5. Start the archive mode

sql> ALTER DATABASE Archivelog;database altered. Sql> Archive Log list;database log mode              archive modeautomatic archival enabledarchive destination Use_            Db_recovery_file_destoldest Online log sequence     228Next log sequence to archive   230Current log sequence           230

6. Start the database

sql> ALTER DATABASE Open;database altered.

7. Turn off archive mode

sql> shutdown immediate;database closed. Database dismounted. ORACLE instance shut down. Sql> Startup Mount;oracle instance started. Total System Global area 3423965184 bytesfixed size                  2180544 bytesvariable size            2013268544 bytesdatabase buffers< c2/>1392508928 Bytesredo buffers               16007168 bytesdatabase mounted. sql> ALTER DATABASE Noarchivelog;database altered. Sql> Archive Log list;database log mode              No archive modeautomatic archival disabledarchive             Destination            Use_db_recovery_file_destoldest Online log sequence     228Current log sequence           230sql>

Reference:

How to start or turn off Oracle's archive (ARCHIVELOG) mode



Oracle Learning Notes-Archive mode

Related Article

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.