Saturday, January 23, 2016

How to enable/disable Archivelog mode in Oracle?

There are two types of logging modes in Oracle database :


ARCHIVELOG : In this type of logging whatever oracle writes in a redo log file related to transactions in database, saved to another location after a log file has been filled . This location is called Archive location. if database is in Archive log mode then in case of any disaster, we can recover our database upto the last commit and user don't have to reenter their data. Until a redo log file is not written to the Archive location it cannot be reused by oracle to write redo related data.
NOARCHIVELOG : In this type of logging whatever oracle writes in a redo log file related to transactions in database must be overwritten when all the log files have been filled. In this type of logging we can recover our database upto the last consistent backup we have with us, after that users have to reenter their data.
How to check log mode
SQL> archive log list
How to enable ARCHIVELOG mode
SQL> shut immediate;
SQL> startup mount
SQL> alter database archivelog;
SQL> alter database open;
How to disable ARCHIVELOG mode
SQL> shut immediate
SQL> startup mount
SQL> alter database noarchivelog;
SQL> alter database open;
SQL> archive log list


No comments: