RMAN-00554 RMAN-04005 ORA-12528

來源:互聯網
上載者:User

RMAN-00554 RMAN-04005 ORA-12528

RMAN在使用recover catalog的情況下在nomount狀態串連執行個體出現以下錯誤資訊:
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04005: error from target database:
ORA-12528: TNS:listener: all appropriate instances are blocking new connections


下面我來類比一下這種情況
1.將資料庫置於nomount狀態
SQL> startup nomount
Oracle instance started.

Total System Global Area  327155712 bytes
Fixed Size                  1273516 bytes
Variable Size            138412372 bytes
Database Buffers          184549376 bytes
Redo Buffers                2920448 bytes


2.串連目標資料庫
[oracle@oracle11g ~]$ rman target sys/zzh_2046@test catalog rman/rman@jy

Recovery Manager: Release 10.2.0.5.0 - Production on Sun Feb 1 23:01:08 2015

Copyright (c) 1982, 2007, Oracle.  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-12528: TNS:listener: all appropriate instances are blocking new connections


3.檢查監聽狀態
[oracle@oracle11g ~]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 01-FEB-2015 23:00:49

Copyright (c) 1991, 2010, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                    LISTENER
Version                  TNSLSNR for Linux: Version 10.2.0.5.0 - Production
Start Date                01-FEB-2015 22:51:09
Uptime                    0 days 0 hr. 9 min. 40 sec
Trace Level              off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File        /u01/app/oracle/10.2.0/db/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle11g)(PORT=1521)))
Services Summary...
Service "test" has 1 instance(s).
  Instance "test", status BLOCKED, has 1 handler(s) for this service...
Service "test_XPT" has 1 instance(s).
  Instance "test", status BLOCKED, has 1 handler(s) for this service...
The command completed successfully


從上面的資訊可以看到Instance "test",status BLOCKED,對於ora-12528錯誤在MOS有一篇文章描述造成這種問題的原因:
Cause

When an instance is in restricted mode, PMON updates the listener with that information and blocks new connections from being established.

The lsnrctl services output will show the handler is blocked for new connections or lsnrctl status may show the instance is in RESTRICTED mode.


解決方案如下:
The (UR=A) clause for TNS connect strings was created in response to an enhancement request.  This clause can be inserted into the "(CONNECT_DATA=" section of a TNS connect string and allow a privileged or administrative user to connect via the listener even when the service handler is blocking connections for non-privileged users.

Here's an example of a connect string configured with (UR=A):

PROD =
  (DESCRIPTION =
    (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = myhost.oracle.com)(PORT = 1521)))
      (CONNECT_DATA =
          (UR=A)
          (SERVICE_NAME = prod10ib.oracle.com)
      )
    )

 

Please note that the (UR=A) clause is intended to work with a dynamically registered handler so the use of SERVICE_NAME versus SID is required when using dynamic registration (i.e. handler exists in lsnrctl output but is BLOCKED).  The use of SID in a TNS connect string may allow a connection if using a static handler in the listener.ora file under SID_DESC.


4.修改tns檔案增加(UR=A)
[oracle@oracle11g admin]$ vi tnsnames.ora

test =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.2)(PORT = 1521))
    )
    (CONNECT_DATA =
    (UR=A)
    (SERVICE_NAME = test)
    )
  )


jy =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.56.11)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = jy)
    )
  )


5.再次串連目標資料庫執行恢複
[oracle@oracle11g admin]$ rman target sys/zzh_2046@test catalog rman/rman@jy

Recovery Manager: Release 10.2.0.5.0 - Production on Sun Feb 1 23:04:03 2015

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: test (not mounted)
connected to recovery catalog database

RMAN> restore controlfile;

Starting restore at 01-FEB-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK

channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/10.2.0/db/dbs/c-2155613261-20150201-01
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/app/oracle/10.2.0/db/dbs/c-2155613261-20150201-01 tag=TAG20150201T213315
channel ORA_DISK_1: restore complete, elapsed time: 00:00:04
output filename=/u01/app/oracle/oradata/test/control01.ctl
output filename=/u01/app/oracle/oradata/test/control02.ctl
output filename=/u01/app/oracle/oradata/test/control03.ctl
Finished restore at 01-FEB-15

RMAN> sql 'alter database mount';

sql statement: alter database mount
released channel: ORA_DISK_1

RMAN> recover database;

Starting recover at 01-FEB-15
Starting implicit crosscheck backup at 01-FEB-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
Crosschecked 8 objects
Finished implicit crosscheck backup at 01-FEB-15

Starting implicit crosscheck copy at 01-FEB-15
using channel ORA_DISK_1
Crosschecked 6 objects
Finished implicit crosscheck copy at 01-FEB-15

searching for all files in the recovery area
cataloging files...
no files cataloged

using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 3 is already on disk as file /u01/app/oracle/oradata/test/redo03.log
archive log thread 1 sequence 4 is already on disk as file /u01/app/oracle/oradata/test/redo01.log
archive log filename=/u01/app/oracle/oradata/test/redo03.log thread=1 sequence=3
archive log filename=/u01/app/oracle/oradata/test/redo01.log thread=1 sequence=4
media recovery complete, elapsed time: 00:00:01
Finished recover at 01-FEB-15

RMAN> sql 'alter database open resetlogs';

sql statement: alter database open resetlogs
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete


出現這個問題的原因是當使用動態註冊監聽時,當執行個體處於限制模式或受阻的情況下PMON將會更新監聽程式來阻新的串連,解決方案其實有兩種:
 一是在tns串連描述串中增加(UR=A)子句來讓動態監聽程式使用service_name來進行註冊
 二是使用靜態監聽註冊

--------------------------------------推薦閱讀 --------------------------------------

RMAN 配置歸檔日誌刪除策略

Oracle基礎教程之通過RMAN複製資料庫

RMAN備份策略制定參考內容

RMAN備份學習筆記

OracleDatabase Backup加密 RMAN加密

--------------------------------------分割線 --------------------------------------

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.