How to configure oracle 12c database in archivelog mode

Connect database as sys user to configure it in archivelog mode.

[oracle@12c ~]$ sqlplus “/ as sysdba”

// Archive log list: Database is in ‘No Archive Mode’.

SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /u01/app/oracle/arch
Oldest online log sequence 140
Current log sequence 142

// Shutdown database:

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

// Startup your database in mount state:

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1503199232 bytes
Fixed Size 2288584 bytes
Variable Size 905970744 bytes
Database Buffers 587202560 bytes
Redo Buffers 7737344 bytes
Database mounted.

// Configure your database in archivelog mode by issue the following:

SQL> alter database archivelog;

Database altered.

// Alter database in open mode:

SQL> alter database open;

Database altered.

SQL> select open_mode from v$database;

OPEN_MODE
——————–
READ WRITE

// Database has been successfully configured in archive log mode. Issue the following:

SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/arch
Oldest online log sequence 142
Next log sequence to archive 144
Current log sequence 144

 

***********************************************************************

Note: Please don’t hesitate to revert in case of any query OR feedback.

Thanking you.

Have a easy life ahead.

8 thoughts on “How to configure oracle 12c database in archivelog mode

    • Thanks Divya for writing.
      You can’t configure single or multiple pluggable database in archive log mode, only container database can be configured in archive log mode.

  1. I think you did a great job, but I would suggest that you add the following:

    Do a check to see if the database is in archivelog mode.
    sql> select log_mode from v$database;

    Then do some setting of the location of archivelogs.
    You can check this v$parameter

    Then set it to use the location that you want.
    You can choose to use db_file_dest or just the log_archive_dest — It depends on how you are going to manage your archivelogs and how much space you have.

    I will demonstrate how to use db_file_dest — This can be kind of tricky and at first I didn’t like it. If you use RMAN to do backups, then it is a great way to clean up archive logs also.

    select * from v$parameter
    where upper(name) = upper(‘db_recovery_file_dest_size’);
    alter system set log_archive_dest_1=’LOCATION=USE_DB_RECOVERY_FILE_DEST’ scope = both;
    alter system set db_recovery_file_dest=’G:ORACLEfast_recovery_area’ scope=both;
    alter system set db_recovery_file_dest_size=130G scope=both;

    Then stick in here what you originally had, because it was perfect.

    Shutdown and startup the database
    SQL> shutdown immediate;
    SQL> startup mount;
    SQL> alter database archivelog;
    SQL> alter database open;
    SQL> SELECT OPEN_MODE FROM v$database; — to see if what mode the database is in

    SQL> archive log list

    Cheers,
    Michael Nelson

  2. can’t we set archive log mode enable for one particular pluggable database rather than for whole container database

    • Thank you Mahesh fro writing.
      You can’t put the particular pluggable database in archivelog mode, but you can perform recovery for particular pluggable database by putting the container database in archivelog mode.

Leave a Reply

%d bloggers like this: