Oracle Database-level drop redolog is not dangerous

Source: Internet
Author: User

Oracle Database-level drop redolog is not dangerous. Some DBAs are afraid to delete the redo log in the production database, because they are worried that deleting the redolog group in the ACTIVE and ACITVE status will cause a database accident. In fact, if the redo logs in the CURRENT and ACTIVE statuses are deleted from the database, they cannot be deleted. Therefore, you can safely delete the redo logs from the database. However, if you delete (rm) directly at the operating system layer of the Unix/Linux platform, ORACLE cannot perform the check, if the redo log in the CURRENT or ACTIVE State is directly deleted at the operating system level, it will lead to an accident and be very careful. Perform a REDOLOG test at the ORACLE database level with the deletion status of CURRENT and ACTIVE: 1. view the redo log status.

SQL>select group#,thread#,archived,status from v$log;GROUP#THREAD#ARCHIVEDSTATUS11NOINACTIVE21NOACTIVE31NOCURRENT41NOACTIVE

 

The above GROUP 3 status is CURRENT and GROUP2/GROUP4 is active. Now we will perform the delete test on the redolog group in the CURRENT status and ACTIVE status respectively. 2. Delete the group in the CURRENT status #3.
SQL> alter database drop logfile group3;alter database drop logfile group 3*ERROR at line 1:ORA-01623: log 3 is current log forinstance litest (thread 1) - cannot dropORA-00312: online log 3 thread 1:'/dba/oracle/oradata/litest/redo03.log'

 

3. delete an ACTIVE group #2
SQL> alter database drop logfile group2;alter database drop logfile group 2*ERROR at line 1:ORA-01624: log 2 needed for crash recoveryof instance litest (thread 1)ORA-00312: online log 2 thread 1:'/dba/oracle/oradata/litest/redo02.log'

 

4. Summary (1) when the redolog group in the CURRENT State is deleted, the system will prompt that it is the CURRENT log and cannot be deleted (2) when the redolog group in the ACTIVE state is deleted, this log is required for instance recovery and cannot be deleted.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.