How Archive log mode in oracle enable


How to enable Archive log mode in oracle

 Enabling of archive log mode in oracle  database is necessary to enable  most of the high availability features of oracle.If we enable this mode redo log files which store the log record of frequently change occurred in the database will be archived.
RMAN,redo logs files are  used archivelog for their operation.
To enable Archivelog file is very simple. connect the database in mounted mode and it should be not open state.Then alter the database in archivelog mode.

Redo log files are very essential file to recover oracle database in case oracle instance crashes  by any reason. Now in oracle database many redo log files are created a group.

Redo group is very important while archiving redo log files.suppose group 2 is current that means oracle uses these redo log files which present in group 2 and archive process then archiving redo log files from other group.for that reason database performance is not degraded.


To view the archivelog mode in oracle 

First we have to check the log_mode of the database,is it archivelog mode or not.To run the below command we find the database is set to no archivelog mode. you can run both the command to view the log mode of the database.
SQL> select log_mode from v$database;

LOG_MODE
------------

NOARCHIVELOG

 or
SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     18
Current log sequence           20


Shutdown database


After checking the log mode we shutdown the database to perform rest of the work.To shutdown the database we run the below command on the sql promt.


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

Startup database in mount mode


 Now we can startup the database in mount mode and alter it in archivelog mode.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 2071076864 bytes
Fixed Size                  2214896 bytes
Variable Size            1291846672 bytes
Database Buffers          771751936 bytes
Redo Buffers                5263360 bytes
Database mounted.

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.



We alter the database in archivelog mode by using the command “alter database archivelog”. oracle don’t give us privilege to do the operation unless we start the database in mount mode and also in open state. After alter the database in archivelog mode we alter the database using “alter database open” command.

Now it is the time to verify that the log_mode of the database.we rrun the below command to do this.
  

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


Archive log mode in oracle
Archivelog-oracle-database


In this tutorial we have learned what is archivelog mode and how to enable Archivelog mode in oracle database .
SHARE

Admin

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

1 comments: