2014년 9월 29일 월요일

[백업/복구]Tape에 직접 Backup하는 Script [ORACLE/SQL/HINT/오라클/교육/강의/강좌/SQL교육/오라클 PLSQL/강의/강좌/오라클교육/ORACLE초보교육/오라클실무강좌]

#!/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 



 기업100%환급/오라클/자바/스프링/안드로이드/닷넷C#/웹퍼블리싱… 오라클자바…12-272022
 [채용예정교육]오라클자바개발잘하는신입뽑기2개월과정,교육전취…오라클자바…12-111478
53 [평일주간]100%환급6건,안드로이드,자바,C#,스프링3.2,SQL,힌트/… 오라클자바…03-151233
52 [기업100%환급]C#4.0,WinForm,ADO.NET프로그래밍 오라클자바…01-311392
51 [평일,기업100%환급]SQL기초에서 Schema Object까지 오라클자바…01-311254
50 [평일야간]HTML5, CSS3,Ajax, jQuery마스터과정 오라클자바…01-311083
49 [평일주간,평일야간,주말]Spring,MyBatis,Hibernate개발자과정 오라클자바…01-191395
48 [평일주간,평일야간,주말]안드로이드개발자과정 오라클자바…01-111225
47 [평일야간,주말주간]JAVA,Network&JSP&Spring,MyBatis,Hibernate 오라클자바…01-031724
46 기업100%환급/오라클/자바/스프링/안드로이드/닷넷C#/웹퍼블리싱… 오라클자바…12-272022
45 [기업100%환급,평일주간]자바기초에서 JDBC, Servlet/JSP까지 오라클자바…12-191491
44 [평일야간, 주말]웹퍼블리싱 마스터(HTML5,CSS3,jQUERY,AJAX,Jav… 오라클자바…12-141468
43 [채용예정교육]오라클자바개발잘하는신입뽑기2개월과정,교육전취… 오라클자바…12-111478
42 [평일,기업100%환급]자바기초에서 JDBC, Servlet/JSP까지 오라클자바…12-091182
41 [평일야간, 주말]닷넷(C#,Network,ADO.NET,ASP.NET)마스터 오라클자바…12-011396
40 [기업100%환급]C#4.0,WinForm,ADO.NET프로그래밍(평일주간(단기)… 오라클자바…12-011544
39 [평일야간,주말]SQL기초에서실무까지(SQL기초,PLSQL,힌트,튜닝) 오라클자바…12-011050

댓글 없음:

댓글 쓰기