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

ORA-00283: recovery SESSION canceled due TO errors

老杨 2019-04-18
4814

问题描述

一个测试数据库在恢复时出现ORA-38727错误。
错误信息如下:

[orat1@hpserver2 ~]$ rman target /
Recovery Manager: Release 10.2.0.3.0 - Production ON Sat Apr 14 09:56:01 2012
Copyright (c) 1982, 2005, Oracle. ALL rights reserved.
connected TO target DATABASE: TEST10G (DBID=1030910857)
RMAN> recover tablespace tbs013;
Starting recover at 14-APR-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=138 devtype=DISK
starting media recovery
media recovery failed
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure OF recover command at 04/14/2012 09:57:45
ORA-00283: recovery SESSION canceled due TO errors
RMAN-11003: failure during parse/execution OF SQL statement: ALTER DATABASE recover IF needed
tablespace TBS013
ORA-00283: recovery SESSION canceled due TO errors
ORA-38727: FLASHBACK DATABASE requires a CURRENT control file.
RMAN> exit
Recovery Manager complete.


专家解答

显然导致这个错误的原因和FLASHBACK特性有关,检查数据库,果然发现FLASHBACK属性出于ON的状态:

[orat1@hpserver2 ~]$ sqlplus / AS sysdba
SQL*Plus: Release 10.2.0.3.0 - Production ON Sat Apr 14 09:57:57 2012
Copyright (c) 1982, 2006, Oracle. ALL Rights Reserved.
 
Connected TO:
Oracle DATABASE 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
WITH the Partitioning, OLAP AND DATA Mining options
SQL> SET pages 100 LINES 140
SQL> SELECT dbid, name, flashback_on FROM v$database;
DBID NAME      FLASHBACK_ON
---------- --------- ------------------
1030910857 TEST10G   YES
SQL> shutdown immediate
DATABASE closed.
DATABASE dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed SIZE 2072384 bytes
Variable SIZE 171966656 bytes
DATABASE Buffers 134217728 bytes
Redo Buffers 6316032 bytes
DATABASE mounted.
SQL> ALTER DATABASE flashback off; 
DATABASE altered.
SQL> exit 
Disconnected FROM Oracle DATABASE 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
WITH the Partitioning, OLAP AND DATA Mining options

再次执行恢复操作:

