DBA need to configure a location where your Oracle Server can archive your redo logs. There are two ways of doing that. These are –
- Configure the Fast Recovery Area, and
- Configure the Archive log Destination Directory.
Archive Log Destination Directory
Archive log destination directory, As the name suggests is a location which Oracle Uses to save the Archived copies of the Online Redo log files during backup operations.
How To Setup Archive Log Destination Directory.
There are two main parameters that we need to configure to setup Archive log destination directory. These are –
- LOG_ARCHIVE_DEST_n, and
- LOG_ARCHIVE_MIN_SUCCEED_DEST
Log_Archive_Dest_n Parameter
Log_Archive_Dest_n parameter is used to set a location for Archive Log Destination Directory.
Here are a few things about this parameter –
- The prefix n is a number in range of 1 to 10.
- Using LOG_ARCHIVE_DEST_n we can define up to 10 destinations for saving the archived logs. if you have more that one location setup then you will have redundant copies of archive logs created by the Oracle Database server. It will occupy some extra storage space but from backup perspective it’s always better to have multiple backups.
- By default there is no Archive log destination directory setup in Oracle Database. Which means if you want to use one, then you have to set it up first.
- Using LOG_ARCHIVE_DEST_n you can setup a location which could either be a
- Local folder created on your hard drive somewhere on your system.
- A network directory
- A NAS location
- Service Name, if you have a data guard setup.
How To Use Log_Archive_Dest_n Parameter
Step 1: Create a Directory at your prefer location.
[oracle@oracle-db-19c ~]$ mkdir ArchLog
[oracle@oracle-db-19c ~]$ pwd
/home/oracle
[oracle@oracle-db-19c ~]$
Step 2: Issue an ALTER SYSTEM Command
SQL> ALTER SYSTEM SET log_archive_dest_1 = 'location = /home/oracle/ArchLog';
Optional & Mandatory Archive log directory.
Any location set as Archive log directory using LOG_ARCHIVE_DEST_n parameter can either be an Optional or Mandatory location.
By default any location set using LOG_ARCHIVE_DEST_n parameter is always optional.
How To Create Mandatory Archive Log Directory
Creating a Mandatory Archive log directory in Oracle Database is actually very simple. We just have to add the Keyword Mandatory
to the Alter system statement that we wrote previously. Like this –
SQL> ALTER SYSTEM SET log_archive_dest_1 = 'location=/home/oracle/ MANDATORY'
How To Alter LOG_ARCHIVE_MIN_SUCCEED_DEST.
SQL> ALTER SYSTEM SET log_archive_min_succeed_dest = 2;