Veritas-bu

Re: [Veritas-bu] oracle hot backup

2007-06-06 14:59:47
Subject: Re: [Veritas-bu] oracle hot backup
From: "Clem Kruger (C)" <KrugerC2 AT telkom.co DOT za>
To: <Abhishek.Dhingra AT mindspeed DOT com>, <ckstehman AT pepco DOT com>
Date: Tue, 5 Jun 2007 14:58:22 +0200
Good day,
 
This is what we use!
 

 PV_daily.sh

#!/bin/sh

OUTF=${0}.out

# if [ -f "$OUTF" ]
# then
# rm -f "$OUTF"
# fi

{ # output block

echo "`date` ----------------Beginning of Script------------"
echo "Script name: $0"

# ---------------------------------------------------------------------------
# Replace /db/oracle/product/8.1.7, below, with the Oracle home path.
# ---------------------------------------------------------------------------

ORACLE_HOME=/app/oracle/product/9.2.0
export ORACLE_HOME
ORACLE_SID=PV
export ORACLE_SID
ORACLE_USER=oracle

NB_ORA_SCRIPTS=/app/oracle/local/rman

# ---------------------------------------------------------------------------
# Set the Oracle Recovery Manager name.
# ---------------------------------------------------------------------------

RMAN=rman

# ---------------------------------------------------------------------------
# Print out the value of the variables set by this script.
# ---------------------------------------------------------------------------

echo 
echo   "RMAN: $RMAN"
echo   "ORACLE_SID: $ORACLE_SID"
echo   "ORACLE_USER: $ORACLE_USER"
echo   "ORACLE_HOME: $ORACLE_HOME"
echo   "NB_ORA_SCRIPTS: $NB_ORA_SCRIPTS"

# ---------------------------------------------------------------------------
# Print out the value of the variables set by bphdb.
# ---------------------------------------------------------------------------

echo
echo   "NB_ORA_FULL: $NB_ORA_FULL"
echo   "NB_ORA_INCR: $NB_ORA_INCR"
echo   "NB_ORA_CINC: $NB_ORA_CINC"
echo   "NB_ORA_SERV: $NB_ORA_SERV"
echo   "NB_ORA_CLASS: $NB_ORA_CLASS"
echo   "NB_ORA_PC_SCHED: $NB_ORA_PC_SCHED"
echo   "NB_ORA_SCHEDULED: $NB_ORA_SCHEDULED"
echo   "NB_ORA_USER_INITIATED: $NB_ORA_USER_INITIATED"

# ---------------------------------------------------------------------------
# This script assumes that the database is properly opened. If desired,
# this would be the place to verify that.
# ---------------------------------------------------------------------------

echo 

if [ "$NB_ORA_INCR" = "1" ]
then
 echo "hot database differential incremental backup requested"
 CMDFILE=${NB_ORA_SCRIPTS}/PV_daily.rcv

elif [ "$NB_ORA_CINC" = "1" ]
then
 echo "hot database cumulative incremental backup requested"
 CMDFILE=${NB_ORA_SCRIPTS}/PV_daily.rcv

else # default
 echo "hot database backup requested (incremental level 0)"
 CMDFILE=${NB_ORA_SCRIPTS}/PV_daily.rcv
        RCMDFILE=${NB_ORA_SCRIPTS}/resync.rcv
fi

# ---------------------------------------------------------------------------
# Call Recovery Manager to initiate the backup. This example does not use a
# Recovery Catalog. If you chose to use one, remove the option, nocatalog,
# from the rman command line below and add a 'connect rcvcat' statement to
# the corresponding command file ($CMDFILE). An alternative to putting the
# connect statements in the command file would be to add them to the rman
# command line.
#
# Note: Any environment variables needed at run time by RMAN or $CMDFILE
#       must be set and exported within the switch user (su) command.
# ---------------------------------------------------------------------------

echo
# echo "% ${ORACLE_HOME}/bin/$RMAN nocatalog cmdfile '$CMDFILE'"
echo "% ${ORACLE_HOME}/bin/$RMAN catalog cmdfile '$CMDFILE'"
echo "% ${ORACLE_HOME}/bin/$RMAN catalog cmdfile '$RCMDFILE'"
echo 

su - $ORACLE_USER -c "
export PATH=/usr/bin::/opt/EMCpower/bin:/etc:/usr/sbin:/usr/ccs/bin:.:/usr/sbin:/usr/ccs/bin:/app/oracle/product/9.2.0:.
export LD_LIBRARY_PATH=/app/oracle/product/9.2.0/lib:
export ORACLE_HOME=/app/oracle/product/9.2.0
export ORACLE_SID=PV
# ${ORACLE_HOME}/bin/$RMAN nocatalog cmdfile "$CMDFILE"
${ORACLE_HOME}/bin/$RMAN cmdfile "$CMDFILE"
"
RETURN_STATUS_BACKUP=$?
su - $ORACLE_USER -c "
export PATH=/usr/bin::/opt/EMCpower/bin:/etc:/usr/sbin:/usr/ccs/bin:.:/usr/sbin:/usr/ccs/bin:/app/oracle/product/9.2.0/bin
export LD_LIBRARY_PATH=/app/oracle/product/9.2.0/lib:
export ORACLE_HOME=/app/oracle/product/9.2.0
export ORACLE_SID=PV
# ${ORACLE_HOME}/bin/$RMAN nocatalog cmdfile "$CMDFILE"
${ORACLE_HOME}/bin/$RMAN cmdfile "$RCMDFILE"
"
RETURN_STATUS_RESYNC=$?

RETURN_STATUS=`expr $RETURN_STATUS_BACKUP + $RETURN_STATUS_RESYNC`


echo
echo "`date` ----------------End of Script------------------"
echo
echo "exit $RETURN_STATUS"
exit $RETURN_STATUS

} >> $OUTF
 

