Oracle Enable Automatic Log Archiving

Source: Internet
Author: User

To configure automatic archiving for the database (if you configure Oracle installation to use PFILE), add the following log parameter lines to the INIT (SID). ORA file in the $ ORACLE_HOME/dbs directory:

LOG_ARCHIVE_START = TRUE LOG_ARCHIVE_DEST = <archive log directory> LOG_ARCHIVE_FORMAT = % t _ % s. dbf

Some log parameters include:

  • LOG_ARCHIVE_START -- enable automatic archiving
  • LOG_ARCHIVE_DEST -- specifies the path of the archived redo log file. The Oracle proxy queries the Oracle server parameters of the archive log target in the following order: LOG_ARCHIV_DEST, LOG_ARCHIVE_DEST_1 to LOG_ARCHIVE_DEST_10. The proxy backs up archived logs from the first local destination it finds.
  • LOG_ARCHIVE_FORMAT -- specify the file name format of the archived redo log file. % S is used to specify the log serial number and % T to specify the thread number. For example, ARC % S. % T is acceptable.

    Important! Use a delimiter between values. For example, % S. % T. If the Delimiter is omitted, the log file name cannot be parsed because it cannot determine which part is % S and which part is % T. In addition, you may accidentally create multiple archived logs with the same name.

Enable automatic archiving for Oracle installation using SPFILE

  1. Run the following command on the SQL * Plus prompt to verify the log parameter value:
    show parameter log
  2. If the parameter value is incorrect, after the server is shut down, enter the following command at the SQL * Plus prompt to change the parameter values:
    CONNECT SYS/SYS_PASSWORD AS SYSDBA
    STARTUP MOUNT EXCLUSIVE
    ALTER SYSTEM SET LOG_ARCHIVE_START = TRUE SCOPE = SPFILE; ALTER SYSTEM SET LOG_ARCHIVE_DEST="/opt/Oracle/oradata/ORCL/archive" SCOPE = SPFILE; ALTER SYSTEM SET LOG_ARCHIVE_FORMAT="ARC%S.%T" SCOPE = SPFILE;

    Note: The actual value of LOG_ARCHIVE_DEST is specific to your environment.

  3. Restart the Oracle instance for the change to take effect.

Use archiveLOGList; command to check whether archiving is enabled

Output result

Database Log mode non-archive Mode
Enable automatic archiving
Archive end point F: \ oracle \ ora92 \ RDBMS
The earliest Summary log sequence 63
Current Log sequence 65

You can also use the command: alter system archive log start to enable

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.