Steps for setting the database archive Mode

Source: Internet
Author: User
Welcome to the Oracle community forum and interact with 2 million technical staff. 3. Switch between automatic archiving and manual archiving when the instance is running. 1. You can use the archiveloglist command to view the archive method. SQLarchiveloglistDatabaselogmodeArchiveModeAutomaticarchivalEnable

Welcome to the Oracle community forum and interact with 2 million technical staff> go to 3. Switch between automatic archiving and manual archiving when the instance is running. 1. You can use the archive log list command to view the archiving method. SQL archive log list Database log mode Archive Mode archic archival Enable

Welcome to the Oracle community forum and interact with 2 million technical staff> enter

Iii. instance running status, Automatic archiving and manual archiving.

1. You can use the archive log list command to view the archive method,

SQL> archive log list

Database log mode Archive Mode

Automatic archival Enabled

Archive destination/u01/admin/wilson/test

Oldest online log sequence 116

Next log sequence to archive 118

Current log sequence 118

2. How can I change the database to an automatic mode when log_archive_star = false (manually) is started?

Create a file to store archived logs and create the arcdest folder in the/u01/admin/wilson/directory.

Then

SQL> alter system archive log start to '/u01/admin/wilson/archdest ';

System altered.

Now it is automatically archived,

SQL> alter system set log_archive_start = true scope = spfile;

System altered.

The initialization parameter log_archive_start = true is modified. The next restart or dynamic archiving is performed.

3. Change the automatic mode to the manual mode,

SQL> alter system archive log stop;

System altered.

SQL> alter system set log_archive_start = false scope = spfile;

System altered.

It should be noted that in 11g, as long as it is in Archivelog mode, the archive mode is automatic, and there is no automatic archiving or manual conversion.

In archive mode, you must archive a group of online redo logs to a specified place before they are overwritten. Otherwise, the database will be hang there !!!

Iv. Path of the archive file

1. in earlier versions, the location is specified by the log_archive_dest parameter and log_archive_duplex_dest parameter. There are only two locations. They must be used in the database Standard Edition.

2. Currently, you can use the log_archive_dest_n parameter to specify a maximum of 10 (n = 1... 10). It can only be used in enterprise databases.

This section describes log_archive_dest_n

Log_archive_dest_1 = "location =/archive/mandatory"

Log_archive_dest_1 = "location =/archive/optional"

Log_archive_dest_2 = "service = standy_db1"

Location is the local address, and service is the remote network address,

Mandatory indicates that an online redo log file must be archived to this address before it is overwritten,

Optional indicates that an online redo log file can be overwritten even if it is not archived to this address.

3. For the parameter log_archive_min_succeed_dest, as shown in figure

Log_archive_min_succeed_dest = 2 indicates that an online redo log file must be archived to two places before being overwritten.

According to the log_archive_dest_n and log_archive_min_succeed_dest parameters, an online redo log file must be completed before it is overwritten:

(1) All files are successfully written to the archive address with the mandatory parameter.

(2) The successfully archived address must be greater than or equal to the value specified by log_archive_min_succeed_dest.

That is to say, if (1) the number of archived addresses is greater than the value in (2), the value specified in (2) is ignored, and the value (1) prevails. If the value specified in (2) is greater than the value in (1), first (1) all files must be archived successfully, and then the value archived in (2) must be reached.

4. log_archive_dest_state_n can dynamically control whether an archive address is valid.

For example

Log_archive_dest_state_1 = enable indicates that the archive address of log_archive_dest_1 can be used.

Log_archive_dest_state_2 = defer indicates that the archive address of log_archive_dest_2 cannot be used.

Log_archive_dest_state_3 = alternate indicates that the archive address of log_archive_dest_3 cannot be used currently,

It automatically becomes an available address when another address becomes invalid.

5. Format of the archive file name

Log_archive_dest_n specifies the address directory of the archive file, but the actual file name format is set by the log_archive_format parameter.

For example,/u01/admin/wilson/test/wilson _ % t _ % S _ % r. arc

Specifically,/u01/admin/wilson/test is specified by log_archive_dest_n, and wilson _ % t _ % S _ % r. arc is specified by log_archive_format.

(1) % t: thread number, which is displayed as the thread # column in the V $ instance view. It is useful in the RAC database and is 1 in a single instance.

(2) % s or % S: indicates the log switch serial number. This variable ensures that the archived logs in any database are not overwritten. % S indicates that each serial number is the same length, 10 bits, not long enough, and the front is zero.

(3) % r: Scene number. If Incomplete recovery is performed, this variable is very important.

The file name format in 11g must be % s or % S, % t, % r.

[1] [2] [3]

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.