ORACLE11G Set archive mode and non-archive mode

Source: Internet
Author: User

1. First check if the current database is in archive mode
There are two ways to view 1.1 select name, Log_mode from V$database;
A value of Log_mode of Noarchivelog indicates that the database is in non-archive mode
A value of Log_mode of ARCHIVELOG indicates that the database is in Archive Mode 1.2 archive log list; (This method requires as SYSDBA)
Database log mode has a value of No Archive modeautomatic Archival value of Disabled indicates that the current DB is in non-archive mode
Database log mode has a value of Archive modeautomatic archival with the value of enabled, which means that the archive mode is turned on2. Non-archive mode database changed to archive mode
Changing the database from non-archive mode to archive mode requires the database to be in the Mount state. The following actions apply to versions above oracle10g and not for Oracle8i and 9i. 2.1 Close database shutdown immediate;
2.2 Start the database to mount state startup Mount;
2.3 Modify the database for the archive mode ALTER DATABASE archivelog;
2.4 Open the database.
2.5 Query whether the database is already in Archive mode archive log list;
The database has been changed from non-archive mode to archive mode
2.6 Modifying the log file naming formatalter system set log_archive_max_processes = 5;
alter system set Log_archive_format = "Archive_%t_%s_%r.log" scope=spfile;

If this is changed, the log file format of the archive after the restart is changed toarchive_%t_%s_%r.log format, otherwise it is still the default format. 2.7 Change log file path alter system set log_archive_dest_1= ' LOCATION=/DATA/ARCHIVELOG/ORCL ';
At this point the value of Archive destination is changed to/DATA/ARCHIVELOG/ORCLThe statement means determining the path to the archive log, in fact Oracle 10g can generate multiple copies of the same log, save multiple locations, safekeeping

For example, add a log location to use the following statement
Sql>alter system set log_archive_dest_2= ' Location=/bak/orcl/archive_log ';

2.8 Archive Current Redo log select name from V$archived_log;alter system archive log present;
You can see that the currently archived redo logs are available from V$archived_log after archiving the current redo log, and the file format of the archived log is still the default format because the database is not restarted. Note:<ALTER system switch logfile is a forced log switch that does not necessarily archive the current redo log file (if an automatic archive is turned on, the redo log before the archive, and if the AutoArchive is not open, the current redo log is not archived.) )
Alter system archive Log current is the archive of the currently redo log files, regardless of whether the AutoArchive is archived or not.
The main difference is:
ALTER SYSTEM switch logfile performs log switching for the current instance in a single-instance database or RAC;
Alter system archive log current performs log switching for all instances in the database.
>2.9 Restart database shutdown Immediate;startup
2.10 Query Archive Information archive log list;
Database changed from non-archive mode to archive mode3. Archive mode database changed to non-archive mode
Changing the database from non-archive mode to archive mode requires the database to be in the Mount state. The following actions apply to versions above oracle10g and not for Oracle8i and 9i. 3.1Close the databaseIf the database is open, you need to close the database first, and if the database is turned off, perform 3.2 steps directly.  Archive the current redo log before closing the database alter system archive log present; Shutdown immediate;
3.2 Start the database to mount state startup Mount;
3.3 Archive information for the database viewed archive log list; or select name, Log_mode from V$database;
3.4 Change the archive mode to non-archive mode ALTER DATABASE noarchivelog;
3.4 Archive information for the database viewed archive log list; or select name, Log_mode from V$database;
3.5 Open the database.
Database changed from archive mode to non-archive mode

ORACLE11G Set archive mode and non-archive mode

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.