ACTIVE log corruption (archived)

Source: Internet
Author: User

Archive ModeActiveLog corruption

ActiveIndicates that the log has been switched and may have been archived. It may also indicate that the dirty blocks in the log have not been archived.DBWRWrite Disk

View archiving path

SQL>Show parameter recovery

 

NAME TYPE VALUE

-----------------------------------------------------------------------------

Db_recovery_file_dest string/u01/tiger/flash_recovery_area

Db_recovery_file_dest_size big integer 2G

Recovery_parallelism integer 0

If you create a databaseUnusedStatus

SQL> select * from v $ log;

 

GROUP # THREAD # SEQUENCE # bytes members arc status FIRST_CHANGE # FIRST_TIM

-------------------------------------------------------------------------------------------

1 1 2 52428800 1 no current 452423 07-SEP-12

2 1 0 52428800 1 YESUNUSED0

3 1 1 52428800 1 yes inactive 446075 07-SEP-12

First, view the log status and corresponding log files

SQL> select * from v $ logfile;

 

GROUP # status type member is _

-------------------------------------------------------------------

3 ONLINE/u01/tiger/oradata/orcl/redo03.log NO

2 ONLINE/u01/tiger/oradata/orcl/redo02.log NO

1 ONLINE/u01/tiger/oradata/orcl/redo01.log NO

 

SQL> select * from v $ log;

 

GROUP # THREAD # SEQUENCE # bytes members arc status FIRST_CHANGE # FIRST_TIM

-------------------------------------------------------------------------------------------

1 1 2 52428800 1 yes active 460765 07-SEP-12

2 1 3 52428800 1 no current 460767 07-SEP-12

3 1 1 52428800 1 yes active 459268 07-SEP-12

Second, damage logs for testing

SQL>! Cp/etc/passwd/u01/tiger/oradata/orcl/redo01.log

SQL> conn/as sysdba

Connected.

SQL> shut abort

Oracle instance shut down.

SQL> startup

ORACLE instance started.

 

Total System Global Area 314572800 bytes

Fixed Size 1219136 bytes

Variable Size 104859072 bytes

Database Buffers 201326592 bytes

Redo Buffers 7168000 bytes

Database mounted.

ORA-00313: open failed for members of loggroup 1 of thread 1

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

ORA-27046: file size is not a multiple oflogical block size

Additional information: 1

 

Third recovery log

SQL>Alter database clear logfile group 1;

Alter database clear logfile group 1

*

ERROR at line 1:

ORA-01624: log 1 needed for crash recovery of instance orcl (thread 1)

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

------When we clean the log group, we find that the log group is required for Vision restoration.1Therefore, the data cannot be cleaned.

SQL> select * from v $ log;

 

GROUP # THREAD # SEQUENCE # bytes members arc status FIRST_CHANGE # FIRST_TIM

-------------------------------------------------------------------------------------------

 1 1 2 52428800 1 yes active 460765 07-SEP-12

3 1 1 52428800 1 yes active 459268 07-SEP-12

2 1 3 52428800 1 no current 460767 07-SEP-12

------Check the status of the log group.ActiveDamaged

SQL> recover database;

ORA-00283: recovery session canceled due toerrors

ORA-00313:Open failed for members of log group 1 ofthread 1

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

ORA-27046: file size is not a multiple oflogical block size

Additional information: 1

------When the log group is restored1OfRedo01.dbfAn error occurred while enabling the format.

Because there is an archive, but the data is not considered to need to be archived for this restoration, We can manually provide an archive

SQL> recover database until cancel;

ORA-00279: change 460765 generated at09/07/2012 13:32:38 needed for thread 1

ORA-00289: suggestion:/u01/tiger/flash_recovery_area/ORCL/archivelog/2012_09_07/o1_mf_1_2 _ % u _. arc

ORA-00280: change 460765 for thread 1 is insequence #2

 

 

Specify log: {<RET> = suggested | filename | AUTO | CANCEL}

 

ORA-00279: change 460767 generated at09/07/2012 13:32:40 needed for thread 1

ORA-00289: suggestion:/u01/tiger/flash_recovery_area/ORCL/archivelog/2012_09_07/o1_mf_1_3 _ % u _. arc

ORA-00280: change 460767 for thread 1 is insequence #3

ORA-00278: log file '/u01/tiger/flash_recovery_area/ORCL/archivelog/2012_09_07/o1_mf_1_2_84m1qrxr _. arc'No longer neededfor this recovery

 

------ 2File No. We didn't use it becauseRecover databasThe application was applied during recovery.2The log file corresponds to the third group, and the next one is3Log File is actuallyCurrentLogs have crashed before they can be switched, so there is no archiving. We provide onlineCurrentLogs. Our online logs are the log files in the second group.

Specify log: {<RET> = suggested | filename | AUTO | CANCEL}

/U01/tiger/oradata/orcl/redo02.log

Log applied.

Media recovery complete.

SQL> alter database open;

Alter database open

*

ERROR at line 1:

The ORA-01589: must use RESETLOGS orNORESETLOGS option for database open

 

 

SQL>Alter database open resetlogs;

 

Database altered.

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.