Oracle database technologies are considered as the world's most robust, complex as well as a flexible database. So it is impossible anyone to master Oracle Database and Reporting Services without a mentor. However, mentors may also face a problem while working with Oracle. Generally, developers may come across such a situation, when they need to force a log switch for a proper backup's facility. While working with Oracle, one may get to know about two ways used to enforce a logfile switch. Those two ways are Alter system switch logfile and Alter system archivelog current. Comparative Analysis Now, everyone would be excited to know about the difference between both the methods and when to use these Oracle database technologies. The answer is a “Yes”! As both ways force a log switch, but is different in the method of enforcement. However, both the mode's shares similarity in writing a quiesce checkpoint. It is the confirm place for last redo log that is considered as the part of hot backup. Both the switch logfile and archivelog current write a quiesce checkpoint, a firm place whereby that last redo log is a part of the hot backup. However, the process involved in it is quite different one. Archivelog current stays behind until the write up gets complete as the process requires maximum for multi-gigabyte to redo logs in the Database and Reporting Services. Whereas, Alter system switch logfile fast returns the control back within a fraction of second, meanwhile Alter system archivelog current get paused. Moreover, the “switch logfile” command ARCH to process the copying task of the “old” redo log file to the redo log file system. Major difference : Now, let's discuss about the major differences between switch logfile and archivelog current that are listed as below: RAC : If RAC is running, then Alter system archivelog current switches the logs available instantly on the RAC nodes. Whereas, Alter system switch logfile switch the logfile after issue of the switch command on the instance. So, it can be concluded that Alter system archivelog current will be a better practice for a RAC system. ALTER SYSTEM SWITCH LOGFILE : It is asynchronous command that can fastly return to invoked program due to writing of the redo log to the OS file system. It comprises of a small risk when ARCH process cannot completely redo log writing. For e.g. when the OS archivelog file directory remains out of pace. Moreover, it can even prove to be risky when calling script moves to subsequent step assuming the writing of redo command. In few cases, scripts may stick to the “SLEEP 60” command present in the backup script that allots time for complete redo writing. This is why it is not considered as a best practice. ALTER SYSTEM ARCHIVELOG CURRENT : It is a synchronous command that returns faster because it waits until the completion of online writing of redo log to the file system. It is safer means as it waits for OS to acknowledge the redo log that has been successfully accomplished. Hence, it evaluated as the best practice for productive backup scripts with RMAN command. Argument required : The Alter system archivelog current allows specification of the thread to archive, whereas Alter system switch logfile archives the current thread. In case, one do not pass on the thread parameter, then Oracle database technologies would be archiving the complete online redo logs.
Related Articles -
Oracle, Oracle technologies, Oracle database technologies, Oracle technology solutions, Database and reporting services,
|