暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

备库恢复数据文件报错ORA-19573、ORA-19870

原创 Leo 2023-02-03
1868

问题描述:备库恢复数据文件报错ORA-19573ORA-19870,如下所示:

数据库:oracle 11.2.0.4

主机名:主库leo-oel150 备库 leo-oel151

1、问题重现

--备库检查users表空间,发现存在坏块.

RMAN> backup validate check logical tablespace users;

 

Starting backup at 02-FEB-23

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=13 device type=DISK

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00004 name=/u01/app/oracle/oradata/orcl151/users01.dbf

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

List of Datafiles

=================

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN

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

4    FAILED 0              20           666             1090741  

  File Name: /u01/app/oracle/oradata/orcl151/users01.dbf

  Block Type Blocks Failing Blocks Processed

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

  Data       0              26             

  Index      0              21             

  Other      237            573            

 

validate found one or more corrupt blocks

See trace file /u01/app/oracle/diag/rdbms/orcl151/orcl151/trace/orcl151_ora_22289.trc for details

Finished backup at 02-FEB-23

--尝试恢复数据文件4,报错ORA-19573、ORA-19870

[oracle@leo-oel151 ~]$ rman target /

 

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Feb 2 14:35:43 2023

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

 

connected to target database: ORCL150 (DBID=4073973096)

 

RMAN> restore datafile 4;

 

Starting restore at 02-FEB-23

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=134 device type=DISK

 

channel ORA_DISK_1: starting datafile backup set restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/orcl151/users01.dbf

channel ORA_DISK_1: reading from backup piece /home/oracle/rmanbak/data_full_20230201_8_1

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of restore command at 02/02/2023 14:36:00

ORA-19870: error while restoring backup piece /home/oracle/rmanbak/data_full_20230201_8_1

ORA-19573: cannot obtain exclusive enqueue for datafile 4

2、异常处理

2.1、解决过程

--查数据文件的备份情况.

RMAN> list backup of datafile 4;

 

 

List of Backup Sets

===================

 

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

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

6       Full    268.27M    DISK        00:00:28     01-FEB-23     

        BP Key: 6   Status: AVAILABLE  Compressed: YES  Tag: TAG20230201T213409

        Piece Name: /home/oracle/rmanbak/data_full_20230201_8_1

  List of Datafiles in backup set 6

  File LV Type Ckp SCN    Ckp Time  Name

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

  4       Full 1070504    01-FEB-23 /u01/app/oracle/oradata/orcl151/users01.dbf

 

说明:可以看到备库存在数据文件4的备份.

--将备库启动到mount状态

SYS@orcl151> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SYS@orcl151> startup mount

ORACLE instance started.

 

Total System Global Area 1586708480 bytes

Fixed Size                  2253624 bytes

Variable Size             989859016 bytes

Database Buffers          587202560 bytes

Redo Buffers                7393280 bytes

Database mounted.

--再次进行restore恢复.

[oracle@leo-oel151 ~]$ rman target /

 

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Feb 2 17:08:18 2023

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

 

connected to target database: ORCL150 (DBID=4073973096, not open)

 

RMAN> restore datafile 4;

 

Starting restore at 02-FEB-23

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=192 device type=DISK

 

channel ORA_DISK_1: starting datafile backup set restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/orcl151/users01.dbf

channel ORA_DISK_1: reading from backup piece /home/oracle/rmanbak/data_full_20230201_8_1

channel ORA_DISK_1: piece handle=/home/oracle/rmanbak/data_full_20230201_8_1 tag=TAG20230201T213409

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:00:01

Finished restore at 02-FEB-23

 

说明:数据文件4成功恢复.

2.2、数据验证

[oracle@leo-oel151 admin]$ sqlplus sys/oracle_4U@orcl151 as sysdba

 

SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 2 17:18:46 2023

 

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SYS@orcl151> select * from v$database_block_corruption;

 

no rows selected

 

[oracle@leo-oel151 ~]$ rman target /

 

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Feb 3 14:41:50 2023

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

 

connected to target database: ORCL150 (DBID=4073973096)

 

RMAN> backup validate check logical tablespace users;

 

Starting backup at 03-FEB-23

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=13 device type=DISK

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00004 name=/u01/app/oracle/oradata/orcl151/users01.dbf

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

List of Datafiles

=================

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN

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

4    OK     0              21           668             1090741  

  File Name: /u01/app/oracle/oradata/orcl151/users01.dbf

  Block Type Blocks Failing Blocks Processed

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

  Data       0              30             

  Index      0              21             

  Other      0              568            

 

Finished backup at 03-FEB-23

 

说明:可以看到数据文件恢复正常.

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论