1

I'm trying to create a standby database with duplicate command.

Primary : tntdb19
Standby : mntdb19

The duplicate command begins but fails after some time

[oracle@monta191 admin]$ rman target sys/manager@tntdb19  auxiliary sys/manager@mntdb19

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Nov 1 13:24:19 2020
Version 19.7.0.0.0

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

connected to target database: TNTDB19 (DBID=2747252158)
connected to auxiliary database: TNTDB19 (not mounted)

RMAN> duplicate target database for standby from active database nofilenamecheck;

Starting Duplicate Db at 01-NOV-20
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=25 device type=DISK
...
contents of Memory Script:
{
   sql clone "create spfile from memory" ;
   shutdown clone immediate;
   startup clone nomount;
   restore clone from service  'tntdb19' standby controlfile;
}
executing Memory Script

sql statement: create spfile from memory

Oracle instance shut down

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 11/01/2020 13:27:12
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-04006: error from auxiliary database: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

as you can see at the beginning the rman connects to the primary and new standby without problem

connected to target database: TNTDB19 (DBID=2747252158)
connected to auxiliary database: TNTDB19 (not mounted)

but the problem I think that when

   shutdown clone immediate;

as part of the duplication process because the listener in this moment lose the

Service "mntdb19" has 1 instance(s).
  Instance "mntdb19", status UNKNOWN, has 1 handler(s) for this service...
Service "mntdb19.vboxlab.es" has 1 instance(s).
  Instance "mntdb191", status BLOCKED, has 1 handler(s) for this service...

This is the listener.ora in standby machine.

[grid@monta191 admin]$ cat listener.oa
cat: listener.oa: No such file or directory
[grid@monta191 admin]$ cat listener.ora
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))        # line added by Agent
LISTENER_SCAN3=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3))))        # line added by Agent
LISTENER_SCAN2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2))))        # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))        # line added by Agent
ASMNET1LSNR_ASM=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=ASMNET1LSNR_ASM))))      # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_ASMNET1LSNR_ASM=ON       # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_ASMNET1LSNR_ASM=SUBNET     # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON        # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN1=OFF     # line added by Agent - Disabled by Agent because REMOTE_REGISTRATION_ADDRESS is set
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2=ON        # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN2=OFF     # line added by Agent - Disabled by Agent because REMOTE_REGISTRATION_ADDRESS is set
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON        # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN3=OFF     # line added by Agent - Disabled by Agent because REMOTE_REGISTRATION_ADDRESS is set
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON      # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER=SUBNET        # line added by Agent

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = mntdb19)
      (ORACLE_HOME = /u01/app/grid/product/19c/grid_1)
      (SID_NAME = mntdb19)
    )
  )

I think that SID_LIST_LISTENER entry if for this problem but It doesn't works.

and tnsnames.ora

[oracle@monta191 admin]$ cat tnsnames.ora 
TNTDB19 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = tanto19-cluster-scan)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = tntdb19.vboxlab.es)
    )
  )

MNTDB19 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = monta19-cluster-scan)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = mntdb19.vboxlab.es)(UR=A)
    )
  )

Changes made after post of Balazs

Hi Balazs, I have changed GLOBAL_DBNAME and ORACLE_HOME entry in listener.ora

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = mntdb19.vboxlab.es)
      (ORACLE_HOME = /u02/app/oracle/product/19c/db_1)
      (SID_NAME = mntdb19)
    )
  )

I have differents homes for user grid (/u01/app/grid/product/19c/grid_1) and oracle user (/u02/app/oracle/product/19c/db_1). In my original post I used the grid home but now I changed by the database home.

The name of service is

NAME                     TYPE    VALUE
------------------------------------ ----------- ------------------------------
service_names                string  mntdb19.vboxlab.es

With this 2 changes the result of duplicate when shutdown the standby database still is the same

Oracle instance shut down

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 11/01/2020 18:55:30
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-04006: error from auxiliary database: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

What did I misunderstand?

Regards

2
  • Isn't this essentially the same problem you resolved yourself in your other thread, at dba.stackexchange.com/questions/278991/…
    – EdStevens
    Nov 1 '20 at 13:25
  • No, the other problem prevented me from connecting to the mounted database. Now I connect in order to launch the rman but during the duplication process is when the problem occurs. I think that The problem is different.
    – estonolose
    Nov 1 '20 at 18:20
3

Your tnsnames.ora entry:

MNTDB19 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = monta19-cluster-scan)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = mntdb19.vboxlab.es)(UR=A)
    )
  )

Your listener status:

Service "mntdb19" has 1 instance(s).
  Instance "mntdb19", status UNKNOWN, has 1 handler(s) for this service...
Service "mntdb19.vboxlab.es" has 1 instance(s).
  Instance "mntdb191", status BLOCKED, has 1 handler(s) for this service...

As part of the duplicate process, RMAN will shut down the auxiliary database instance, then start it again. In order to start it, it must be able to log in through the listener to a stopped database instance. That is why you need static listener registration.

Your auxiliary instance is in NOMOUNT state. RMAN logs in to the auxiliary instance using service name mntdb19.vboxlab.es. Connecting to a NOMOUNT instance with dynamic registration in BLOCKED state is normally not possible, but UR=A in tnsnames.ora overcomes this limitation. (Without this workaround, you could not even log in to the NOMOUNT auxiliary instance remotely.) Next RMAN shuts down your auxiliary instance, then tries connecting again using service name mntdb19.vboxlab.es again. At this point I guess this is what you have in your listener:

Service "mntdb19" has 1 instance(s).
  Instance "mntdb19", status UNKNOWN, has 1 handler(s) for this service...

You have the static entry for service name mntdb19 and that is all. No entry exists for mntdb19.vboxlab.es. But you provided that service in your tnsnames.ora, which RMAN uses.

Either use mntdb19 as service name in tnsnames.ora, or fix the static registration in listener.ora to use the correct service name:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = mntdb19.vboxlab.es)  # <-- added proper service name here
      (ORACLE_HOME = /u01/app/grid/product/19c/grid_1)
      (SID_NAME = mntdb19)
    )
  )

Also I do not think your database runs from the Grid Infrastructure ORACLE_HOME (/u01/app/grid/product/19c/grid_1). ORACLE_HOME in the above should be the database ORACLE_HOME.

3
  • I have updated my original question with the changes you have suggested but I get the same error. Those are the changes you told me about, right?
    – estonolose
    Nov 1 '20 at 18:17
  • 1
    @estonolose Yes, but one more thing. You should connect directly to the local listener listening on the VIP address on the node where you configured static registration, instead of the SCAN listener listening on the SCAN address. The static registration you configured applies to the local listener, not the SCAN listener. Earlier I did not realize you have the SCAN address in your tnsnames.ora. Nov 1 '20 at 21:47
  • I have changed the scan by the name of server in tnsnames of standby and it's works. MNTDB19 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = monta191)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = mntdb19.vboxlab.es)(UR=A) ) ) Thanks.
    – estonolose
    Nov 3 '20 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.