ORACLE STANDBY 修复ORA-19505问题记录

前端之家收集整理的这篇文章主要介绍了ORACLE STANDBY 修复ORA-19505问题记录前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


备库down了,经过检查,坏块无法做增量修复,所以需要重新搭建的方式来修复standby库,oracle11g里面有duplicate的方式远程在线修复命令:

  1. run {
  2. allocate auxiliary channel c1 device type disk;
  3. allocate auxiliary channel c2 device type disk;
  4. duplicate target database for standby from active database nofilenamecheck;
  5. release channel c1;
  6. release channel c2;
  7. }


意外的是,修复过程中报错ORA-19505,如下:

  1. [oracle@odbm1 dbs]$ rlwrap rman target sys/pwd_0978@odbm1 auxiliary sys/pwd_0978@odbs1
  2.  
  3. Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jun 5 19:49:04 2017
  4.  
  5. Copyright (c) 1982,2011,Oracle and/or its affiliates. All rights reserved.
  6.  
  7. connected to target database: orcldb (DBID=3391761643)
  8. connected to auxiliary database: orcldb (not mounted)
  9.  
  10. run {
  11. allocate auxiliary channel c1 device type disk;
  12.  
  13. RMAN-00571: ===========================================================
  14. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  15. RMAN-00571: ===========================================================
  16. RMAN-00558: error encountered while parsing input commands
  17. RMAN-01009: Syntax error: found "identifier": expecting one of: "device,type"
  18. RMAN-01008: the bad identifier was: devicetype
  19. RMAN-01007: at line 2 column 31 file: standard input
  20.  
  21. allocate auxiliary channel c2 device type disk;
  22.  
  23. RMAN-00571: ===========================================================
  24. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  25. RMAN-00571: ===========================================================
  26. RMAN-00558: error encountered while parsing input commands
  27. RMAN-01009: Syntax error: found "auxiliary": expecting one of: "channel"
  28. RMAN-01007: at line 1 column 10 file: standard input
  29.  
  30. duplicate target database for standby nofilenamecheck dorecover;
  31.  
  32. Starting Duplicate Db at 05-JUN-17
  33. release channel c1;
  34. release channel c2;
  35. using target database control file instead of recovery catalog
  36. allocated channel: ORA_AUX_DISK_1
  37. channel ORA_AUX_DISK_1: SID=4708 device type=DISK
  38.  
  39. contents of Memory Script:
  40. {
  41. set until scn 14430447592;
  42. restore clone standby controlfile;
  43. }
  44. executing Memory Script
  45.  
  46. executing command: SET until clause
  47.  
  48. Starting restore at 05-JUN-17
  49. using channel ORA_AUX_DISK_1
  50.  
  51. channel ORA_AUX_DISK_1: starting datafile backup set restore
  52. channel ORA_AUX_DISK_1: restoring control file
  53. channel ORA_AUX_DISK_1: reading from backup piece /oracle/backup/data/controlfiles/c-3391761643-20170605-00
  54. channel ORA_AUX_DISK_1: ORA-19870: error while restoring backup piece /oracle/backup/data/controlfiles/c-3391761643-20170605-00
  55. ORA-19505: Failed to identify file "/oracle/backup/data/controlfiles/c-3391761643-20170605-00"
  56. ORA-27037: unable to obtain file status
  57. Linux-x86_64 Error: 2: No such file or directory
  58. Additional information: 3
  59.  
  60. failover to prevIoUs backup
  61.  
  62. channel ORA_AUX_DISK_1: starting datafile backup set restore
  63. channel ORA_AUX_DISK_1: restoring control file
  64. channel ORA_AUX_DISK_1: reading from backup piece /oracle/backup/data/controlfiles/c-3391761643-20170604-00
  65. channel ORA_AUX_DISK_1: ORA-19870: error while restoring backup piece /oracle/backup/data/controlfiles/c-3391761643-20170604-00
  66. ORA-19505: Failed to identify file "/oracle/backup/data/controlfiles/c-3391761643-20170604-00"
  67. ORA-27037: unable to obtain file status
  68. Linux-x86_64 Error: 2: No such file or directory
  69. Additional information: 3
  70.  
  71. failover to prevIoUs backup
  72.  
  73. channel ORA_AUX_DISK_1: starting datafile backup set restore
  74. channel ORA_AUX_DISK_1: restoring control file
  75. channel ORA_AUX_DISK_1: reading from backup piece /oracle/backup/data/controlfiles/c-3391761643-20170603-00
  76. channel ORA_AUX_DISK_1: ORA-19870: error while restoring backup piece /oracle/backup/data/controlfiles/c-3391761643-20170603-00
  77. ORA-19505: Failed to identify file "/oracle/backup/data/controlfiles/c-3391761643-20170603-00"
  78. ORA-27037: unable to obtain file status
  79. Linux-x86_64 Error: 2: No such file or directory
  80. Additional information: 3
  81.  
  82. failover to prevIoUs backup



解决办法】
(1)关闭备库standby

  1. sql> select open_mode from v$database;
  2.  
  3. OPEN_MODE
  4. --------------------
  5. MOUNTED
  6.  
  7. sql> shutdown immediate;
  8. ORA-01109: database not open
  9.  
  10.  
  11. Database dismounted.
  12. ORACLE instance shut down.
  13. sql>


(2)在备库上覆盖控制文件,启动到nomount

  1. [oracle@pldb02 dbs]$ cp /home/oracle/ctlfile4.bak /oracle/app/oracle/oradata/orcldb/control01.ctl
  2. [oracle@pldb02 dbs]$ rlwrap sqlplus / as sysdba
  3.  
  4. sql*Plus: Release 11.2.0.4.0 Production on Mon Jun 5 19:57:14 2017
  5.  
  6. Copyright (c) 1982,2013,Oracle. All rights reserved.
  7.  
  8. Connected to an idle instance.
  9.  
  10. sql> startup nomount
  11. ORACLE instance started.
  12.  
  13. Total System Global Area 4409401344 bytes
  14. Fixed Size 2260408 bytes
  15. Variable Size 2936013384 bytes
  16. Database Buffers 1459617792 bytes
  17. Redo Buffers 11509760 bytes
  18. sql>


(3)在master主库上重新拉active数据进行恢复操作

  1. [oracle@odbm1 dbs]$ rlwrap rman target sys/pwd_0978@odbm1 auxiliary sys/pwd_0978@odbs1
  2.  
  3. Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jun 5 19:57:27 2017
  4.  
  5. Copyright (c) 1982,Oracle and/or its affiliates. All rights reserved.
  6.  
  7. connected to target database: orcldb (DBID=3391761643)
  8. connected to auxiliary database: orcldb (not mounted)
  9.  
  10. RMAN> duplicate target database for standby from active database nofilenamecheck;
  11.  
  12. Starting Duplicate Db at 05-JUN-17
  13. using target database control file instead of recovery catalog
  14. allocated channel: ORA_AUX_DISK_1
  15. channel ORA_AUX_DISK_1: SID=5649 device type=DISK
  16.  
  17. contents of Memory Script:
  18. {
  19. backup as copy reuse
  20. targetfile '/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/orapworcldb' auxiliary format
  21. '/oracle/app/oracle/product/11.2.0.4/dbhome_1/dbs/orapworcldb' ;
  22. }
  23. executing Memory Script
  24.  
  25. Starting backup at 05-JUN-17
  26. allocated channel: ORA_DISK_1
  27. channel ORA_DISK_1: SID=1430 device type=DISK
  28. Finished backup at 05-JUN-17
  29.  
  30. contents of Memory Script:
  31. {
  32. backup as copy current controlfile for standby auxiliary format '/oracle/app/oracle/oradata/orcldb/control01.ctl';
  33. restore clone controlfile to '/oracle/app/oracle/fast_recovery_area/orcldb/control02.ctl' from
  34. '/oracle/app/oracle/oradata/orcldb/control01.ctl';
  35. }
  36. executing Memory Script
  37.  
  38. Starting backup at 05-JUN-17
  39. using channel ORA_DISK_1
  40. channel ORA_DISK_1: starting datafile copy
  41. copying standby control file
  42. output file name=/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_orcldb.f tag=TAG20170605T195936 RECID=30 STAMP=945892777
  43. channel ORA_DISK_1: datafile copy complete,elapsed time: 00:00:01
  44. Finished backup at 05-JUN-17
  45.  
  46. Starting restore at 05-JUN-17
  47. using channel ORA_AUX_DISK_1
  48.  
  49. ......



bty,如果执行命令:duplicate target database for standby from active database nofilenamecheck;在线恢复standby库的话,需要特别慎重,因为这会在线锁表的,建议在业务低峰期间做,不然会影响业务使用。

猜你在找的Oracle相关文章