标题: Unable to connect RMAN utility from the standby database [打印本页] 作者: 刘泽宇 时间: 2025-8-31 17:32 标题: Unable to connect RMAN utility from the standby database 现象:
The Recovery Manager (RMAN) utility is unable to establish a connection on the standby database.
Error messages indicate issues with the initialization of the internal recovery manager package and errors from the target database.
The specific errors include:
rman target /
Recovery Manager: Release 12.2.0.1.0 - Production on Mon May 12 02:48:12 2025
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
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-04068: existing state of packages has been discarded
ORA-04065: not executed, altered or dropped package body "SYS.DBMS_APPLICATION_INFO"
ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_APPLICATION_INFO"
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 111
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 191
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 5093
ORA-04065: not executed, altered or dropped package body "SYS.DBMS_APPLICATION_INFO"
ORA-06508: PL/SQL: could not find program uni
RMAN-04015: error setting target database character set to US7ASCII
原因:
The issue is not specific to RMAN but is related to the SYS package DBMS_APPLICATION_INFO.
The package has recently been modified, as indicated by the last DDL (Data Definition Language) time.
The existing state of the packages has been discarded, and the package body is not executed, altered, or dropped. This leads to the RMAN utility being unable to find the necessary program unit.
SQL> col OWNER format a10
SQL> col OBJECT_NAME format a30
SQL> select OWNER, OBJECT_NAME, OBJECT_TYPE, to_char(LAST_DDL_TIME,'DD-MON-YYYY HH24:MI'), STATUS from dba_objects where OBJECT_NAME = 'DBMS_APPLICATION_INFO';
OWNER OBJECT_NAME OBJECT_TYPE TO_CHAR(LAST_DDL_ STATUS
---------- ------------------------------ ----------------------- ----------------- -------
SYS DBMS_APPLICATION_INFO PACKAGE 01-MAY-2025 18:55 VALID
SYS DBMS_APPLICATION_INFO PACKAGE BODY 17-APR-2025 06:39 VALID
PUBLIC DBMS_APPLICATION_INFO SYNONYM 26-JUN-2017 10:36 VALID
处理方法:
On the standby database, execute the following SQL command to flush the shared pool:
alter system flush SHARED_POOL;
If the above step does not resolve the issue, proceed to the primary database and compile the SYS.DBMS_APPLICATION_INFO package:
alter package SYS.DBMS_APPLICATION_INFO compile package;
After compiling the package, execute the following command on the primary database:
alter system archive log current;
Wait for the standby database to apply the latest redo logs and then check if the RMAN connection is working.
By flushing the shared pool, the modified package will be reloaded. Compiling the package will invalidate and reload it, ensuring that the necessary program unit is available for RMAN to establish a connection.