<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Automate database backup procedure in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031829#M132771</link>
    <description>In my own experience, we have 3 Oracle instances(no 24x7) runing on same machine, we shutdown all the instances and take a closed-database backup every night. What I am doing now is to schedule a cronjob via crontab at mid night. The script will schedule other scripts to shutdown all the 3 instances via "at" instead of "crontab". If any problem occurs, script will exit without schedule the next task. So I can check the cause of the problem at the next morning. For "less important" instances(they are for data warehouse purpose), it allows me to performs the backup in such style.</description>
    <pubDate>Thu, 24 Jul 2003 03:18:46 GMT</pubDate>
    <dc:creator>twang</dc:creator>
    <dc:date>2003-07-24T03:18:46Z</dc:date>
    <item>
      <title>Automate database backup procedure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031824#M132766</link>
      <description>Dear all,&lt;BR /&gt;&lt;BR /&gt;I want to automate the database backup procedure which auto run the backup script (Attached in the email) in the evening (I guess put it in the crontab). However, I concern that some problems may occur during the backup procedure:&lt;BR /&gt;&lt;BR /&gt;- forget to put backup tape in DD3 tape drive&lt;BR /&gt;- Backup tape error&lt;BR /&gt;- Backup tape full&lt;BR /&gt;- Tape drive error&lt;BR /&gt;- System error&lt;BR /&gt;&lt;BR /&gt;I am just a beginner writing unix script. Could you tell me how I can keep the different problems to different logs in the backup script and how can I know the problem occur immediately when I am at home? (For like Mobile phone, SMS, etc) &lt;BR /&gt;&lt;BR /&gt;Also, the Day-end process has another script (For like startup databases after Database backup, etc) after the Database backup script, how can I handle the backup script if any problem happens?&lt;BR /&gt;&lt;BR /&gt;Please give me some ideas. Thanks a lot.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;Ajk&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Jul 2003 02:09:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031824#M132766</guid>
      <dc:creator>ajk_5</dc:creator>
      <dc:date>2003-07-24T02:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Automate database backup procedure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031825#M132767</link>
      <description>Key scripting concept.&lt;BR /&gt;&lt;BR /&gt;Check the success of an operation right after you do it.&lt;BR /&gt;&lt;BR /&gt;&lt;COMMAND to="" write="" a="" file="" to="" tape=""&gt;&lt;BR /&gt;rc=$?&lt;BR /&gt;&lt;BR /&gt;if [ $rc gt 0 ] then&lt;BR /&gt;    mailx -s "Tape write failed...."&lt;BR /&gt;    exit $rc&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Run your job in cron as follows:&lt;BR /&gt;&lt;BR /&gt;at 10:05 p.m. monday thru fruday&lt;BR /&gt;5 20 * * * 1-5 su - oracle -c "backup command" 2&amp;gt;&amp;amp;1 | mailx -s "Oracle nightly backup" yourname@yourdomain.com&lt;BR /&gt;&lt;BR /&gt;The key factor is to check for errors and take appropriate action.  I can help you with the script.  I work for points.&lt;BR /&gt;&lt;BR /&gt;I even work in real time for bucks, but honestly I think you can handle it.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;/COMMAND&gt;</description>
      <pubDate>Thu, 24 Jul 2003 02:16:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031825#M132767</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-07-24T02:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Automate database backup procedure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031826#M132768</link>
      <description>Here is the backup script.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;Ajk</description>
      <pubDate>Thu, 24 Jul 2003 02:23:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031826#M132768</guid>
      <dc:creator>ajk_5</dc:creator>
      <dc:date>2003-07-24T02:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Automate database backup procedure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031827#M132769</link>
      <description>Hi,&lt;BR /&gt;  There are various techique expert people do the check the tape.Simple guy like me I used simpler method :&lt;BR /&gt;&lt;BR /&gt;mt -t /dev/rmt/0mn rew&lt;BR /&gt;&lt;BR /&gt;to check whether the tape are loaded or not.&lt;BR /&gt;&lt;BR /&gt;or simple check on whether tape are ok or not ,try to write something to tape :&lt;BR /&gt;&lt;BR /&gt;fbackup ....&lt;BR /&gt;&lt;BR /&gt;and check whether the command are successful with $?.&lt;BR /&gt;&lt;BR /&gt;I agree with SEP ,  you can do it..&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;mB</description>
      <pubDate>Thu, 24 Jul 2003 02:29:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031827#M132769</guid>
      <dc:creator>malay boy</dc:creator>
      <dc:date>2003-07-24T02:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Automate database backup procedure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031828#M132770</link>
      <description>Hi Ajk&lt;BR /&gt;&lt;BR /&gt;I haven't noticed Michael Tully on the forums today, so I'll attach a link where he provides a backup script that may give you a few ideas!&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x1d550ea029a2d711abdc0090277a778c,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x1d550ea029a2d711abdc0090277a778c,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;SEP &amp;amp; Twang have given you some good ideas.  My advice for writing scripts is to keep everything seperated in functions as far as is possible.&lt;BR /&gt;&lt;BR /&gt;For example you could have seperate functions to&lt;BR /&gt;&lt;BR /&gt;1.  Check the Tape (eg check its in the drive &amp;amp; writeable)&lt;BR /&gt;2.  Check Oracle is down or in Hot backup prior to backup.&lt;BR /&gt;3.   Perform the backup.&lt;BR /&gt;4.   Check the logs after backup.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Con</description>
      <pubDate>Thu, 24 Jul 2003 02:56:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031828#M132770</guid>
      <dc:creator>Con O'Kelly</dc:creator>
      <dc:date>2003-07-24T02:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Automate database backup procedure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031829#M132771</link>
      <description>In my own experience, we have 3 Oracle instances(no 24x7) runing on same machine, we shutdown all the instances and take a closed-database backup every night. What I am doing now is to schedule a cronjob via crontab at mid night. The script will schedule other scripts to shutdown all the 3 instances via "at" instead of "crontab". If any problem occurs, script will exit without schedule the next task. So I can check the cause of the problem at the next morning. For "less important" instances(they are for data warehouse purpose), it allows me to performs the backup in such style.</description>
      <pubDate>Thu, 24 Jul 2003 03:18:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031829#M132771</guid>
      <dc:creator>twang</dc:creator>
      <dc:date>2003-07-24T03:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Automate database backup procedure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031830#M132772</link>
      <description>Thanks Steven E Protter! I appreciate your help. I think I can do it. :)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;Ajk</description>
      <pubDate>Thu, 24 Jul 2003 06:55:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031830#M132772</guid>
      <dc:creator>ajk_5</dc:creator>
      <dc:date>2003-07-24T06:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Automate database backup procedure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031831#M132773</link>
      <description>Hi You can use the following lines for checking tape drive status&lt;BR /&gt;STAT=`mt -f /dev/rmt/0m stat |awk '$4 == "online" {print 1}'`&lt;BR /&gt;if [ STAT -eq 1 ]&lt;BR /&gt;then&lt;BR /&gt;  you can add the lines for backup&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;for checking whether the backup was successfull&lt;BR /&gt;use the following &lt;BR /&gt; if [ $? -eq 0 ]&lt;BR /&gt;        then&lt;BR /&gt;                echo "backup completed " |tee -a $LOG_FILE&lt;BR /&gt;                echo "Ejecting the media....."&lt;BR /&gt;                sleep 10&lt;BR /&gt;                mt -f $DEV offl #for ejecting media.&lt;BR /&gt;        else&lt;BR /&gt;                echo "Error during backup.."| tee -a $LOG_FILE&lt;BR /&gt;        fi&lt;BR /&gt;&lt;BR /&gt;You can send all the logs to a log file and then send that file as a mail. &lt;BR /&gt;make sure that sendmail is configured and running in your system.&lt;BR /&gt;&lt;BR /&gt;-Rajesh&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Jul 2003 06:57:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/automate-database-backup-procedure/m-p/3031831#M132773</guid>
      <dc:creator>RAJESH GANGADHARAN</dc:creator>
      <dc:date>2003-07-24T06:57:53Z</dc:date>
    </item>
  </channel>
</rss>

