"Original" Oracle's archive mode ____oracle

Source: Internet
Author: User
Tags oracle database

One. To see if the Oracle database is in archive mode:
1.select Name,log_mode from V$database;
NAME Log_mode
------------------ ------------------------
QUERY Noarchivelog
2. Use archive LOG LIST command
Database log mode No Archive mode
Automatic Archival Disabled
Archive Destination/data/oracle/product/10.2.0/db_1//dbs/arch
Oldest online log sequence 739
Current log sequence 741
Two. What is Oracle archive mode.
The Oracle database has an online redo log that records changes made to the database, such as inserts, deletes, updates, and so on, which are recorded in the online redo log. A general database must have at least 2 online redo log groups. When an online redo log group is full, there will be log switching, when the online redo log Group 2 become the current use of the log, when the online redo log Group 2 full time, log switching will occur, to write online redo log Group 1, so repeated.
If the database is in a non-archived mode, the online logs are discarded when you switch. In archive mode, when a log switch occurs, the log that is switched is archived. For example, when using online redo log 1, when 1 is full, log switching occurs, start writing online redo log 2, and the contents of online redo log 1 are copied to another specified directory. This directory is called the Archive directory, and the copied file is called the archive redo log.
A database is run with an archive to make a catastrophic recovery.
1. Differences between the archive log mode and the non-archived log mode
Non-archive mode can only do cold backups, and only a full backup can be done upon recovery. Data cannot be recovered during the most recent full backup to system error.
Archive mode can do hot backup, and can do incremental backup, can do partial recovery.
The archive LOG LIST allows you to see whether the archive mode or the archive mode is not in the period mode state.

Three. Configuring the archive mode for the database

Changing non-archive mode to archive mode:
1) Sql>shutdown normal/immediate;
2) Sql>start MOUNT;
3) Sql>alter DATABASE Archivelog;
4) Sql>alter DATABASE OPEN;

5) sql> do a full backup, because the backup log generated in the non-archived log mode is not available for archive mode. This step is not very important!

Change archive mode to non-archive mode:
1) Sql>shutdown normal/immediate;
2) Sql>start MOUNT;
3) Sql>alter DATABASE Noarchivelog;
4) Sql>alter DATABASE OPEN;
3. Enable automatic archiving: Log_archive_start=true
In archive mode, the log file group is not allowed to be overwritten (overridden), and if no manual archiving is done, the system will suspend until the archive is complete.
You can only read and not write at this time.
Shutdown and restart the archive log process during the run
Sql>archive LOG STOP
Sql>archive LOG START

4. Manual Archiving: Log_archive_start=false
Archive the current log file
Sql>alter SYSTEM ARCHIVE LOG current;
Archive log file with serial number 052
Sql>alter SYSTEM ARCHIVE LOG SEQUENCE 052;
Archive all log files
Sql>alter SYSTEM ARCHIVE LOG all;
Change the archive log target
Sql>alter SYSTEM ARCHIVE LOG current to ' &path ';

5. Archiving mode and non-archival mode conversion

The reverse process of the 4th step.

6. Configure multiple Archive processes
Q: When do I need to use multiple archive processes?
A: If the archive process consumes a lot of time, you can start multiple archive processes, a dynamic parameter that can be modified dynamically with alter system.
Sql>alter SYSTEM SET log_archive_max_processes=10;
Up to 10 archive processes can be specified in oracle9i
Dynamic performance View related to the archive process
V$bgprocess,v$archive_processes


7. Configure archive target, multiple archive target, remote archive target, archive log format
Archive Target Log_archive_dest_n
Local archive target:
sql>log_archive_dest_1 = "Location=d:oraclearchivedlog";
Remote Archive target:
sql>log_archive_dest_2 = "SERVICE=STANDBY_DB1";
Mandatory archive target, if error, retry after 600 seconds:
Sql>alter SYSTEM SET log_archive_dest_4 = "Location=e:oraclearchivedlog mandatory reopen=600";
Optional archive target, if error, discard archive:
Sql>alter SYSTEM SET log_archive_dest_3 = "Location=e:oraclearchivedlog OPTIONAL";

Archive target status: Close archive target and open archive target
Close Archive Target 1
Sql>alter SYSTEM SET log_archive_dest_state_1 = DEFER
Open Archive Target 2
Sql>alter SYSTEM SET log_archive_dest_state_2 = ENABLE

Archive log Format
Log_archive_format

8. Get archived Log information
V$archvied_log
V$archvie_dest
V$log_history
V$database
V$archive_processes

ARCHIVE LOG LIST;

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.