RMAN Duplicate时PLS-00201: identifier 'DBMS_RCVCAT.GETDBID' must be declared

一、搭建DG使用RMAN同步数据到备库时报错

  1. RMAN> duplicate target database for standby from active database;

  2. Starting Duplicate Db at 15-JUN-18
  3. using channel ORA_AUX_DISK_1

  4. contents of Memory Script:
  5. {
  6.    backup as copy reuse
  7.    targetfile '/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcl' auxiliary format
  8.  '/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcls' ;
  9. }
  10. executing Memory Script

  11. Starting backup at 15-JUN-18
  12. using channel ORA_DISK_1
  13. Finished backup at 15-JUN-18

  14. contents of Memory Script:
  15. {
  16.    backup as copy current controlfile for standby auxiliary format '/oradata/control01.ctl';
  17.    restore clone controlfile to '/u01/app/oracle/fast_recovery_area/orcls/control02.ctl' from
  18.  '/oradata/control01.ctl';
  19. }
  20. executing Memory Script

  21. Starting backup at 15-JUN-18
  22. using channel ORA_DISK_1
  23. channel ORA_DISK_1: starting datafile copy
  24. copying standby control file
  25. output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl.f tag=TAG20180619T202436 RECID=3 STAMP=979244676
  26. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
  27. Finished backup at 15-JUN-18

  28. Starting restore at 15-JUN-18
  29. using channel ORA_AUX_DISK_1


  30. DBGSQL: TARGET> begin :fhdbi := dbms_rcvcat.getDbid; end;
  31. DBGSQL: sqlcode = 6550
  32. DBGSQL: B :fhdbi = 32767
  33. RMAN-00571: ===========================================================
  34. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  35. RMAN-00571: ===========================================================
  36. RMAN-03002: failure of Duplicate Db command at 06/15/2018 00:58:58
  37. RMAN-05501: aborting duplication of target database
  38. RMAN-03015: error occurred in stored script Memory Script
  39. ORA-06550: line 1, column 17:
  40. PLS-00201: identifier 'DBMS_RCVCAT.GETDBID' must be declared
  41. ORA-06550: line 1, column 7:
  42. PL/SQL: Statement ignored
查询网络资料https://blog.csdn.net/tianlesoftware/article/details/9358939后
解释是使用非catalog,在rman 连接时,加上nocatalog关键字,如下:

  1. [oracle@node2 dbs]$ rman target sys/oracle@orcl auxiliary sys/oracle@orcls nocatalog

  2. Recovery Manager: Release 11.2.0.4.0 - Production on Fri Jun 15 01:03:44 2018

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

  4. connected to target database: ORCL (DBID=1506854844)
  5. using target database control file instead of recovery catalog
  6. connected to auxiliary database: ORCL (not mounted)
