#!/bin/ksh
# -------------------------------------------------------------------------
# This is a shell script for making exports directly to tape with a label.
# This label contains the db name and timestamp.
#
# This script also verifies the tape's protection. If the tape is
# protected it will display an error message and ask for a new tape.
#
# Another function lists the tape's label and its contents (option show=y
# of export).
#
# This script also writes a history log with dbname and timestamp.
#
# Sergio Klimberg <sklimberg@hotmail.com>
# -------------------------------------------------------------------------
clear
echo ' ORACLE TAPE EXPORTS '
echo ' ------------------- '
b=' '
while [ "$b" != "end" ]
do
echo
echo "* Enter DB for backup or list / Type 'end' to finish"
echo ' '
read b
if [ "$b" = "end" ]
then
exit
fi
echo ' '
echo "* Mount the tape and hit Enter or type 'list' / Type 'end' to finish"
echo ' '
echo ' - Warning , Verify tape is not protected for backup '
echo ' - If are you going to list the result will appear on screeen and into /tmp/list.txt'
echo ' '
read a
echo ' '
read a
if [ "$a" = "end" ]
then
exit
fi
mt -t /dev/rmt/0m rew
#
if [ "$a" = "list" ]
then
echo
echo "<= Export's Header =>"
tar tf /dev/rmt/0mn
echo " "
echo "* Hit Enter for show the export's remainder / Type 'end' to finish"
echo ' '
read c
if [ "$c" = "end" ]
then
exit
fi
echo 'file=/dev/rmt/0m ' >list.imp
echo 'log=/tmp/list.txt' >>list.imp
echo 'show=y' >>list.imp
echo 'volsize=4000M' >>list.imp
echo 'full=y ' >>list.imp
echo 'back/xxxxxx@'$b >>list.imp
imp parfile=list.imp 2>&1
echo
echo "Type 'end' to finish "
read d
exit
fi
HORA="`date '+%d-%m-%y %H:%M:%S'`"
DESC_EXPORT="EXPORT $b $HORA"
touch "$DESC_EXPORT"
tar cvf /dev/rmt/0mn "$DESC_EXPORT" 2>/dev/null
RTA=$?
while [ $RTA != 0 ]
do
echo "Tape protected , Hit ENTER when it's ready / Type 'end' to finish"
read RTA1
if [ "$RTA1" = "end" ]
then
exit
fi
tar cvf /dev/rmt/0mn "$DESC_EXPORT" 2>/dev/null
RTA=$?
done
TIME_START="`date '+%d/%m/%y %H:%M:%S'`"
echo 'back/xxxxxx@'$b >PARAMETERS.EXP
echo 'file=/dev/rmt/0m ' >>PARAMETERS.EXP
echo 'log=export.log' >>PARAMETERS.EXP
echo 'volsize=4000M' >>PARAMETERS.EXP
echo 'full=y ' >>PARAMETERS.EXP
echo ' ' >>all_export.log
echo 'EXPORT OF : '$b >>all_export.log
echo 'START : ' $TIME_START >>all_export.log
echo ' ' >>all_export.log
exp parfile=PARAMETERS.EXP 2>&1 | tee -a all_export.log
echo ' ' >>all_export.log
TIME_END="`date '+%d/%m/%y %H:%M:%S'`"
echo 'END : ' $TIME_END >>all_export.log
echo "$TIME_START | $TIME_END | $b ">>export_resumen.log
echo ' '
echo "$TIME_START | $TIME_END | $b ">>export_resumen.log
echo ' '
echo Export $b end OK
done
# -------------------------------------------------------------------------
# This is a shell script for making exports directly to tape with a label.
# This label contains the db name and timestamp.
#
# This script also verifies the tape's protection. If the tape is
# protected it will display an error message and ask for a new tape.
#
# Another function lists the tape's label and its contents (option show=y
# of export).
#
# This script also writes a history log with dbname and timestamp.
#
# Sergio Klimberg <sklimberg@hotmail.com>
# -------------------------------------------------------------------------
clear
echo ' ORACLE TAPE EXPORTS '
echo ' ------------------- '
b=' '
while [ "$b" != "end" ]
do
echo
echo "* Enter DB for backup or list / Type 'end' to finish"
echo ' '
read b
if [ "$b" = "end" ]
then
exit
fi
echo ' '
echo "* Mount the tape and hit Enter or type 'list' / Type 'end' to finish"
echo ' '
echo ' - Warning , Verify tape is not protected for backup '
echo ' - If are you going to list the result will appear on screeen and into /tmp/list.txt'
echo ' '
read a
echo ' '
read a
if [ "$a" = "end" ]
then
exit
fi
mt -t /dev/rmt/0m rew
#
if [ "$a" = "list" ]
then
echo
echo "<= Export's Header =>"
tar tf /dev/rmt/0mn
echo " "
echo "* Hit Enter for show the export's remainder / Type 'end' to finish"
echo ' '
read c
if [ "$c" = "end" ]
then
exit
fi
echo 'file=/dev/rmt/0m ' >list.imp
echo 'log=/tmp/list.txt' >>list.imp
echo 'show=y' >>list.imp
echo 'volsize=4000M' >>list.imp
echo 'full=y ' >>list.imp
echo 'back/xxxxxx@'$b >>list.imp
imp parfile=list.imp 2>&1
echo
echo "Type 'end' to finish "
read d
exit
fi
HORA="`date '+%d-%m-%y %H:%M:%S'`"
DESC_EXPORT="EXPORT $b $HORA"
touch "$DESC_EXPORT"
tar cvf /dev/rmt/0mn "$DESC_EXPORT" 2>/dev/null
RTA=$?
while [ $RTA != 0 ]
do
echo "Tape protected , Hit ENTER when it's ready / Type 'end' to finish"
read RTA1
if [ "$RTA1" = "end" ]
then
exit
fi
tar cvf /dev/rmt/0mn "$DESC_EXPORT" 2>/dev/null
RTA=$?
done
TIME_START="`date '+%d/%m/%y %H:%M:%S'`"
echo 'back/xxxxxx@'$b >PARAMETERS.EXP
echo 'file=/dev/rmt/0m ' >>PARAMETERS.EXP
echo 'log=export.log' >>PARAMETERS.EXP
echo 'volsize=4000M' >>PARAMETERS.EXP
echo 'full=y ' >>PARAMETERS.EXP
echo ' ' >>all_export.log
echo 'EXPORT OF : '$b >>all_export.log
echo 'START : ' $TIME_START >>all_export.log
echo ' ' >>all_export.log
exp parfile=PARAMETERS.EXP 2>&1 | tee -a all_export.log
echo ' ' >>all_export.log
TIME_END="`date '+%d/%m/%y %H:%M:%S'`"
echo 'END : ' $TIME_END >>all_export.log
echo "$TIME_START | $TIME_END | $b ">>export_resumen.log
echo ' '
echo "$TIME_START | $TIME_END | $b ">>export_resumen.log
echo ' '
echo Export $b end OK
done
기업100%환급/오라클/자바/스프링/안드로이드/닷넷C#/웹퍼블리싱… | 12-27 | 2022 | ||
[채용예정교육]오라클자바개발잘하는신입뽑기2개월과정,교육전취… | 12-11 | 1478 | ||
53 | [평일주간]100%환급6건,안드로이드,자바,C#,스프링3.2,SQL,힌트/… | 03-15 | 1233 | |
52 | [기업100%환급]C#4.0,WinForm,ADO.NET프로그래밍 | 01-31 | 1392 | |
51 | [평일,기업100%환급]SQL기초에서 Schema Object까지 | 01-31 | 1254 | |
50 | [평일야간]HTML5, CSS3,Ajax, jQuery마스터과정 | 01-31 | 1083 | |
49 | [평일주간,평일야간,주말]Spring,MyBatis,Hibernate개발자과정 | 01-19 | 1395 | |
48 | [평일주간,평일야간,주말]안드로이드개발자과정 | 01-11 | 1225 | |
47 | [평일야간,주말주간]JAVA,Network&JSP&Spring,MyBatis,Hibernate | 01-03 | 1724 | |
46 | 기업100%환급/오라클/자바/스프링/안드로이드/닷넷C#/웹퍼블리싱… | 12-27 | 2022 | |
45 | [기업100%환급,평일주간]자바기초에서 JDBC, Servlet/JSP까지 | 12-19 | 1491 | |
44 | [평일야간, 주말]웹퍼블리싱 마스터(HTML5,CSS3,jQUERY,AJAX,Jav… | 12-14 | 1468 | |
43 | [채용예정교육]오라클자바개발잘하는신입뽑기2개월과정,교육전취… | 12-11 | 1478 | |
42 | [평일,기업100%환급]자바기초에서 JDBC, Servlet/JSP까지 | 12-09 | 1182 | |
41 | [평일야간, 주말]닷넷(C#,Network,ADO.NET,ASP.NET)마스터 | 12-01 | 1396 | |
40 | [기업100%환급]C#4.0,WinForm,ADO.NET프로그래밍(평일주간(단기)… | 12-01 | 1544 | |
39 | [평일야간,주말]SQL기초에서실무까지(SQL기초,PLSQL,힌트,튜닝) | 12-01 | 1050 |
댓글 없음:
댓글 쓰기