Solved

Oracle backup scripts from commcell

  • 12 July 2022
  • 3 replies
  • 1301 views

Badge +4

Hello,

We are trying to perform Oracle backups from a script on the client. We have tested running the script from rman and the backup works perfectly.

But executing it from the Commcell in the pre backup option, but it always fails indicating the following errors:


Failed with Oracle DB/RMAN error [RMAN-00558: error encountered while parsing input commands RMAN-01006: error signaled during parse RMAN-02001: unrecognized punctuation symbol "/" RMAN-00558: error encountered while parsing input commands RMAN-01009: syntax error: found "}": expecting one of: "advise, allocate, alter, analyze, associate statistics, audit, backup, begin, @, call, catalog, change, comment, commit, configure, connect, convert, copy, create, create catalog, create global, create script, create virtual, crosscheck, declare, delete, delete from, describe, describe catalog, disassociate statistics, drop, drop catalog, drop database, duplicate, exit, explain plan, flashback, flashback table, grant, grant catalog, grant register, host, import, insert, list, lock, merge, mount, noaudit, open, print, purge, quit, recover, register, release, rename, repair, replace, report, " RMAN-01007: at line 1 column 1

icon

Best answer by Gowri Shankar 17 August 2022, 20:01

View original

3 replies

Userlevel 4
Badge +12

Good day @EJIE 

 

Could you please provide more details on how you pass the script ?

What does the script do ?

Is it via FS backup (pre/Post) script ? 

 

The pre/post scripts run a root, if its a rman script then it needs to include the commands to switch user as oracle and execute the script.

 

The best way to isolate the issue is to run the script as root as a shell script.

 

  1. Ensure the Unix/Linux shell script has appropriate permissions
  2. Include sheband in the first line of the shell script which calls the rman script.

 

Regards,

Gowri Shankar

Badge +4

Hello @Gowri Shankar ,

 

What does the script do ?

a full online backup

 

Is it via FS backup (pre/Post) script ? 

We call it the scrip on pre, dont use post

 

the script is this:
 

Script prueba.sh

 

#!/bin/ksh

######################################

maquina=`hostname`

########################################

 

DATE=`date '+%Y%m%d'`

TIME=`date '+%H:%M:%S'`

DATE_TIME=`date '+%Y/%m/%d,%H:%M:%S'`

export  NLS_LANG=AMERICAN_AMERICA.WE8DEC;

export  NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS';

 

export ORACLE_SID=BCKP12

export ORACLE_HOME=/oracle/db/app/product/12.2.0/dbhome_2004

export ORACLE_SID=BCKP12

export LD_LIBRARY_PATH=/oracle/db/app/product/12.2.0/dbhome_2004/lib

export ORACLE_BASE=/oracle/dbbase

export PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin:/home/oracle/.local/bin:/home/oracle/bin:/oracle/db/app/product/12.2.0/dbhome_2004/bin

 

 

export MENS=/oracle/dbbase/admin/BCK12/prueba.log

 

echo "Resultado del borrado de archivers en `hostname -s` de ${ORACLE_SID}" >> $MENS

date >>$MENS

echo >>$MENS

 

echo "PRUEBAS (B.D.: ${ORACLE_SID}):" > $MENS

 

# /oracle/dbbase/admin/BCK12/ ${ORACLE_SID}

echo "PRUEBA DE ${ORACLE_HOME} en $DATE de $ORACLE_SID  `hostname`" > $MENS

 

 

${ORACLE_HOME}/bin/rman target '"sysbackup/****BCKP12 as sysbackup"'  catalog E99_RMAN12C_LB/******@E99_RMAN12C_LB_WLT cmdfile=/oracle/dbbase/admin/BCK12/backup.rcv log=/oracle/dbbase/admin/BCK12/test_rman.log APPEND debug trace=/oracle/dbbase/admin/BCK12/test_rman.trc

<<FINRMAN

 

 

 

Script RMAN backup.rcv

[oracle@V99SRH-009908 BCK12]$ cat backup.rcv

run {

allocate channel ch1 type 'sbt_tape'

PARMS="SBT_LIBRARY=/exp/BKP12/commvault_zaintza/commvault2/Base/libobk.so, BLKSIZE=1048576 ENV=(CV_mmsApiVsn=2,ThreadCommandLine= -cn v99SRH-009908 -vm Instance002)"

TRACE 0;

report schema;

backup incremental level 0

section size 50G filesperset=8

check logical database include current controlfile  plus archivelog

tag='BCKP12_hot_lvl_0'

format='%d_HOT_lvl_0_%d_%s_%p_%t';

}

 

##############################################################

thank you,

regards.

Userlevel 4
Badge +12

Hi @EJIE 

 

Please remove the parameters marked in green and replace them with the SBT parameters 

CvInstanceName=Instance001 

 

allocate channel ch1 type 'sbt_tape'

PARMS="SBT_LIBRARY=/exp/BKP12/commvault_zaintza/commvault2/Base/libobk.so, BLKSIZE=1048576 ENV=(CV_mmsApiVsn=2,ThreadCommandLine= -cn v99SRH-009908 -vm Instance002)"

 

How to find CvInstanceName on the Linux server.

Connect to the linux server as root and run commvault status

The very first line will show the instance name.

By default if there is only 1 commvault instance running on the server then it would be Instance001

 

SBT Parameters  → https://documentation.commvault.com/2022e/expert/20672_oracle_agent_sbt_parameters.html

 

Regards,

Gowri Shankar

 

Reply