Alter system switch logfile in Oracle

I will explain Alter system switch logfile in Oracle in this post.

 

Alter system switch logfile

Online redo log files are files that hold transaction records in the database. Log files to recover the database in case of a problem.

 

 

 

For example, if we shut down the database abruptly (shutdown abort), SMON performs instance recovery by reading these log files during database startup.

There must be at least two online redo log groups in a database and each redo log group must have at least one online redo log member.

When the database is first created, 3 online redo log groups are created by default.

 

Normally Redolog files switch to other redolog file when Current Redolog filled. A log switch occurs when LGWR stops writing to one redo log group and starts writing to another. By default, a log switch occurs automatically when the current redo log file group fills.

 

When the “Current” online redo log group is full, the LGWR process continues to write to the next online redo log group.  When the last online redo log group is full, it continues to overwrite the first redo log group again.

Image result for oracle online redo logs

If you want to force a log switch to make the currently active group inactive and available for redo log maintenance operations. For example, you want to drop the currently active group, but are not able to do so until the group is inactive. You may also wish to force a log switch if the currently active group needs to be archived at a specific time before the members of the group are completely filled. This option is useful in configurations with large redo log files that take a long time to fill.

 

 

You can use the following statement forces a log switch.

ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM ARCHIVE LOG CURRENT;

 

If your database is Cluster ( Oracle RAC ) and you have lots of instances, you want to switch for all logfiles, then run the following command.

 

SQL> ALTER SYSTEM SWITCH ALL LOGFILE; 
System altered.

 

 

Do you want to learn Oracle Database for Beginners, then Click and read the following articles.

Oracle Database Tutorials for Beginners ( Junior Oracle DBA )

 

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

Leave a Reply

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