I am trying to change some of my backup script and testing some options as back file is becoming quite large
Current backup run the following command to back the database
$DLC/bin/probkup online $DBDIR/crp/mfgcrp $BACKUPDIR/crp/db/mfgcrp.backup -com >> /tmp/backup.log 2>&1
So I want to change it to do multi volume database backup as below
$DLC/bin/probkup $DBDIR/crp/mfgcrp $BACKUPDIR/crp/db/mfgcrp.backup -com -vs 244000 <<eof >> /tmp/backup.log 2>&1
$BACKUPDIR/crp/db/mfgcrp.backup1
$BACKUPDIR/crp/db/mfgcrp.backup2
$BACKUPDIR/crp/db/mfgcrp.backup3
$BACKUPDIR/crp/db/mfgcrp.backup4
$BACKUPDIR/crp/db/mfgcrp.backup5
$BACKUPDIR/crp/db/mfgcrp.backup6
$BACKUPDIR/crp/db/mfgcrp.backup7
$BACKUPDIR/crp/db/mfgcrp.backup8
$BACKUPDIR/crp/db/mfgcrp.backup9
$BACKUPDIR/crp/db/mfgcrp.backup10
eof
The current restore uses the following command
$DLC/bin/prorest $DBDIR/crp/mfgcrp $BACKUPDIR/crp/db/mfgcrp.backup < /apps/scripts/yesfile >> /tmp/backup.log 2>&1
Where /apps/scripts/yesfile contains just the letter "y"
I always used to do a prodel and then create and then restore but some time ago it was suggested to me by Tom Bascom that I don't need to do all those step and can just restore into the current backup and have been doing this as it is faster - see note below
Trying to setup the multi volume restore without doing a delete and create and I am not sure how to get the "yes" file to work and where to place it with regards to the here-document. The code below does not seem to work, nore does placing it within the here-document, any help please
$DLC/bin/prorest $DBDIR/$ENVNAME/$DB $BACKUPDIR/$RESTENV/db/$RESTDB.backup < /apps/scripts/yesfile <<eof >> /tmp/backup.log 2>&1
$BACKUPDIR/$ENVNAME/db/$DB.backup1
$BACKUPDIR/$ENVNAME/db/$DB.backup2
$BACKUPDIR/$ENVNAME/db/$DB.backup3
$BACKUPDIR/$ENVNAME/db/$DB.backup4
$BACKUPDIR/$ENVNAME/db/$DB.backup5
$BACKUPDIR/$ENVNAME/db/$DB.backup6
$BACKUPDIR/$ENVNAME/db/$DB.backup7
$BACKUPDIR/$ENVNAME/db/$DB.backup8
$BACKUPDIR/$ENVNAME/db/$DB.backup9
$BACKUPDIR/$ENVNAME/db/$DB.backup10
eof
##############################################################################
# see note from Tom Bascom - no need to delete
##############################################################################
# NOTE: If doing a restore without a delete you need to provide a "yes" file
# as the prorest knows the the /apps/qaddb/crp/mfgcrp already exists.
# and asks "Do you want to over write it? [y/n]:" so you need to send yes
# If you do the crpel you need to provide the "yes" file to the delete
# and not to the prorest
# in testing with the delete and restore (no create) take +/- 1 min 10 sec but
# doing just a straight restore takes +/- 35 seconds
##############################################################################
How big is "quite large"?
The simple things is to put a "y" as the first line of the file with the list of segments to restore.
How big is "quite large"?
The simple things is to put a "y" as the first line of the file with the list of segments to restore.
> $BACKUPDIR/crp/db/mfgcrp.backup9
> $BACKUPDIR/crp/db/mfgcrp.backup10
> eof
Add QUIT right before "eof". Otherwise probkup (or prorest) will hang if the specified number of the backup volumes is not enough for your database that became much bigger after you create the script. It's more safely with "QUIT".
Thanks for this info George
True, these days I don't get very worried about file sizes that are less than 64GB and I've successfully worked with some that were in the half terabyte range (although those did make me nervous they worked).
Mike Furgal will probably jump in and mention large backups on Windows.
And he might mention that there is a hard limit on db extent size of 1TB. (I believe that he found that the hard way... although it could have been worse, at least it wasn't PROD.)
Anyhow -- your mileage may vary and you should definitely test your local systems etc. In my experience on reasonably modern systems you can very happily sling around some pretty good sized files.
With regard to restoring overtop of an existing db, you can also use a pipeline instead of input redirection. It saves you the risk of having a "yesfile" and losing it at some point.
Example: echo y | prorest demo demo.pbk