We know that asm is full of metadata . It is advisable to backup the metadata ,incase if asm instance crash or issue with particalu diskgroups. 11gR1 includes the facility to take metadata backup and restore.
md_backup and md_restore are asmcmd commands.
This script will help you to take metadata backup
dtm=`date +%d%m%y%H%M%S`
LOG_FILE=/tmp/asm_backup.${dtm}
rm /app/oracle/TEST/backup/export/asm_dg.backup
HOSTNAME=`hostname`
if [ -s /etc/oratab ] ; then
ORATAB=/etc/oratab
elif [ -s /var/opt/oracle/oratab ] ; then
ORATAB=/var/opt/oracle/oratab
elif [ -s /etc/opt/oracle/oratab ] ; then
ORATAB=/etc/opt/oracle/oratab
else
echo "ORATAB is missing" 2>&1 1>> $LOG_FILE
cat $LOG_FILE
exit 1
fi
cat ${ORATAB}|awk -F\# '{print $1}'|grep -v '^$'|awk -F\: '{print $1" "$2" "$3}' |while read ORACLE_SID ORACLE_HOME BOOT_FLAG
do
if [ "${ORACLE_SID}" = "+ASM" -a "${BOOT_FLAG}" = "Y" ] ; then
export ORACLE_SID
export ORACLE_HOME
export BOOT_FLAG
PATH=$ORACLE_HOME/bin:$PATH
export PATH
asmcmd lsdg
asmcmd md_backup -b /app/oracle/TEST/backup/export/asm_dg.backup #ASMCMD> md_restore -t full -g RECOVER /tmp/dg.backup
fi
done
Dear Friends, The content in this blog are purely based on my own opinion ,it is not reflecting any of my current or previous employers materials or official documents. All my posts here are not warranted to be free of errors. Please use at your own risk and after thorough testing in your environment. If you feel that i am violating any of the company's policies or documents, kindly mail me at jeyaseelan.hi@gmail.com,I am happy to take out those content from this blog.
Subscribe to:
Post Comments (Atom)
-
We may not be able to disable the logtransport when the database is in maximum availabilty mode. We may get the below error DGMGRL...
-
Error Messages: We may get the following error messages while doing ASM operations ORA-15137: The ASM cluster is in rolling patch state....
-
MIRA - Multi Instance Redo Apply - 12cR2 onwards/18C With Oracle 12c Release 2, We can enable Multi Instance Redo apply ( MIR...
No comments:
Post a Comment