Blog

Blog

Duplicate : RMAN-06217 et RMAN-04006

Vous avez une nouvelle machine qui doit héberger une standby et vous voulez qu'rman s'en occupe tout seul comme il sait si bien le faire. Vous avez donc créé un pfile minimal et avez démarré l'instance. la base est en nomount. (Ben oui, elle peut pas aller plus loin, y a pas de control file.) Les fichiers tnsnames et de mots de passe sont OK. Le listener tourne, bref tout marche, sauf que non!

Arrivée de la RMAN-06217

Vous tentez donc une connexion rman comme ça : (Dans mes exemples la primaire s'appelle rachel et la standby trenton)
rman target sys/xxx@rachel auxiliary /
et ça semble marcher :
Recovery Manager: Release 11.2.0.1.0 - Production on Mon Oct 3 10:25:57 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database: RACHEL (DBID=YYY)
connected to auxiliary database: TRENTON (not mounted)
RMAN
puis, bous lancez votre duplicate et arrive l'erreur fatidique (sans avoir été invitée):

run 
{
allocate auxiliary channel t1 type disk;
allocate channel t2 type disk;
duplicate target database for standby from active database password file spfile;
}

using target database control file instead of recovery catalog
allocated channel: t1
channel t1: SID=95 device type=DISK

allocated channel: t2
channel t2: SID=13 device type=DISK

Starting Duplicate Db at 03-OCT-11
released channel: t1
released channel: t2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 10/03/2011 10:26:15
RMAN-06217: not connected to auxiliary database with a net service name

Arrivée de la RMAN-04006

Vous remplissez donc consciencieusement votre tnsnames.ora. Vous faites même un petit tnsping pour être sûr :
tnsping trenton

TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 03-OCT-2011 10:36:03

Copyright (c) 1997, 2009, Oracle.  All rights reserved.

Used parameter files:
/admin/oracle/network/admin/sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = yyy)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = TRENTON)))
OK (0 msec)
Fiers de vous, vous lancez donc la commande qui doit marcher :
rman target sys/xxx@rachel auxiliary sys/xxx@trenton

Recovery Manager: Release 11.2.0.1.0 - Production on Mon Oct 3 10:27:25 2011

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

connected to target database: RACHEL (DBID=YYY)
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04006: error from auxiliary database: ORA-12528: TNS:listener: all appropriate instances are blocking new connections
Et le pire, c'est que c'est logique! La BDD secondaire n'a pas pu s'enregistrer auprès du listener (ben oui, elle est toujours à l'état nomount), on ne peut donc pas se connecter en utilisant un service name!

La solution

D'après la note metalink Connection to Auxilary using connect string failed with ORA-12528 (Doc ID 419440.1) (Attention, authentification nécessaire), il faut modifier le tnsnames comme ça :

TRENTON =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = yyy)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TRENTON)
      (UR=A)
    )
  )