This discussion is archived
7 Replies Latest reply: Dec 3, 2012 6:39 PM by mseberg RSS

Learning RMAN - ORA12560 TNS: protocol adapter error

apex_disco Newbie
Currently Being Moderated
DB 10gR2
OS Win 2k3

Firstly, my disclaimer: I am trying to learn RMAN. Reading documentations and other websites as I go.

So, I have 2 servers (let's call them ORCL01 and ORCL02) and 2 databases (let's call them ORCLPROD and ORCLTEST). I was trying to test my understanding of RMAN.

Question 1) I can backup ORCL01 from ORCL02
I login to ORCL02, and issue the following commands
D:\> SET ORACLE_SID = ORCLPROD 
D:\> RMAN TARGET / 
But I get the following errors back

RMAN-00554: initialization of internal recovery manager package failed
RMAN-04005: error from target database:
ORA-12560: TNS: protocol adapter error

However, when I issue the following commands
d:\> sqlplus username/password@orclprod
SQL> select name from v$database;

NAME
---------
ORCLPROD
So what did I do wrong? Am I wrong to think I can do RMAN backup from a different server? Or am I wrong in the way I'm going about it - setting ORACLE_SID then proceed to connect RMAN to the database?



Question 2) I cannot seem to connect RMAN to my ORCLTEST on ORCL02 either in ORCL02
RMAN> connect target /

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
ORA-01031: insufficient privileges
EDIT: Not sure if this is the right fix; but, question 2 is fixed if I add my username to ORA_DBA group. I'll keep this on here for the gurus here to comment on.



Question 3) With Question 2 fixed, I'm getting the following errors when I do SHOW ALL;
RMAN> show all;

using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of show command at 11/30/2012 14:22:25
ORA-06550: line 1, column 2273:
PLS-00302: component 'GETRANGEALBACKUP' must be declared
ORA-06550: line 1, column 2238:
PL/SQL: Statement ignored
ORA-06550: line 1, column 2453:
PLS-00302: component 'RESTORECMD_T' must be declared
ORA-06550: line 1, column 2424:
PL/SQL: Statement ignored

RMAN>
Is this because ORCLTEST has never been backed up by RMAN?

Thanks.