PV_daily.rcv


connect target
connect rcvcat rman9206/
 RMAN information

change archivelog all validate;
run {
# Hot database level 0 whole backup
allocate channel t1 type 'SBT_TAPE'
         PARMS="ENV=(NB_ORA_CLIENT=your-virtual-client-if-a-cluster)";
allocate channel t2 type 'SBT_TAPE'
         PARMS="ENV=(NB_ORA_CLIENT=your-virtual-client-if-a-cluster)";
sql 'alter system archive log current';
backup full
filesperset 8
tag full_hot_incl_ctl
##      skip inaccessible
(database
include current controlfile
format 'dbh%d_t%t_s%s_p%p'
);
  sql 'alter system archive log current';
  # backup all archive logs
  backup
   filesperset 8
   format 'al_%s_%p_%t'
   (archivelog all delete input);
release channel t1;
release channel t2;
}
exit;
 

Regards,

 

 

 

Clem Kruger

'Listen to what is said, not he who speaks.’ Arab Proverb.

 


From: veritas-bu-bounces AT mailman.eng.auburn DOT edu [mailto:veritas-bu-bounces AT mailman.eng.auburn DOT edu] On Behalf Of Abhishek.Dhingra AT mindspeed DOT com
Sent: 05 June 2007 14:22 PM
To: ckstehman AT pepco DOT com
Cc: VERITAS-BU AT mailman.eng.auburn DOT edu; veritas-bu-bounces AT mailman.eng.auburn DOT edu
Subject: Re: [Veritas-bu] oracle hot backup


Gurus,
    I have configured the Oracle backup script , but it is failing with the error :-

aloe:root-$PS2 cat oracle_backup.out
oracle

Script /opt/app/oracle/hot_database_backup.sh
==== started on Mon Jun 4 17:08:31 PDT 2007 ====


RMAN: /opt/app/oracle/product/9.2.0.4_32bit/bin/rman
ORACLE_SID: EVRS
ORACLE_USER: 60075
ORACLE_HOME: /opt/app/oracle/product/9.2.0.4_32bit

NB_ORA_FULL:
NB_ORA_INCR:
NB_ORA_CINC:
NB_ORA_SERV:
NB_ORA_POLICY:

Default - Full backup requested
RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 21> 22> 23> 24> 25> 26> 27> 28> 29> 30> 31> 32> 33> 34> 35> 36> 37> 38> RMAN> RS (DBID=554365534)
using target database controlfile instead of recovery catalog

RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 21> 22> 23> 24> 25> 26> 27> 28> 29> 30> 31> 32> 33> 34> 35> 36> 37> 38>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of allocate command on ch00 channel at 06/04/2007 17:08:34
ORA-19554: error allocating device, device type: SBT_TYPE, device name:
ORA-27001: unsupported device type
Additional information: 1

RMAN>

Recovery Manager complete.

Script /opt/app/oracle/hot_database_backup.sh
==== ended in error on Mon Jun 4 17:08:34 PDT 2007 ====

Any suggestions what could be the issue.

--Abhishek


ckstehman AT pepco DOT com
Sent by: veritas-bu-bounces AT mailman.eng.auburn DOT edu

06/05/2007 05:20 PM

To
VERITAS-BU AT mailman.eng.auburn DOT edu
cc
Subject
Re: [Veritas-bu] oracle hot backup






Recovery Catalog DB.  Best to put it on a different machine to avoid the "all eggs in one basket" issue.

RMAN is fully functional and is designed to work best with the DB.  


=============================
Carl Stehman
IT Distributed Services Team
Pepco Holdings, Inc.
202-331-6619
Pager 301-765-2703
ckstehman AT pepco DOT com


dy018 <netbackup-forum AT backupcentral DOT com>
Sent by: veritas-bu-bounces AT mailman.eng.auburn DOT edu

06/05/2007 01:25 AM
Please respond to
VERITAS-BU AT mailman.eng.auburn DOT edu

To
VERITAS-BU AT mailman.eng.auburn DOT edu
cc
Subject
[Veritas-bu]  Re: oracle hot backup








Can anyone explain the advantage and disadvantage of using control file as compare to using Recovery Catalog DB?

I heard from one DBA is that using Recovery Catalog DB will enable more RMAN features as compare to using control file? izit true?

+----------------------------------------------------------------------
|This was sent by dy_lan018 AT yahoo DOT com via Backup Central.
|Forward SPAM to abuse AT backupcentral DOT com.
+----------------------------------------------------------------------


_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu




This Email message and any attachment may contain information that is proprietary, legally privileged, confidential and/or subject to copyright belonging to Pepco Holdings, Inc. or its affiliates ("PHI"). This Email is intended solely for the use of the person(s) to which it is addressed. If you are not an intended recipient, or the employee or agent responsible for delivery of this Email to the intended recipient(s), you are hereby notified that any dissemination, distribution or copying of this Email is strictly prohibited. If you have received this message in error, please immediately notify the sender and permanently delete this Email and any copies. PHI policies expressly prohibit employees from making defamatory or offensive statements and infringing any copyright or any other legal right by Email communication. PHI will not accept any liability in respect of such communications.
_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This e-mail and its contents are subject to the Telkom SA Limited
e-mail legal notice available at
http://www.telkom.co.za/TelkomEMailLegalNotice.PDF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
<Prev in Thread] Current Thread [Next in Thread>