How to enable oracle in archive and non-archive Modes

Source: Internet
Author: User
Setting Oracle to archive mode and non-archive Mode
Create an archive directory manually and adjust the Oracle startup mode.

Set Oracle to archive Mode

Manually create an archive directory on the master server

$ CD $ oracle_base # The Directory pointed to by $ oracle_base is/opt/Oracle/. For details, see the specific settings of Oracle user environment variables.

$ Mkdir-P oradata/szdb/archive # specify the szdb directory name based on the database Sid. In fact, this directory can be specified arbitrarily.

$ Mkdir-P oradata/szdb/standbyarchive # This directory is created if the master server may act as a backup server

[Oracle @ cqcncdb szdb] $ sqlplus/nolog

SQL> Conn/As sysdba;

Connected.

SQL> startup Mount;

SQL> alter database archivelog;

SQL> archive log start;

SQL> archive log list;

SQL> alter database open;

SQL> alter system set log_archive_dest_1 = 'location =/Oracle/oradata/szdb/archive '; #/Oracle/oradata/szdb/archive must be the same path as the previous mkdir-P oradata/szdb/archive operation.

SQL> alter system set log_archive_format = '% T _ % S. dbf' scope = spfile;

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

Restart the database to make the modification take effect.

SQL> shutdown immediate;

View archiving Mode

SQL> startup

SQL> archive log list;

Database Log mode archive Mode

Automatic Archival Enabled

Archive destination/Oracle/oradata/szdb/archive

Oldest online log sequence 565

Next log sequence to archive 567

Current Log sequence 567

The preceding alter system set operation adds the following parameters to the spfile@sid.ora and init@sid.ora files of the database:

*. Log_archive_dest_1 = 'location =/Oracle/oradata/szdb/archive'

*. Log_archive_format = '% T _ % S. dbf'

*. Log_archive_start = true

Note: The folder defined by *. log_archive_dest_1 must exist and the Oracle user has the write permission.

Note: @ Sid indicates the actual SID number of the database. For example, in this actual operation, the two file names are spfileszdb. ora and initszdb. ora.

If you need to stop the archive mode, use:
Alter database noarchivelog command.
SQL> shutdown immediate;

SQL> startup Mount;

SQL> alter database noarchivelog;

SQL> alter database open;
SQL> 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.