ORA-1578 / ORA-26040&n…
2017-05-02 11:02
676 查看
当使用rman恢复数据库后,发现读取某些表报ORA-1578 / ORA-26040的错误,原因及解决方法如下
ORA-1578 / ORA-26040 Corrupt blocks by NOLOGGING - Error explanation and solution (文档 ID 794505.1) | 转到底部 |
In this Document
Applies to:Oracle Database - Enterprise Edition - Version 7.1.6.0 to 12.1.0.2[Release 7.1.6 to 12.1] Information in this document applies to any platform. PurposeThis note is intended to describe how Oracle reports acorruption caused by a NOLOGGING operation and how to fix the errors. ScopeThis document is intended for Customers and Oracle Support.DetailsWhen a segment is defined with the NOLOGGING attribute and if aNOLOGGING/UNRECOVERABLE operation updates the segment, the online redo log file is updated with minimal information to invalidate the affected blocks when a RECOVERY is later performed. If the associated redo/archived log file is used to RECOVER the data files, Oracle invalidates such blocks and the error ORA-26040 along with error ORA-1578 are reported by SQL statements in the next block reads. Errors Example: SQL> select * from test_nologging; ORA-01578: ORACLE data block corrupted (file # 11, block # 84) ORA-01110: data file 4: '/oradata/users.dbf' ORA-26040: Data block was loaded using the NOLOGGING option The NOLOGGING attribute is stored in column LOGGING in data dictionary views like: DBA_TABLES, DBA_INDEXES, DBA_LOBS, DBA_TAB_PARTITIONS, DBA_LOB_PARTITIONS, DBA_TAB_SUBPARTITIONS, etc. LOGGING='NO' indicates NOLOGGING. The block is then marked as Soft Corrupt meaning that the next block read will report the ORA-1578/ORA-26040 errors. RMAN/DBV and Corrupt Blocks by NOLOGGINGDBV prints the generic message DBV-200 in rdbms versions lowerthan 10.2.0.4 and error DBV-201 in RDBMS versions greater or equal to 10.2.0.4 Doc ID 5031712.8: DBV-00200: Block, dba 46137428, already marked corrupted DBV-00201: Block, DBA 46137428, marked corrupt for invalid redo application In rdbms versions lower than 10.2.0.5 and 11.1.0.7, RMAN validate reports it with a generic message like: 10.2.0.4 and lower, 11.1.0.6, 11.1.0.7: RMAN validate reports it in v$database_block_corruption with CORRUPTION_TYPE=LOGICAL In rdbms version 10.2.0.5 or in 11.2.0.1 and forward, RMAN has been enhanced to report it in with CORRUPTION_TYPE=NOLOGGING. Reference Doc ID 7396077.8 : 10.2.0.5 and 11.2.0.1+: RMAN validate reports it in v$database_block_corruption with CORRUPTION_TYPE=NOLOGGING In rdbms version 12c and forward RMAN validate no longer populates view v$database_block_corruption; instead the new view v$nonlogged_block is updated: 12c: RMAN validate reports it in v$nonlogged_block RMAN backups do not fail due to NOLOGGING corrupt blocks. In general RMAN does not fails with soft corrupt blocks so the MAXCORRUPT clause is not necessary in such cases. In such cases the backup will contain the soft corrupt block and a restore will leave the corruption as when the backup was made. When there is a generic message besides the error ORA-26040, a block dump might be taken and see if the byte 0xff is along the block or if the block is associated to a segment, try to read it with a SQL statement for which errors ORA-1578/ORA-26040 will be produced as the block is corrupt due to recovery with a NOLOGGING operation. Monitoring NOLOGGING OperationsV$DATAFILE has several columns that are updated when a NOLOGGINGoperation takes place when parameter db_unrecoverable_scn_tracking is set to true (default value); db_unrecoverable_scn_tracking is not available in 10g. Reference the next V$DATAFILE columns in our Oracle Database Reference Documentation: UNRECOVERABLE_CHANGE# UNRECOVERABLE_TIME FIRST_NONLOGGED_SCN FIRST_NONLOGGED_TIME Identify when a block was marked asTo identify when a block was marked as NOLOGGING, use the block |
RDBMS Version | Change |
---|---|
10.2.0.4+ | DBverify reports a NOLOGGING block with error "DBV-00201: Block, DBA , marked corrupt for invalid redo application" |
10.2.0.5, 10.2.0.1+ | RMAN validate reports the NOLOGGING block in v$database_block_coruption with corruption_type='NOLOGGING' |
11g+ | Parameter db_unrecoverable_scn_tracking is introduced. |
11.1.0.6 or 11.1.0.7 or 11.2.0.1 | ORA-1578 and ORA-26040 can be produced due to NOLOGGING for DIRECT PATH operations after a manual RECOVER DATABASE in a NOARCHIVELOG mode database even if FORCE LOGGING is enabled. The restriction has been lifted in 11.2.0.2+ and problem did not happen in 10g. |
12c | RMAN validate no longer populates view v$database_block_corruption; instead the new view v$nonlogged_block is updated |
SOLUTION
Note that the data inside the affected blocks is not salvageable.Methods like "Media Recovery" or "RMAN blockrecover" will not fix
the problem unless the data file was backed up after the NOLOGGING
operation was registered in the Redo Log.
Is error after RMAN DUPLICATE?
If the error is after a RMANDUPLICATE or RESTORE, enable FORCE LOGGING at SOURCE
database and perform the DUPLICATE or RESTORE (after new BACKUP)
steps again:
alter database force logging;
Is error produced in a PHYSICAL STANDBY Database?
If the error is produced in aPHYSICAL STANDBY database, the option is to
restore the affected file from the PRIMARY database (only if the
problem is not present in the PRIMARY) and to avoid the problem
from being introduced there is the option to force logging in the
PRIMARY database with:
alter database force logging;
In order to resolve the errors and if it is not an INDEX the
segment can be recovered from a backup like an export dump or from
another source. If backups are not available the segment might be
recreated following the next steps:
Identify the affected segment
Identify the affectedsegment as described in
Doc ID 819533.1 or identify all the corrupt objects as
described in
Doc ID 472231.1, then:
[b]Is it a FREE Block?[/b]
If the NOLOGGING Block is a
FREE Block (the associated extent is in
dba_free_space), which could be discovered by running DBVerify with
error DBV-00201 or shown in view v$database_block_corruption, there
is the option to wait until the block is reused which will
automatically re-format the block or force re-formatting the block
using
Doc ID 336133.1
[b]Is it an INDEX?[/b]
If it is an INDEX,
drop and create the index
[b]Is it a TABLE?[/b]
If it is a TABLE,
procedure DBMS_REPAIR.SKIP_CORRUPT_BLOCKS can be used to skip the
corrupt block in SQL statements;
Doc ID 556733.1 has a DBMS_REPAIR example.
Then decide to re-create the segment:
by moving the table: alter table
&table_name move;
OR
by saving the data (export, Create
Table as Select, etc) and then truncate or drop/create.
[b]Is it a LOB?[/b]
If it is a LOB use
Doc ID 293515.1
相关文章推荐
- oracle-12c-rac 报:ORA-01078
- ASCP刷快照报错 ORA-27477: "SYS.I…
- ORA-22992: cannot use&…
- 错误:ORA-28002: the …
- ORA-00922:missing or i…
- import dump with error ORA-600[K…
- ORA-1652: Unable To&nb…
- ORA-12528: TNS: 监听程序: 所有适…
- ORA-19909: datafile string belon…
- ORA-00202: 控制文件
- ORA-00494: enqueue [CF…
- ORA-00245: control fil…
- impdp报ora-39001 ora-39000&…
- ORA-01591: lock held by in-doubt…
- ORA-25507错误 没有使资源管理器…
- ORA-19573 cannot obtain string e…
- 11g 重建EM 报ORA-20001…
- RMAN 报:ORA-19504 ORA-27038
- ORA-01008: 并非所有变量都已绑定
- ORA-4031 and Shared&nb…