Edited by: apex_disco on Nov 30, 2012 12:19 PM
  • 1. Re: Learning RMAN - ORA12560 TNS: protocol adapter error
    mseberg Guru
    Currently Being Moderated
    For question 1 can you try a connect Like I show in answer 3?

    Instead of your user can you start RMAN using the user who owns the oracle software?



    For question 2

    I believe that will work. Or use a user with DBA role already.





    For question 3 can you try :
    $ORACLE_HOME/bin/rman target sys/<password> nocatalog
    
    So for windows something like :
    
    c:\oracle\product\10.2.0\db_1\bin\rman target sys/<password> nocatalog
    And post this results if error.


    Additional questions.

    Are you backing up to Disk or Tape?

    What OS are you using and what version of Oracle?


    Best Regards

    mseberg

    Edited by: mseberg on Nov 30, 2012 3:53 PM
  • 2. Re: Learning RMAN - ORA12560 TNS: protocol adapter error
    apex_disco Newbie
    Currently Being Moderated
    Thanks for the quick reply. I will test it out and update the thread.
    mseberg wrote:
    Additional questions.

    Are you backing up to Disk or Tape?

    What OS are you using and what version of Oracle?
    Backing up to Disk at this point. Just testing things out on an existing servers / dbs that is not in use.

    OS is Win2k3
    DB 10gR2
  • 3. Re: Learning RMAN - ORA12560 TNS: protocol adapter error
    Shivananda Rao Guru
    Currently Being Moderated
    Hello,
    So, I have 2 servers (let's call them ORCL01 and ORCL02) and 2 databases (let's call them ORCLPROD and ORCLTEST). I was trying to test my understanding of RMAN.

    Question 1) I can backup ORCL01 from ORCL02
    I login to ORCL02, and issue the following commands
    D:\> SET ORACLE_SID = ORCLPROD 
    D:\> RMAN TARGET / 
    But I get the following errors back

    RMAN-00554: initialization of internal recovery manager package failed
    RMAN-04005: error from target database:
    ORA-12560: TNS: protocol adapter error

    However, when I issue the following commands
    d:\> sqlplus username/password@orclprod
    SQL> select name from v$database;
    
    NAME
    ---------
    ORCLPROD
    So what did I do wrong? Am I wrong to think I can do RMAN backup from a different server? Or am I wrong in the way I'm going about it - setting ORACLE_SID then proceed to connect RMAN to the database?
    When you use the "set ORACLE_SID=ORCLPROD" on the ORCL02 server, Oracle thinks that the database ORCLPROD is residing on the server ORCL02 where you have set the ORACLE_SID and tries to connect to the database. But in reality ORCLPROD resides in ORCL01 and not in 02.
    As a result, Oracle throws the error "ORA-12560: TNS: protocol adapter error". You can connect to ORCLPROD from ORCL02 server provided you have the TNS entries setup for ORCLPROD on ORCL02 server and a listener is up and running on ORCL01 server to listen any incoming requests made by the client (eg: ORCL02).

    You can use NETCA to create a listener on ORCL01 server and also to create the TNS entries on ORCL02 server if you want to connect to the ORCLPROD database from ORCL02 server. Make sure that these two servers are able to ping each other.

    >
    Question 2) I cannot seem to connect RMAN to my ORCLTEST on ORCL02 either in ORCL02
    RMAN> connect target /
    
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    ORA-01031: insufficient privileges
    EDIT: Not sure if this is the right fix; but, question 2 is fixed if I add my username to ORA_DBA group. I'll keep this on here for the gurus here to comment on.
    This seems to be a problem with the authentication. Please post the contents of the file SQLNET.ORA located at the path "%ORACLE_HOME%\network\admin".
    Crosscheck what is the value of the parameter SQLNET.AUTHENTICATION_SERVICES in the SQLNET.ORA file and set it to NTS.

    >
    Question 3) With Question 2 fixed, I'm getting the following errors when I do SHOW ALL;
    RMAN> show all;
    
    using target database control file instead of recovery catalog
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of show command at 11/30/2012 14:22:25
    ORA-06550: line 1, column 2273:
    PLS-00302: component 'GETRANGEALBACKUP' must be declared
    ORA-06550: line 1, column 2238:
    PL/SQL: Statement ignored
    ORA-06550: line 1, column 2453:
    PLS-00302: component 'RESTORECMD_T' must be declared
    ORA-06550: line 1, column 2424:
    PL/SQL: Statement ignored
    
    RMAN>
    Is this because ORCLTEST has never been backed up by RMAN?
    No. Try connecting RMAN on ORCL02 as shown by Mseberg.
  • 4. Re: Learning RMAN - ORA12560 TNS: protocol adapter error
    apex_disco Newbie
    Currently Being Moderated
    mseberg wrote:
    For question 1 can you try a connect Like I show in answer 3?

    Instead of your user can you start RMAN using the user who owns the oracle software?
    I tried your way for question 1 & 3 - this is the error I got (with the username removed from ORA_DBA group).
    D:\>ECHO %ORACLE_SID%
    ORCLTEST
    
    D:\>D:\oracle\product\10.2.0\db_1\BIN\rman target sys/password nocatalog
    
    Recovery Manager: Release 10.2.0.3.0 - Production on Fri Nov 30 16:10:27 2012
    
    Copyright (c) 1982, 2005, 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-03113: end-of-file on communication channel
    
    D:\>
    EDIT: With my username added in ORA_DBA group, I was able to connect to ORCLTEST.


    As for ORCLPROD, I was able to connect RMAN to it using the following (without having to add my username to ORA_DBA group in ORCLPROD)
    D:\>SET ORACLE_SID=ORCLPROD
    
    D:\>ECHO %ORACLE_SID%
    ORCLPROD
    
    D:\>D:\oracle\product\10.2.0\db_1\BIN\rman target sys/password@ORCLPROD nocatalog
    
    Recovery Manager: Release 10.2.0.3.0 - Production on Fri Nov 30 16:15:17 2012
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    PL/SQL package SYS.DBMS_BACKUP_RESTORE version 10.02.00.00 in TARGET database is
     not current
    PL/SQL package SYS.DBMS_RCVMAN version 10.02.00.00 in TARGET database is not cur
    rent
    connected to target database: ORCLPROD (DBID=1340892646)
    using target database control file instead of recovery catalog
    
    RMAN>
    Edited by: apex_disco on Nov 30, 2012 2:13 PM
  • 5. Re: Learning RMAN - ORA12560 TNS: protocol adapter error
    mseberg Guru
    Currently Being Moderated
    Hello;

    Checking the error against my notes ...

    I'm thinking you have a version conflict, perhaps two different versions of rman.exe, can you confirm this? Also check you path to see if you have a possible conflict ( another oracle software home for example ) So the wrong version of rman.exe might be first in the path.

    When using Windows I would consider using a batch file and set a few things with it. For example :
    @ECHO OFF
    set ORACLE_HOME=
    set ORACLE_SID=
    set BACKUP_MEDIA=DISK
    set BACKUP_TYPE=FULL_DB_BKUP
    ::
    ::
    set TMPDIR=c:\temp
    
    
    @ECHO ON
    I find windows scripting way harder then Linux/Unix, but there are a few examples around :

    http://www.jobacle.nl/?p=849

    http://pierreroussin.wordpress.com/2008/10/28/rman-backup-script-on-windows/


    Best Regards

    mseberg
  • 6. Re: Learning RMAN - ORA12560 TNS: protocol adapter error
    apex_disco Newbie
    Currently Being Moderated
    mseberg wrote:
    Hello;

    Checking the error against my notes ...

    I'm thinking you have a version conflict, perhaps two different versions of rman.exe, can you confirm this? Also check you path to see if you have a possible conflict ( another oracle software home for example ) So the wrong version of rman.exe might be first in the path.
    I'm not sure how to check RMAN version. Found this http://blog.flimatech.com/2010/04/22/how-to-find-rman-catalog-version/ but that looks like checking for catalog version. Since both servers hasn't been backed up by RMAN before, the table mentioned in that blog was not found.

    But, if you are talking about DB version, you would be right.
    ORCLTEST - 10.2.0.5
    ORCLPROD - 10.2.0.1

    If that's the case, then, I figured 10.2.0.5 should be able to backup 10.2.0.1, can it not? Is it not backward compatible?
    When using Windows I would consider using a batch file and set a few things with it. For example :
    @ECHO OFF
    set ORACLE_HOME=
    set ORACLE_SID=
    set BACKUP_MEDIA=DISK
    set BACKUP_TYPE=FULL_DB_BKUP
    ::
    ::
    set TMPDIR=c:\temp
    
    
    @ECHO ON
    I find windows scripting way harder then Linux/Unix, but there are a few examples around :

    http://www.jobacle.nl/?p=849

    http://pierreroussin.wordpress.com/2008/10/28/rman-backup-script-on-windows/


    Best Regards

    mseberg
    Awesome awesome links. Thank you so much.
  • 7. Re: Learning RMAN - ORA12560 TNS: protocol adapter error
    mseberg Guru
    Currently Being Moderated
    Hello again;

    Given the nature of your questions I might look at this book :

    http://www.apress.com/oracle/rman/9781590598511

    There's more errata than I like, but it covers a ton of Problems with solutions that are easy to understand.

    Best Regards

    mseberg

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points