Wednesday, September 7, 2016

Oracle duplication on 12c. RMAN-04006: error from auxiliary database. RMAN-04006: error from auxiliary database: ORA-01017: invalid username/password; logon denied



Oracle 12.1.0.2.0
RMAN-04006: error from auxiliary database: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Instance "dbname", status BLOCKED, has 1 handler(s) for this service...
RMAN-04006: error from auxiliary database: ORA-01017: invalid username/password; logon denied

Solution to resolve these errors.

After upgrading my Oracle instance from 11.2 to 12.1 I tried to run the RMAN duplication.
I am using the Backup Duplication method, but I expect the same issues could arise with Active Duplication as well.

Normal preparation for duplication has been preformed. Our target database is in nomount state.
First step from the target database is to connect to the auxiliary using RMAN
RMAN> connect auxiliary sys/xxxxxx@DEV01;
RMAN-00571: =================================

 RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =
RMAN-00571: =================================
RMAN-04006: error from auxiliary database: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

LSNRCTL> status LISTENER
Instance "dev01", status BLOCKED, has 1 handler(s) for this service...

Solution:
  1. Add (UR=A) to your tnsnames.ora
  2. SERVICE_NAME entry in the tnsname.ora file should reference just the target SID and not the SID.domain_name.com
  3. Add the database as a static reference in the listener.ora file so it would be recognized even if the database was not started (in nomount state).


Example of tnsnames.ora
--------------------------------
UAT =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = uat.company.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = UAT)(UR=A)
    )
  )
Add static reference in the listener.ora file

Example of listener.ora. Add the following.
SID_LIST_LISTENER =
   (SID_LIST =
     (SID_DESC =
       (GLOBAL_DBNAME = dev01)
       (ORACLE_HOME = /app/oracle/product/12.1.0)
       (SID_NAME = dev01)
     )
  )

This should resolve the inability to connect to the target as an auxiliary while it is in no mount state.


RMAN duplication will now run but there is another issue that may crop up.

Here’s my RMAN duplication output:
Oracle instance shut down
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 08/19/2016 13:36:41
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-04006: error from auxiliary database: ORA-01017: invalid username/password; logon denied
RMAN>

Solution:

The SID in your listener needs to match the case in your password file. Update DEV01 to dev01.
Password file is orapwdev01.

That should do it. Good luck. I hope this was helpful to you.

1 comment:

  1. This is awesome solution. I was able to duplicate my primary 12c database.

    ReplyDelete

Oracle runInstaller fails on Linux, Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set.

How to get Oracle's runInstaller to run on Linux or Unix environment using from Windows using Cygwin as an xterm emulator. Download an...