[orat1@hpserver2 ~]$ rman target /
Recovery Manager: Release 10.2.0.3.0 - Production ON Sat Apr 14 10:01:03 2012
Copyright (c) 1982, 2005, Oracle. ALL rights reserved.
connected TO target DATABASE: TEST10G (DBID=1030910857, NOT OPEN)
RMAN> recover tablespace tbs013;
Starting recover at 14-APR-12
USING target DATABASE control file instead OF recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
starting media recovery
media recovery failed
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure OF recover command at 04/14/2012 10:02:06
ORA-00283: recovery SESSION canceled due TO errors
RMAN-11003: failure during parse/execution OF SQL statement: ALTER DATABASE recover IF needed
tablespace TBS013
ORA-00283: recovery SESSION canceled due TO errors
ORA-01110: DATA file 11: '/t1/orat1/oradata/test10g_s/tbs013.dbf'
ORA-01157: cannot identify/LOCK DATA file 11 - see DBWR trace file
ORA-01110: DATA file 11: '/t1/orat1/oradata/test10g_s/tbs013.dbf'
RMAN> restore tablespace tbs013;
Starting restore at 14-APR-12
USING channel ORA_DISK_1
skipping datafile 11; already restored TO file /t1/orat1/oradata/test10g_s/tbs013.dbf
restore NOT done; ALL files readonly, offline, OR already restored
Finished restore at 14-APR-12
RMAN> recover tablespace tbs013;
Starting recover at 14-APR-12
USING channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure OF recover command at 04/14/2012 10:03:05
RMAN-06067: RECOVER DATABASE required WITH a backup OR created control file
RMAN> recover DATABASE;
Starting recover at 14-APR-12
USING channel ORA_DISK_1
starting media recovery
archive log thread 1 SEQUENCE 356 IS already ON disk AS file /t1/orat1/arch_s/1_356_779468996.dbf
archive log thread 1 SEQUENCE 357 IS already ON disk AS file /t1/orat1/arch_s/1_357_779468996.dbf
archive log thread 1 SEQUENCE 358 IS already ON disk AS file /t1/orat1/arch_s/1_358_779468996.dbf
archive log thread 1 SEQUENCE 359 IS already ON disk AS file /t1/orat1/arch_s/1_359_779468996.dbf
archive log thread 1 SEQUENCE 360 IS already ON disk AS file /t1/orat1/arch_s/1_360_779468996.dbf
archive log thread 1 SEQUENCE 361 IS already ON disk AS file /t1/orat1/arch_s/1_361_779468996.dbf
archive log thread 1 SEQUENCE 362 IS already ON disk AS file /t1/orat1/arch_s/1_362_779468996.dbf
archive log thread 1 SEQUENCE 363 IS already ON disk AS file /t1/orat1/arch_s/1_363_779468996.dbf
archive log thread 1 SEQUENCE 364 IS already ON disk AS file /t1/orat1/arch_s/1_364_779468996.dbf
archive log thread 1 SEQUENCE 365 IS already ON disk AS file /t1/orat1/arch_s/1_365_779468996.dbf
archive log thread 1 SEQUENCE 366 IS already ON disk AS file /t1/orat1/arch_s/1_366_779468996.dbf
archive log thread 1 SEQUENCE 367 IS already ON disk AS file /t1/orat1/arch_s/1_367_779468996.dbf
archive log thread 1 SEQUENCE 368 IS already ON disk AS file /t1/orat1/arch_s/1_368_779468996.dbf
archive log thread 1 SEQUENCE 369 IS already ON disk AS file /t1/orat1/arch_s/1_369_779468996.dbf
archive log thread 1 SEQUENCE 370 IS already ON disk AS file /t1/orat1/arch_s/1_370_779468996.dbf
archive log thread 1 SEQUENCE 371 IS already ON disk AS file /t1/orat1/arch_s/1_371_779468996.dbf
archive log thread 1 SEQUENCE 372 IS already ON disk AS file /t1/orat1/arch_s/1_372_779468996.dbf
archive log thread 1 SEQUENCE 373 IS already ON disk AS file /t1/orat1/arch_s/1_373_779468996.dbf
archive log thread 1 SEQUENCE 374 IS already ON disk AS file /t1/orat1/arch_s/1_374_779468996.dbf
archive log thread 1 SEQUENCE 375 IS already ON disk AS file /t1/orat1/arch_s/1_375_779468996.dbf
archive log thread 1 SEQUENCE 376 IS already ON disk AS file /t1/orat1/arch_s/1_376_779468996.dbf
archive log thread 1 SEQUENCE 377 IS already ON disk AS file /t1/orat1/arch_s/1_377_779468996.dbf
archive log thread 1 SEQUENCE 378 IS already ON disk AS file /t1/orat1/arch_s/1_378_779468996.dbf
archive log thread 1 SEQUENCE 379 IS already ON disk AS file /t1/orat1/arch_s/1_379_779468996.dbf
archive log thread 1 SEQUENCE 380 IS already ON disk AS file /t1/orat1/arch_s/1_380_779468996.dbf
archive log thread 1 SEQUENCE 381 IS already ON disk AS file /t1/orat1/arch_s/1_381_779468996.dbf
archive log thread 1 SEQUENCE 382 IS already ON disk AS file /t1/orat1/arch_s/1_382_779468996.dbf
archive log thread 1 SEQUENCE 383 IS already ON disk AS file /t1/orat1/arch_s/1_383_779468996.dbf
archive log thread 1 SEQUENCE 384 IS already ON disk AS file /t1/orat1/arch_s/1_384_779468996.dbf
archive log thread 1 SEQUENCE 385 IS already ON disk AS file /t1/orat1/arch_s/1_385_779468996.dbf
archive log thread 1 SEQUENCE 386 IS already ON disk AS file /t1/orat1/arch_s/1_386_779468996.dbf
archive log thread 1 SEQUENCE 387 IS already ON disk AS file /t1/orat1/arch_s/1_387_779468996.dbf
archive log thread 1 SEQUENCE 388 IS already ON disk AS file /t1/orat1/arch_s/1_388_779468996.dbf
archive log thread 1 SEQUENCE 389 IS already ON disk AS file /t1/orat1/oradata/test10g_s/redo02.log
archive log thread 1 SEQUENCE 390 IS already ON disk AS file /t1/orat1/oradata/test10g_s/redo03.log
archive log thread 1 SEQUENCE 391 IS already ON disk AS file /t1/orat1/oradata/test10g_s/redo01.log
archive log filename=/t1/orat1/arch_s/1_356_779468996.dbf thread=1 SEQUENCE=356
archive log filename=/t1/orat1/arch_s/1_357_779468996.dbf thread=1 SEQUENCE=357
archive log filename=/t1/orat1/arch_s/1_358_779468996.dbf thread=1 SEQUENCE=358
archive log filename=/t1/orat1/arch_s/1_359_779468996.dbf thread=1 SEQUENCE=359
archive log filename=/t1/orat1/arch_s/1_360_779468996.dbf thread=1 SEQUENCE=360
archive log filename=/t1/orat1/arch_s/1_361_779468996.dbf thread=1 SEQUENCE=361
archive log filename=/t1/orat1/arch_s/1_362_779468996.dbf thread=1 SEQUENCE=362
archive log filename=/t1/orat1/arch_s/1_363_779468996.dbf thread=1 SEQUENCE=363
archive log filename=/t1/orat1/arch_s/1_364_779468996.dbf thread=1 SEQUENCE=364
archive log filename=/t1/orat1/arch_s/1_365_779468996.dbf thread=1 SEQUENCE=365
archive log filename=/t1/orat1/arch_s/1_366_779468996.dbf thread=1 SEQUENCE=366
archive log filename=/t1/orat1/arch_s/1_367_779468996.dbf thread=1 SEQUENCE=367
archive log filename=/t1/orat1/arch_s/1_368_779468996.dbf thread=1 SEQUENCE=368
archive log filename=/t1/orat1/arch_s/1_369_779468996.dbf thread=1 SEQUENCE=369
archive log filename=/t1/orat1/arch_s/1_370_779468996.dbf thread=1 SEQUENCE=370
archive log filename=/t1/orat1/arch_s/1_371_779468996.dbf thread=1 SEQUENCE=371
archive log filename=/t1/orat1/arch_s/1_372_779468996.dbf thread=1 SEQUENCE=372
archive log filename=/t1/orat1/arch_s/1_373_779468996.dbf thread=1 SEQUENCE=373
archive log filename=/t1/orat1/arch_s/1_374_779468996.dbf thread=1 SEQUENCE=374
archive log filename=/t1/orat1/arch_s/1_375_779468996.dbf thread=1 SEQUENCE=375
archive log filename=/t1/orat1/arch_s/1_376_779468996.dbf thread=1 SEQUENCE=376
archive log filename=/t1/orat1/arch_s/1_377_779468996.dbf thread=1 SEQUENCE=377
archive log filename=/t1/orat1/arch_s/1_378_779468996.dbf thread=1 SEQUENCE=378
archive log filename=/t1/orat1/arch_s/1_379_779468996.dbf thread=1 SEQUENCE=379
archive log filename=/t1/orat1/arch_s/1_380_779468996.dbf thread=1 SEQUENCE=380
archive log filename=/t1/orat1/arch_s/1_381_779468996.dbf thread=1 SEQUENCE=381
archive log filename=/t1/orat1/arch_s/1_382_779468996.dbf thread=1 SEQUENCE=382
archive log filename=/t1/orat1/arch_s/1_383_779468996.dbf thread=1 SEQUENCE=383
archive log filename=/t1/orat1/arch_s/1_384_779468996.dbf thread=1 SEQUENCE=384
archive log filename=/t1/orat1/arch_s/1_385_779468996.dbf thread=1 SEQUENCE=385
archive log filename=/t1/orat1/arch_s/1_386_779468996.dbf thread=1 SEQUENCE=386
archive log filename=/t1/orat1/arch_s/1_387_779468996.dbf thread=1 SEQUENCE=387
archive log filename=/t1/orat1/arch_s/1_388_779468996.dbf thread=1 SEQUENCE=388
archive log filename=/t1/orat1/oradata/test10g_s/redo02.log thread=1 SEQUENCE=389
archive log filename=/t1/orat1/oradata/test10g_s/redo03.log thread=1 SEQUENCE=390
archive log filename=/t1/orat1/oradata/test10g_s/redo01.log thread=1 SEQUENCE=391
media recovery complete, elapsed TIME: 00:00:15
Finished recover at 14-APR-12
RMAN> ALTER DATABASE OPEN;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure OF ALTER db command at 04/14/2012 10:06:34
ORA-01589: must USE RESETLOGS OR NORESETLOGS OPTION FOR DATABASE OPEN
RMAN> ALTER DATABASE OPEN resetlogs;
DATABASE opened

