How to deal with Oracle lost log (redoxx_xx) files

Source: Internet
Author: User

The test Department reported that the Intranet 1.105Oracle database service could not be started, or opened the alter _ <sid>. log file in a regular manner to view the log Content:

Fri Nov 11 11:46:09 2011
Errors in file/u01/app/oracle/admin/center/bdump/center_lgwr_3016.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u02/oradata/center/redo02_1.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 2 thread 1: '/u02/oradata/center/redo02.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory


The log content clearly indicates that the log file redo02.log' redo02 _ 1.logof group 2 cannot be found when the database is started. Therefore:

Cd/u02/oradata/center


Ls

If the error log file cannot be found in this directory, identify the cause of the problem and handle it accordingly:

If the redo log is damaged, deleted or lost by mistake, the database cannot be completely restored, and the transaction data in the current redo log will be lost.

The restoration method must be based on the loss of the redo log group and the current status in the database.


First, check the status of the redo log file to see the status of the log file.


SQL> select * from v $ log;
SQL> select * from v $ logfile;

For: recovery of lost non-active log files, INACTIVE log files refer to the lost Log File Group in the "INACTIVE" status. This indicates that the log group has completed the checkpoint and the log files are lost,

The database will not lose data, but it cannot be ignored. www.bkjia.com will encounter errors when logs are switched to this log group.

The main methods include method 1, method 2, and method 3.

Method 1: regenerate the redo log file group


You can directly Delete the lost redo log file groups. However, after deletion, you must ensure that the number of redo log groups in the database cannot be less than two.

Delete the redo log file group:

SQL> alter database drop logfile group 1;

Database altered.

Add a redo log file group:

SQL> alter database add logfile group 1 ('/u01/oradata/orcl/redo1.log','/u01/oradata/orcl/redo01.log') size 500 m;

Database altered.

Method 2: Add a redo log file member and delete the lost log file.

Add REDO files of the same size to the lost REDO log group and delete the lost MEMBER.

Add redo log file members:

SQL> alterdatabase add logfile member '/u01/oradata/orcl/redo01.log' to group 1;

Databasealtered.

Delete the lost log file:

SQL> alterdatabase drop logfile member '/u01/oradata/orcl/redo1.log ';

Database altered.

This method is only suitable for the loss of at least one member in the file group is available, if the lost Log File belongs to the file group only this file, then this method is not suitable.

An error occurs when adding a log file:

SQL> alterdatabase add logfile member '/u01/oradata1/redo1.log' to group 1;

Alter databaseadd logfile member '/u01/oradata1/redo01.log' to group 1

*

ERROR at line 1:

ORA-00313: openfailed for members of log group 1 of thread 1

ORA-00312: online log 1 thread 1: '/u01/oradata/orcl/redo01.log'

ORA-27037: unable to obtain file status

Linux Error: 2: No such file or directory

Additionalinformation: 3

  • 1
  • 2
  • Next Page

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.