Home / Oracle DBA / ARCHIVED REDO LOGFILE MANAGEMENT

ARCHIVED REDO LOGFILE MANAGEMENT

ARCHIVELOG MANAGEMENT:

A database has ARCHIVELOG and NOARCHIVELOG modes. We can can query “archive log list” to know your database archive log mode. When the database is in NOARCHIVELOG mode, redo log files will get overwritten each time all the redo groups are switched and we cannot have backups of those redo logs. Hence, we use ARCHIVELOG mode, where each logfile gets archived as backups before log writer (LGWR) overwrites the logfile. When the database is ARCHIVELOG mode, we can assure complete recovery using archived log files.

Switching ARCHIVELOG and NOARCHIVELOG modes

Use below commands to switch database to ARCHIVELOG or NOARCHIVELOG mode. Remember that, we need to open database in mount stage to change the archivelog mode as we cannot change it when the database is open.

To check database current mode:

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

To switch the database to NOARCHIVELOG mode:

SQL> shutdown;
SQL> startup mount;
SQL> alter database noarchivelog;
SQL> alter database open;

To switch the database to ARCHIVELOG mode:

SQL> shutdown;
SQL> startup mount;
SQL> alter database archivelog;
SQL> alter database open;

To enable automatic archiving of redo logs set log_archive_start=true in init.ora file.

To enable automatic archiving after instance startup:

SQL> alter system archive log start;

To switch the logs:

SQL> alter system switch logfile;

Destination of archive logs:

SQL> log_archive_dest=/dir/

To change the destination of archive files shutdown the instance, change the parm in init.ora and then restart the instance

Format of archive file names:
log_archive_format=arch%t_%s.arc
%s is the sequence number
%t is the thread number

DON’T MISS OUT!
Subscribe To Newsletter
Be the first to get latest updates and exclusive content straight to your email inbox.
Stay Updated
Give it a try, you can unsubscribe anytime.

Check Also

How to perform RMAN cloning (Easy process to clone a database on different server)

Cloning is a process of making a separate copy from one database to another. Cloning …

Leave a Reply

Your email address will not be published. Required fields are marked *

DON’T MISS OUT!
Subscribe To Newsletter
Be the first to get latest updates and exclusive content straight to your email inbox.
Stay Updated
Give it a try, you can unsubscribe anytime.
close-link
GET OUR LATEST CONTENT IN YOUR INBOX

SUBSCRIBE 
Your information will never be shared
close-link
Enquiry
Submit
close-link
Sign-up for exclusive content. Be the first to hear about DBA Centre Blogs.
Subscribe