Definition and modification of Oracle archive Mode

Source: Internet
Author: User

I. significance:

We know that the database has at least two sets of online log files, which are recycled.
The archive mode stores a copy of the file before the online log file is repeatedly reused (overwritten) to other locations, so that we keep all the modification log records of the database in history, it makes sense for database recovery.

Ii. Modify the archive Mode

First, you can use the following statement to view the existing database mode:
Select name, log_mode from v $ database;
You can also use the following statement
Archive log list; (This method requires the as sysdba)

To archive a non-archive database, follow these steps:
1. SQL> alter system set log_archive_dest_1 = 'location =/oracle/oracle10g/log/archive_log ';
This statement determines the path of the archived log. In fact, Oracle 10 Gb can generate multiple identical logs and store multiple locations to prevent unexpected logs.

For example, you can use the following statement to add another log location:
SQL> alter system set log_archive_dest_2 = 'location =/oracle/oracle10g/log2/archive_log ';

2. Shut down the database
SQL> shutdown immediate

3. Start the data mount status:
SQL> startup mount;

4. Change the database to archive mode:
SQL> alter database archivelog;

5. Open the database and query:
SQL> alter database open;

Modify the log file name format:
SQL> alter system set log_archive_max_processes = 5;
SQL> alter system set log_archive_format = "archive _ % t _ % s _ % r. log" scope = spfile;

After modification, you can check whether the log mode has been modified successfully!

In particular, you must modify the log_archive_start = true parameter in Oracle 9i to take effect. This parameter has been abolished in oracle 10g, so you do not need to set this parameter.
--------------------------------
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 1258291200 bytes
Fixed Size 1978336 bytes
Variable Size 318771232 bytes
Database Buffers 922746880 bytes
Redo Buffers 14794752 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

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.