Oracle: Freeze Thaw Quiesce and Unquiesce scripts for Hitachi Virtual Infrastructure Integrator

Document created by Paul Morrissey on Feb 14, 2015
Version 1Show Document
  • View in full screen mode

Related Article Application Consistent Backup with Hitachi Virtual Infrastructure Integrator

 

pre-freeze-script.sh

 

#!/bin/sh

 

if [ "$(id -u)" -eq "0" ]; then
exec su oracle -c /oracle/oracle11g/DBA_SCRIPTS/pre-freeze.sql
fi

post-thaw-script.sh

 

#!/bin/sh

 

if [ "$(id -u)" -eq "0" ]; then
exec su oracle -c /oracle/oracle11g/DBA_SCRIPTS/post-thaw.sql
fi

 

###################################
##IF USER WANTS TO RUN A ARCHIVELOG AND CONTROLFILE BACKUP AFTER TAKING THE SNAP OF VM. HE CAN INSTALL ORACLE IDA ON THE GUEST VM AND USE BELOW SCRIPT AS SAMPLE AND MODIFY AND RUN AN ARCHIVE LOG AND CURRENT CONTROL FILE BACKUP. THIS MAKE THE VM CRASH CONSISTENT TO THIS POINT IN TIME.
#########################################

 

##if [ "$(id -u)" -eq "0" ]; then
##exec su oracle -c /oracle/oracle11g/DBA_SCRIPTS/consistent-archivelog-backup.rman
##fi

pre-freeze-script.sql

 

export ORACLE_HOME=/oracle/oracle11g
$ORACLE_HOME/bin/sqlplus "sys/sys@KPNDB as sysdba" <<EOF
spool $ORACLE_HOME/DBA_SCRIPTS/pre-freeze.log;
alter database begin backup;
spool off;
EOF

post-thaw-script.sql

export ORACLE_HOME=/oracle/oracle11g
/oracle/oracle11g/bin/sqlplus "sys/sys@KPNDB as sysdba" <<EOF
spool /oracle/oracle11g/DBA_SCRIPTS/post-thaw.log;
alter database end backup;
spool off;
EOF

consistent-archivelog-backup.rman

 

export ORACLE_HOME=/oracle/oracle11g
$ORACLE_HOME/bin/rman target sys/sys@VMFSDBcatalog vmfsdb/shankar@CATDB<<EOF1
spool log to $ORACLE_HOME/DBA_SCRIPTS/archivelog-backup.log
run
{
allocate channel ch1 type 'sbt_tape'
PARMS="SBT_LIBRARY=/opt/simpana/Base/libobk.so,ENV=(CvOraSID=VMFSDB,CvClientName=VMOracleVMFS,CvInstanceName=Instance001),BLKSIZE=262144";
sql 'alter system archive log current';
backup filesperset 32
(archivelog all);
backup current controlfile ;
}
spool off
EOF1

_______________________________________________________________________________

Accreditation: Hitachi Data Protection Suite Software Documentation

Attachments

    Outcomes