rman duplicate出現PLS-00201錯誤解決

shawnloong發表於2018-01-31
rman duplicate出現以下錯誤

點選(此處)摺疊或開啟

  1. RMAN> duplicate target database for standby from active database dorecover nofilenamecheck;
  2. Starting Duplicate Db at 30-JAN-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/orapworcl' ;
  9. }
  10. executing Memory Script
  11. Starting backup at 30-JAN-18
  12. using channel ORA_DISK_1
  13. Finished backup at 30-JAN-18
  14. contents of Memory Script:
  15. {
  16. backup as copy current controlfile for standby auxiliary format '/u01/app/oracle/oradata/orcl/control01.ctl';
  17. restore clone primary controlfile to '/u01/app/oracle/fast_recovery_area/orcl/control02.ctl' from
  18. '/u01/app/oracle/oradata/orcl/control01.ctl';
  19. }
  20. executing Memory Script
  21. Starting backup at 30-JAN-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=TAG20180130T170732 RECID=2 STAMP=966791252
  26. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
  27. Finished backup at 30-JAN-18
  28. Starting restore at 30-JAN-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 = 32765
  33. RMAN-00571: ===========================================================
  34. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  35. RMAN-00571: ===========================================================
  36. RMAN-03002: failure of Duplicate Db command at 01/30/2018 17:07:35
  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
加上nocatalog解決

點選(此處)摺疊或開啟

  1. [oracle@hygzdb01-2-252 dbs]$ rman target sys/oracle@orcl auxiliary sys/oracle@orclst1 nocatalog
  2. Recovery Manager: Release 11.2.0.4.0 - Production on Tue Jan 30 17:09:12 2018
  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
  4. connected to target database: ORCL (DBID=1494309735)
  5. using target database control file instead of recovery catalog
  6. connected to auxiliary database: ORCL (not mounted)
  7. RMAN> duplicate target database for standby from active database dorecover nofilenamecheck;
  8. Starting Duplicate Db at 30-JAN-18
  9. allocated channel: ORA_AUX_DISK_1
  10. channel ORA_AUX_DISK_1: SID=126 device type=DISK
  11. contents of Memory Script:
  12. {
  13. backup as copy reuse
  14. targetfile '/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcl' auxiliary format
  15. '/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcl' ;
  16. }
  17. executing Memory Script
  18. Starting backup at 30-JAN-18
  19. allocated channel: ORA_DISK_1
  20. channel ORA_DISK_1: SID=872 device type=DISK
  21. Finished backup at 30-JAN-18
  22. contents of Memory Script:
  23. {
  24. backup as copy current controlfile for standby auxiliary format '/u01/app/oracle/oradata/orcl/control01.ctl';
  25. restore clone primary controlfile to '/u01/app/oracle/fast_recovery_area/orcl/control02.ctl' from
  26. '/u01/app/oracle/oradata/orcl/control01.ctl';
  27. }
  28. executing Memory Script
  29. Starting backup at 30-JAN-18
  30. using channel ORA_DISK_1
  31. channel ORA_DISK_1: starting datafile copy
  32. copying standby control file
  33. output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl.f tag=TAG20180130T170920 RECID=3 STAMP=966791361
  34. channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
  35. Finished backup at 30-JAN-18
  36. Starting restore at 30-JAN-18
  37. using channel ORA_AUX_DISK_1
  38. channel ORA_AUX_DISK_1: copied control file copy
  39. Finished restore at 30-JAN-18
  40. contents of Memory Script:
  41. {
  42. sql clone 'alter database mount standby database';
  43. }
  44. executing Memory Script
  45. sql statement: alter database mount standby database
  46. contents of Memory Script:
  47. {
  48. set newname for tempfile 1 to
  49. "/u01/app/oracle/oradata/orcl/temp01.dbf";
  50. switch clone tempfile all;
  51. set newname for datafile 1 to
  52. "/u01/app/oracle/oradata/orcl/system01.dbf";
  53. set newname for datafile 2 to
  54. "/u01/app/oracle/oradata/orcl/sysaux01.dbf";
  55. set newname for datafile 3 to
  56. "/u01/app/oracle/oradata/orcl/undotbs01.dbf";
  57. set newname for datafile 4 to
  58. "/u01/app/oracle/oradata/orcl/users01.dbf";
  59. set newname for datafile 5 to
  60. "/u01/app/oracle/oradata/orcl/tbs_hygz01.dbf";
  61. set newname for datafile 6 to
  62. "/u01/app/oracle/oradata/orcl/tbs_hygz02.dbf";
  63. set newname for datafile 7 to
  64. "/u01/app/oracle/oradata/orcl/tbs_hygz03.dbf";
  65. set newname for datafile 8 to
  66. "/u01/app/oracle/oradata/orcl/tbs_hygz04.dbf";
  67. backup as copy reuse
  68. datafile 1 auxiliary format
  69. "/u01/app/oracle/oradata/orcl/system01.dbf" datafile
  70. 2 auxiliary format
  71. "/u01/app/oracle/oradata/orcl/sysaux01.dbf" datafile
  72. 3 auxiliary format
  73. "/u01/app/oracle/oradata/orcl/undotbs01.dbf" datafile
  74. 4 auxiliary format
  75. "/u01/app/oracle/oradata/orcl/users01.dbf" datafile
  76. 5 auxiliary format
  77. "/u01/app/oracle/oradata/orcl/tbs_hygz01.dbf" datafile
  78. 6 auxiliary format
  79. "/u01/app/oracle/oradata/orcl/tbs_hygz02.dbf" datafile
  80. 7 auxiliary format
  81. "/u01/app/oracle/oradata/orcl/tbs_hygz03.dbf" datafile
  82. 8 auxiliary format
  83. "/u01/app/oracle/oradata/orcl/tbs_hygz04.dbf" ;
  84. sql 'alter system archive log current';
  85. }
  86. executing Memory Script
  87. executing command: SET NEWNAME
  88. renamed tempfile 1 to /u01/app/oracle/oradata/orcl/temp01.dbf in control file
  89. executing command: SET NEWNAME
  90. executing command: SET NEWNAME
  91. executing command: SET NEWNAME
  92. executing command: SET NEWNAME
  93. executing command: SET NEWNAME
  94. executing command: SET NEWNAME
  95. executing command: SET NEWNAME
  96. executing command: SET NEWNAME
  97. Starting backup at 30-JAN-18
  98. using channel ORA_DISK_1
  99. channel ORA_DISK_1: starting datafile copy
  100. input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
