Enable Archivelog on Oracle database 12R2

This article explains the steps to enable the archivelog process on Oracle database 12c Release 2.

Install Step by Step Oracle database 12R2 on Oracle Linux 7

Tables of contents:

  1. Set the ORACLE_HOME and ORACLE_SID
  2. Check the Archivelog Status
  3. Enable the Archive Log

1. Set the ORACLE_HOME and ORACLE_SID

To set the Oracle Envirement, you should set:

Method 1:

  • ORACLE_HOME=/home/oracle/app/oracle/product/12.2.0/dbhome_1
  • ORACLE_SID=orcl
  • PATH=$ORACLE_HOME/bin:$PATH

Method 2:

  •  Use the script ORAENV
[oracle@ol-7u4 ~]$ . oraenv
ORACLE_SID = [oracle] ? orcl
The Oracle base has been set to /home/oracle/app/oracle
[oracle@ol-7u4 ~]$

2. Check the Archivelog Status

Step 1: To check the database archive log mode is enable or not:

SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 1
Current log sequence 2

Step 2: Check the destination:

SQL> show parameter DB_RECOVERY_FILE_DEST
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /home/oracle/app/oracle/fast_recovery_area/orcl
db_recovery_file_dest_size big integer 12780M

3. Enable the Archive Log:

Step 1: Shutdown the database with global checkpoint.

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

Step 2: Start the database at the mount status

SQL> startup mount
ORACLE instance started.
Total System Global Area 838860800 bytes
Fixed Size 8798312 bytes
Variable Size 616566680 bytes
Database Buffers 205520896 bytes
Redo Buffers 7974912 bytes
Database mounted.
SQL>

 

Step 3: Enable the Archive log and Othe the database

SQL> alter database archivelog;
Database altered.

SQL> alter database open;
Database altered.

Step 4: Check the archive logsmode:

SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 1
Next log sequence to archive 2
Current log sequence 2

 

Conclusion:

The steps to enable the archive log in Oracle database 12c release 2 is the same steps as all Oracle version 10g, 11g and 12cR1.

 

Bookmark the permalink.
Loading Facebook Comments ...

Leave a Reply