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
- Run the following command on the SQL * Plus prompt to verify the log parameter value:
show parameter log
- 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.
- 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