mos上有相關介紹
RMAN-554 RMAN-4005 PLS-201 RMAN-4015 when Connecting to Target Database (文件 ID 97294.1)

APPLIES TO:

Oracle Database - Enterprise Edition - Version 9.0.1.0 to 11.2.0.4 [Release 9.0.1 to 11.2]
Information in this document applies to any platform.

SYMPTOMS


You are attempting to connect to the target database in RMAN and
are receiving a "PLS-00201: identifier 'xxx...' must be declared" 
error:

target database Password:

 

RMAN-00571: ===========================================================
RMAN-00569: ========== ERROR MESSAGE STACK FOLLOWS ========
RMAN-00571: ===============================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04005: error from target database: ORA-06550: line 1, column 7:
PLS-00201: identifier 'DBMS_BACKUP_RESTORE.SET_CHARSET' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
RMAN-04015: error setting target database character set to US7ASCII



Also, if you log into the target database as the user SYS and issue:

SQL> select * 
         from dba_objects 
         where object_name like '%DBMS_BACKUP_RESTORE%';

you get 0 rows returned or the status is INVALID

 

CAUSE

The package identified in the PLS-00201 error was not successfully
created when catproc.sql was originally run on this database. As
a general rule, for any RMAN "PLS-00201: identifier 'xxx...' must
be declared" error, re-run catproc.sql.
主要是少了這個包DBMS_BACKUP_RESTORE

SOLUTION

Re-run catproc.sql. This will in turn call the dbmsbkrs.sql script
which creates the DBMS_BACKUP_RESTORE package.

NOTE : Keep inmind that running catproc.sql will invalidate all PL/SQL
and many other related objects.

Running catproc is recommended, as when the RMAN-packages are missing,
there could be others missing aswell.

If the problem has been identified as RMAN-only, than run :

SQL>@?/rdbms/admin/dbmsrman.sql
    @?/rdbms/admin/prvtrmns.plb
    @?/rdbms/admin/dbmsbkrs.sql
    @?/rdbms/admin/prvtbkrs.plb

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24486203/viewspace-2150717/,如需轉載,請註明出處,否則將追究法律責任。

相關文章