Oracle Database archive Mode settings

Source: Internet
Author: User
Set 1 sqlgt; archiveloglist; # On the node or local machine to check whether the archive mode is 2 sqlgt; altersystemsetlog_ar

Set 1 sqlgt; archive log list; # Check whether the archive mode is 2 sqlgt; alter system set log_ar

Set on the click node or Local Machine

1 SQL> archive log list; # Check whether archive mode is used

2 SQL> alter system set log_archive_start = true scope = spfile; # enable automatic archiving

SQL> alter system set log_archive_dest_1 = 'location = H: archivelogary' scope = spfile;

# Set archiving Path 1

SQL> alter system set log_archive_dest_2 = 'location = H: archivelogarch2 'scope = spfile;

# Set the archive Path 2. Generally, save Path 2 to another disk.

SQL> alter system set log_archive_format = 'arch _ % d _ % t _ % r _ % s. Log'

# Set the archive log format

3 SQL> shutdown immediate;

4 SQL> startup mount; # Open the control file instead of the data file

5 SQL> alter database archivelog; # Switch the database to archive Mode

6 SQL> alter database open; # open the data file

7. SQL> archive log list; # The archive mode is displayed.

8. query to confirm that the database is in archivelog mode and the archiving process is in progress.

SQL> select log_mode from v $ database;

SQL> select archiver from v $ instance;

9. Perform a log Switch

SQL> alter system switch logfile;

10 This log switch writes the archive to two destinations, namely step H: archivelogar.pdf and H: archivelogarch2 in step 2. If you want to confirm this, run the following query in the Oracle environment:

SQL> select name from v $ archived_log;

Then, check the listed files in the operating system.

2. Set non-archive Mode

1 SQL> archive log list; # Check whether archive mode is used

2 SQL> alter system set log_archive_start = false scope = spfile; # disable automatic archiving

3 SQL> shutdown immediate;

4 SQL> startup mount; # Open the control file instead of the data file

5 SQL> alter database noarchivelog; # Switch the database to non-archive Mode

6 SQL> alter database open; # open the data file

7. SQL> archive log list; # check whether it is in non-archive mode.

3. Archive commands

Archive log stop;

Archive log start;

Archive log list;

Show parameters;

Show parameters log_archive_start;

Show parameters log_archive_max_process; # Number of archiving processes

Alter system set log_archive_max_process = 5; # change the number of archiving processes to 5

Select * from v $ bgprocess; # view background processes

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.