【Oracle】rman upgrade catalog

楊奇龍發表於2012-06-14
因為資料庫從11.2.0.2 升級到 11.2.0.3,在使用catalog 執行rman備份的時候,報如下錯誤:
oracle@rac1>rman target / catalog rman/xxxxx@rman
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Jun 13 22:31:07 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: RAC (DBID=12029485965)
connected to recovery catalog database
PL/SQL package RMAN_ALIBANK.DBMS_RCVCAT version 11.02.00.01 in RCVCAT database is not current
PL/SQL package RMAN_ALIBANK.DBMS_RCVMAN version 11.02.00.01 in RCVCAT database is not current
RMAN>
RMAN>
RMAN> show all;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of show command at 06/13/2012 22:31:23
RMAN-03014: implicit resync of recovery catalog failed
RMAN-03009: failure of full resync command on default channel at 06/13/2012 22:31:23

RMAN-10015: error compiling PL/SQL program
RMAN-10014: PL/SQL error 0 on line 1655 column 12: Statement ignored
RMAN-10014: PL/SQL error 306 on line 1655 column 12: wrong number or types of arguments in call to 'CHECKTABLESPACE'
RMAN> exit
因為catalog 資料的版本低於執行rman的資料庫版本,所以報如上錯誤!我們要執行upgrade catalog 來更新catalog!按照官方文件的描述“
Note that UPGRADE CATALOG does not run scripts to perform. the upgrade. Instead, RMAN sends various SQL DDL statements to the recovery catalog to update the recovery catalog schema with new tables, views, columns, and so forth.
upgrade 命令本身並步執行真正的升級而是執行一下ddl 語句 修改catalog 使用者下的表,欄位等等!
oracle@rac1>rman target / catalog rman/xxxxx@rman
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Jun 13 22:46:49 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: RAC (DBID=12029485965)
connected to recovery catalog database
PL/SQL package RMAN_ALIBANK.DBMS_RCVCAT version 11.02.00.01 in RCVCAT database is not current
PL/SQL package RMAN_ALIBANK.DBMS_RCVMAN version 11.02.00.01 in RCVCAT database is not current 
RMAN> upgrade catalog;
recovery catalog owner is RMAN
enter UPGRADE CATALOG command again to confirm catalog upgrade
RMAN> UPGRADE CATALOG
recovery catalog upgraded to version 11.02.00.03
DBMS_RCVMAN package upgraded to version 11.02.00.03
DBMS_RCVCAT package upgraded to version 11.02.00.03
RMAN>

執行 upgrade catalog 命令要注意:
 a) You must be connected to the catalog database, and the catalog database must be open. You do not have to be connected to the target database.
 b) You must enter the UPGRADE command twice in a row to confirm the upgrade.
 c) You will receive an error if the recovery catalog is already at a version greater than needed by the RMAN executable. RMAN permits the command to be run if the recovery catalog is already current, however, so that the packages can be re-created if necessary. RMAN displays all error messages generated during the upgrade in the message log.
參考:

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

相關文章