使用后正常完成同步,如下:

  1. RMAN> duplicate target database for standby from active database nofilenamecheck;

  2. Starting Duplicate Db at 15-JUN-18
  3. allocated channel: ORA_AUX_DISK_1
  4. channel ORA_AUX_DISK_1: SID=1 device type=DISK

  5. contents of Memory Script:
  6. {
  7.    backup as copy reuse
  8.    targetfile '/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcl' auxiliary format
  9.  '/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcls' ;
  10. }
  11. executing Memory Script

  12. Starting backup at 15-JUN-18
  13. allocated channel: ORA_DISK_1
  14. channel ORA_DISK_1: SID=36 device type=DISK
  15. Finished backup at 15-JUN-18

  16. contents of Memory Script:
  17. {
  18.    backup as copy current controlfile for standby auxiliary format '/oradata/control01.ctl';
  19.    restore clone controlfile to '/u01/app/oracle/fast_recovery_area/orcls/control02.ctl' from
  20.  '/oradata/control01.ctl';
  21. }
  22. executing Memory Script

  23. Starting backup at 15-JUN-18
  24. using channel ORA_DISK_1
  25. channel ORA_DISK_1: starting datafile copy
  26. copying standby control file
  27. output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl.f tag=TAG20180619T202939 RECID=5 STAMP=979244979
  28. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
  29. Finished backup at 15-JUN-18

  30. Starting restore at 15-JUN-18
  31. using channel ORA_AUX_DISK_1

  32. channel ORA_AUX_DISK_1: copied control file copy
  33. Finished restore at 15-JUN-18

  34. contents of Memory Script:
  35. {
  36.    sql clone 'alter database mount standby database';
  37. }
  38. executing Memory Script

  39. sql statement: alter database mount standby database

  40. contents of Memory Script:
  41. {
  42.    set newname for clone tempfile 1 to new;
  43.    switch clone tempfile all;
  44.    set newname for clone datafile 1 to new;
  45.    set newname for clone datafile 2 to new;
  46.    set newname for clone datafile 3 to new;
  47.    set newname for clone datafile 4 to new;
  48.    backup as copy reuse
  49.    datafile 1 auxiliary format new
  50.    datafile 2 auxiliary format new
  51.    datafile 3 auxiliary format new
  52.    datafile 4 auxiliary format new
  53.    ;
  54.    sql 'alter system archive log current';
  55. }
  56. executing Memory Script

  57. executing command: SET NEWNAME

  58. renamed tempfile 1 to /oradata/ORCLS/datafile/o1_mf_temp_%u_.tmp in control file

  59. executing command: SET NEWNAME

  60. executing command: SET NEWNAME

  61. executing command: SET NEWNAME

  62. executing command: SET NEWNAME

  63. Starting backup at 15-JUN-18
  64. using channel ORA_DISK_1
  65. channel ORA_DISK_1: starting datafile copy
  66. input datafile file number=00001 name=/oradata/orcl/system01.dbf
  67. output file name=/oradata/ORCLS/datafile/o1_mf_system_06t5s5tr_.dbf tag=TAG20180619T202947
  68. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
  69. channel ORA_DISK_1: starting datafile copy
  70. input datafile file number=00002 name=/oradata/orcl/sysaux01.dbf
  71. output file name=/oradata/ORCLS/datafile/o1_mf_sysaux_07t5s5uu_.dbf tag=TAG20180619T202947
  72. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
  73. channel ORA_DISK_1: starting datafile copy
  74. input datafile file number=00003 name=/oradata/orcl/undotbs01.dbf
  75. output file name=/oradata/ORCLS/datafile/o1_mf_undotbs1_08t5s5vn_.dbf tag=TAG20180619T202947
  76. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
  77. channel ORA_DISK_1: starting datafile copy
  78. input datafile file number=00004 name=/oradata/orcl/users01.dbf
  79. output file name=/oradata/ORCLS/datafile/o1_mf_users_09t5s5vq_.dbf tag=TAG20180619T202947
  80. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
  81. Finished backup at 15-JUN-18

  82. sql statement: alter system archive log current

  83. contents of Memory Script:
  84. {
  85.    switch clone datafile all;
  86. }
  87. executing Memory Script

  88. datafile 1 switched to datafile copy
  89. input datafile copy RECID=5 STAMP=978829512 file name=/oradata/ORCLS/datafile/o1_mf_system_06t5s5tr_.dbf
  90. datafile 2 switched to datafile copy
  91. input datafile copy RECID=6 STAMP=978829512 file name=/oradata/ORCLS/datafile/o1_mf_sysaux_07t5s5uu_.dbf
  92. datafile 3 switched to datafile copy
  93. input datafile copy RECID=7 STAMP=978829512 file name=/oradata/ORCLS/datafile/o1_mf_undotbs1_08t5s5vn_.dbf
  94. datafile 4 switched to datafile copy
  95. input datafile copy RECID=8 STAMP=978829512 file name=/oradata/ORCLS/datafile/o1_mf_users_09t5s5vq_.dbf
  96. Finished Duplicate Db at 15-JUN-18

  97. RMAN>




来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31427447/viewspace-2156955/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31427447/viewspace-2156955/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值