Restoration of active or current log files lost in Oracle

Source: Internet
Author: User

Activity loss or recovery of the Current Log File
Oracle ensures that data submitted successfully is not lost through the log file, but in the case of a fault, the user may lose the current log file. this can be divided into two situations: data is shut down normally at this time and the database is shut down abnormally at this time.
1. When the current log is lost, the database is shut down normally.
Before shutting down the database, oracle performs a full checkpoint. The current log is no longer needed during instance recovery.
The following is a test (the database runs in non-archive mode). in oracle9i and later versions, the current log cannot be cleared. You need to use until cancel to restore it and then open it in resetlogs mode.
[Oracle @ jingyong ~] $ Sqlplus/as sysdba
SQL * Plus: Release 10.2.0.1.0-Production on Mon Jan 7 00:39:59 2013

Copyright (c) 1982,200 5, Oracle. All rights reserved.


Connected:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production
With the Partitioning, OLAP and Data Mining options

SQL> select * from v $ version where rownum <2;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Prod

SQL> select * from v $ logfile;

GROUP # STATUS TYPE
------------------------
MEMBER
--------------------------------------------------------------------------------
IS _
---
3 ONLINE
/U01/app/oracle/product/10.2.0/oradata/jingyong/redo03.log
NO

2 ONLINE
/U01/app/oracle/product/10.2.0/oradata/jingyong/redo02.log
NO

GROUP # STATUS TYPE
------------------------
MEMBER
--------------------------------------------------------------------------------
IS _
---

1 ONLINE
/U01/app/oracle/product/10.2.0/oradata/jingyong/redo01.log
NO


SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL>! Mv/u01/app/oracle/product/10.2.0/oradata/jingyong/redo */u01/app/oracle

SQL> startup
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 62916852 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes
Database mounted.
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1:
'/U01/app/oracle/product/10.2.0/oradata/jingyong/redo01.log'


SQL> alter database clear logfile group 1;

Database altered.

SQL> alter database clear logfile group 2;

Database altered.

SQL> alter database clear logfile group 3;
Alter database clear logfile group 3
*
ERROR at line 1:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1:
'/U01/app/oracle/product/10.2.0/oradata/jingyong/redo03.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3


SQL> select * from v $ log;

GROUP # THREAD # SEQUENCE # BYTES MEMBERS ARC STATUS
---------------------------------------------------------------------
FIRST_CHANGE # FIRST_TIME
-------------------------
1 1 0 52428800 1 NO UNUSED
0 06-JAN-13

3 1 0 52428800 1 NO CLEARING_CURRENT
914164 06-JAN-13

2 1 0 52428800 1 NO UNUSED
914157 06-JAN-13


SQL> recover database until cancel;
Media recovery complete.

SQL> alter database open resetlogs;

Database altered.

SQL>

  • 1
  • 2
  • 3
  • 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.