Forum Stats

  • 3,770,334 Users
  • 2,253,095 Discussions
  • 7,875,407 Comments

Discussions

Upgraded from 12.2.0.1 to 19.3 rman in crontab stopped working

TheLonelyDBA
TheLonelyDBA Member Posts: 153 Blue Ribbon
edited Jun 12, 2020 9:19AM in Recovery Manager (RMAN)

12.2.0.1->19.3

Two node RAC

RHEL7

Hi,

we are seeing a strange error, after an upgrade our crontab script fails with:

RMAN-00554: initialization of internal recovery manager package failed

RMAN-04005: error from target database:

ORA-12547: TNS:lost contact

crontab:

/appl/oraapp/oracle/bin/level-arch.sh 1 tyrprod1 /appl/oraapp/oracle/product/19.0.0/db

This script worked fine before the upgrade. No invalid objects in the database.

I can run:

rman

connect target

connect catalog

rman script

that works fine.

I get the same error running this from the cmd:

rman target / catalog rman/[email protected]

rman target /

also gets the same error

Any ides?

Regards

TheLonelyDBA

Joerg.Sobottka
«1

Answers

  • Dude!
    Dude! Member Posts: 22,826 Black Diamond
    edited May 27, 2020 5:32AM
    I get the same error running this from the cmd:rman target / catalog rman/[email protected] target /also gets the same error

    I suggest to fix command line first than move on to crontab.

    Show the following output:

    $ id

    Are you using the oracle account?

    Does you account have the appropriate privs, e.g. dba.

    Are you setting the environment correctly, e.g. :

    $ source oraenv <<< ORACLE_SID

    (where ORACLE_SID is the actual SID or your target database".

  • TheLonelyDBA
    TheLonelyDBA Member Posts: 153 Blue Ribbon
    edited May 27, 2020 6:54AM

    Hi,

    Pretty sure we need to use relink all, I have trippled check all env variables, SID, ID etc.

    Regards

    TheLonelyDBA

  • f10r1n-Oracle
    f10r1n-Oracle Posts: 60 Employee
    edited May 27, 2020 8:17AM

    Hi,

    What about sqlplus? Any errors there? if not, first I would try only to recreate rman packages:

    @$ORACLE_HOME/rdbms/admin/dbmsrman.sql

    @$ORACLE_HOME/rdbms/admin/prvtrmns.plb

    If same error then try relink rman ( below is also for executables: oracle, exp, imp, sqlldr, tkprof, mig, dbv, orapwd, rman, svrmgrl, ogms, ogmsctl..)

    cd $ORACLE_HOME/rdbms/lib

    make -f ins_rdbms.mk install

    Regards

  • Joerg.Sobottka
    Joerg.Sobottka Senior Consultant and Oracle Ace Member Posts: 596 Bronze Trophy
    edited May 27, 2020 8:38AM

    Please check if $ORACLE_BASE is set correctly (I had that once as ORACLE_BASE was set to ORACLE_HOME instead of ORACLE_BASE).

    Also check for the ORABASETAB configuration file in the install subdirectory - there may be a wrong entry inside.

  • TheLonelyDBA
    TheLonelyDBA Member Posts: 153 Blue Ribbon
    edited May 28, 2020 12:57AM

    Hi all,

    A relink all did help with the cmd, this works fine now:

    rman target / catalog rman/[email protected]

    and connecting as / as sysdba

    But the crontab job still gets the same error.

    Regards

    TheLonelyDBA

  • Joerg.Sobottka
    Joerg.Sobottka Senior Consultant and Oracle Ace Member Posts: 596 Bronze Trophy
    edited May 28, 2020 3:15AM

    Hi,

    can you provide the shell script in total?

    How do you set the Oracle Environment for RMAN?

    Do you use .oraenv within your script? Do you set all environment variables one by one?

    I normally take the SID as first input parameter for my script, so I do  set:

    export ORACLE_SID=$1

    ORAENV_ASK=NO

    . oraenv 1>/dev/null 2>&1

    Regards

    Joerg

  • Dude!
    Dude! Member Posts: 22,826 Black Diamond
    edited May 28, 2020 5:43AM

    What happened that you have to relink the Oracle binaries? I can't see how upgrading from 12c to 19c would require to relink the Oracle installation. If this indeed made the difference, then I would think you have much bigger problems, such as filesystem corruption. Did you resize any filesystems to perform the upgrade? If yes, then I would consider the system damaged beyond repair and you are going to run into more strange issues.

  • Dude!
    Dude! Member Posts: 22,826 Black Diamond
    edited May 28, 2020 6:07AM

    There seems to be a common misconception to define the Oracle environment in the login scripts, such as .profile or .bashrc. Some people even execute the login scripts to define the shell environment when needed. This is unnecessary and certainly prone to errors.

    Btw,

    export ORACLE_SID=$1ORAENV_ASK=NO. oraenv 1>/dev/null 2>&1

    There's no need to export ORACLE_SID since you're source executing oraenv (dot space)

    Crontab does not perform a login, hence won't read the user login script. Crontab only knows of /bin and /usr/bin if I recall correctly, hence it is necessary to specify the path to oraenv.

    For example:

    source /usr/local/bin/oraenv <<< ORCL &>-
  • Joerg.Sobottka
    Joerg.Sobottka Senior Consultant and Oracle Ace Member Posts: 596 Bronze Trophy
    edited May 28, 2020 3:15PM

    I do set in the script

    PATH=$PATH:/usr/local/bin

    So the path to oraenv is included in the script before oraenv is called.

    And there is no login script or something else involved.

  • Dude!
    Dude! Member Posts: 22,826 Black Diamond
    edited May 28, 2020 3:26PM
    And there is no login script or something else involved

    I wasn't talking about you but some people apparently do run the login scripts to set the oracle environment, which is of course sub-optimal.

    Joerg.Sobottka