home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / database / oracle / 2158 < prev    next >
Encoding:
Text File  |  1992-11-09  |  1.7 KB  |  50 lines

  1. Newsgroups: comp.databases.oracle
  2. Path: sparky!uunet!walter!qualcom.qualcomm.com!athena!kpalm
  3. From: kpalm@athena.qualcomm.com (Kent Palm)
  4. Subject: Re: dd backup of databases on a raw device
  5. Message-ID: <kpalm.720318029@athena>
  6. Sender: news@qualcomm.com
  7. Nntp-Posting-Host: athena.qualcomm.com
  8. Organization: Qualcomm, Inc., San Diego, CA
  9. References: <BwsuJo.C5@news.orst.edu>
  10. Date: Thu, 29 Oct 1992 00:20:29 GMT
  11. Lines: 37
  12.  
  13. Here's a little excerpt from my backup script that might help.  I've left out
  14. some things (e.g., variable assignments), but you can easily set them up.
  15.  
  16. #!/bin/sh -h
  17. #-------------------------------------------------------------------------------
  18. CopyThisFile()
  19. {
  20. # Begin copying from the raw devices to the tape drive. 
  21. #
  22. # Don't use a bs size > 32.  Larger block sizes are less reliable.
  23. # Also, the bs must be a multiple of the Oracle block size (i.e., 2048)
  24. #
  25. echo "Copying the ${File} File/Tablespace (${ORACLE_SID})..." | tee -a ${BackupLog}
  26. echo "   Start: `date`." | tee -a ${BackupLog}
  27. mt -f ${OutputDevice} status >> ${BackupLog} 2>&1
  28. dd if=${InputFile}\
  29.    of=${OutputDevice}\
  30.    bs=${BlockSize}\
  31.    count=${Count} >> ${BackupLog} 2>&1
  32. echo "   Finish: `date`." | tee -a ${BackupLog}
  33. return
  34. }
  35. #-------------------------------------------------------------------------------
  36. if [ "${BackupType}" = "Cold" ]
  37. then
  38.    File=CONTROL InputFile=${CONTROL} BlockSize=32k Count=999999
  39.    CopyThisFile
  40. fi
  41. #--------------------
  42. File=REDO1 InputFile=${REDO1} BlockSize=32k Count=999999
  43. CopyThisFile
  44. #--------------------
  45. File=REDO2 InputFile=${REDO2} BlockSize=32k Count=999999
  46. CopyThisFile
  47. #--------------------
  48. File=Pfile InputFile=${PFILE} BlockSize=32k Count=999999
  49. CopyThisFile
  50.