虽然恢复成功,但是可以看到恢复过程并不顺利,最明显的一点,本来一个简单的TABLESPACE的恢复,变成了DATABASE的恢复,而且本来可以直接打开,现在变成了RESETLOGS方式的打开。这也说明由于启用了FLASHBACK,导致Oracle在判断控制文件状态出现了异常,导致最终以RESETLOGS方式打开数据库。
其实这个错误和不久前碰到的RMAN-600错误有直接的关联:
RMAN-600(8201)错误:http://yangtingkun.net/?p=690
RMAN-600(8201)错误的重现:http://yangtingkun.net/?p=716
而且正如我们所料,当前数据库再次RESETLOGS后,目前控制文件中最大的RESETLOGS时间对应的正式当前控制文件中记录的RESETLOGS时间,这就使得CATALOG的同步得以实现:

[orat1@hpserver2 ~]$ sqlplus / AS sysdba
SQL*Plus: Release 10.2.0.3.0 - Production ON Sun Apr 15 00:09:12 2012
Copyright (c) 1982, 2006, Oracle. ALL Rights Reserved.
Connected TO:
Oracle DATABASE 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
WITH the Partitioning, OLAP AND DATA Mining options
SQL> exit
Disconnected FROM Oracle DATABASE 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
WITH the Partitioning, OLAP AND DATA Mining options
[orat1@hpserver2 ~]$ rman target / catalog rcat_user/rcat_password
Recovery Manager: Release 10.2.0.3.0 - Production ON Sun Apr 15 00:09:31 2012
Copyright (c) 1982, 2005, Oracle. ALL rights reserved.
connected TO target DATABASE: TEST10G (DBID=1030910857)
connected TO recovery catalog DATABASE
RMAN> SHOW ALL;
NEW incarnation OF DATABASE registered IN recovery catalog
starting FULL resync OF recovery catalog
FULL resync complete
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # DEFAULT
CONFIGURE BACKUP OPTIMIZATION OFF; # DEFAULT
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # DEFAULT
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # DEFAULT
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # DEFAULT
CONFIGURE DEVICE TYPE DISK PARALLELISM 5 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # DEFAULT
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # DEFAULT
CONFIGURE MAXSETSIZE TO UNLIMITED; # DEFAULT
CONFIGURE ENCRYPTION FOR DATABASE OFF; # DEFAULT
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # DEFAULT
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # DEFAULT
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/t1/orat1/product/10.2.0/db_1/dbs/snapcf_test10g_s.f'; # DEFAULT
RMAN>


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

评论