This is a discussion on RE: database restore with ontape -r on Informix Online Dynamic Server 7.31 on Linux within the Informix forums, part of the Database Server Software category; --> Christian Knappke wrote > > "Colin Bull" <c.bull@videonetworks.com> wrote: > > > Here is one I prepared earlier --- ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Christian Knappke wrote > > "Colin Bull" <c.bull@videonetworks.com> wrote: > > > Here is one I prepared earlier --- > > > > onbar/ontape whatever .. > > FORCEOL=n > > until onstat - | grep "On-Line" > /dev/null > > do > > echo "Off line" # ; sleep 20 > > onstat - | grep "[BQ][lu][oi][ce][ks]" > /dev/null && ( echo > > "\nServ blokd" > > if [ x$FORCEOL = "xn" ] ; then > > echo "Onlining.." ; onmode -m ; FORCEOL=y; > > sleep 240 > > else > > echo "waiting to online " ; sleep 240 > > fi > > ) > > onstat - # for comfort factor > > sleep 60 > > done > 'onstat -' sets the return code according to the server state -> > no need for boll*cking greps... > > >From the top of my head: > 255 = server is offline ("Shared memory not initialized...") > 5 = online > 4 = some error > 0..3 = several other states like quiescent, blocked etc. (don't > know exacly) > That will make it a lot tidier, should be able to use a case statement. I will revise next week sometime. Colin Bull c.bull@videonetworks.com sending to informix-list |
| |||
| "Colin Bull" <c.bull@videonetworks.com> wrote in message news:btmcr4> That will make it a lot tidier, should be able to use a case statement. > I will revise next week sometime. > http://www.smooth1.demon.co.uk/ifaq06.htm#6.33 6.33 What status codes does onstat return? On 21st May 1998 mdstock@informix.com (Mark D. Stock) wrote:- As a point of interest, you can check the current mode of IDS by checking the status ($?) after onstat -. The values returned by 'onstat -' are: a.. -1 Offline b.. 0 Initialisation c.. 1 Quiescent d.. 2 Recovery e.. 3 Backup f.. 4 Shutdown g.. 5 Online h.. 6 Abort > Colin Bull > c.bull@videonetworks.com > > sending to informix-list |
| |||
| Here is my cute little code.. for unattended tape restore. We do restore to our development everyday and it works fine. # ------------------------------------------------------------------ echo " ********************************************" echo " * Tape Restore Utility (For Single Tape ) *" echo " ********************************************" # ------------------------------------------------------------------ echo " " echo " Press Enter to Continue or CTRL-C to Abort \c" read con echo "Please wait Shutting Down Engine..." echo "y\ny\n" | onmode -k echo "\nPlease wait Restoring..." echo "\ny\nn\nn\nn\n" | ontape -r while true do engstatus=`onstat - | awk '{ print $5 } '` case $engstatus in *Fast) echo "Online Engine is Recovering..."; sleep 50;; *On-Line) grantdba; echo "Engine in Online Mode....Ready to Use..."; exit;; *Quiescent) echo "Engine is Quescient mode... Making Online"; cd etc; onmode -m; cp onconfig.null onconfig; ontape -s -L 0 -B prime; cp onconfig.tape onconfig; cd;; *for) echo "Engine is Off Line.. Starting Engine"; oninit; exit;; *) echo "Cannot find Engine Status.."; exit;; esac done |
| ||||
| S.Dhayanidhi wrote: > Here is my cute little code.. Most people just show pictures of their kids. Still, if it makes you happy... -- "C'est pas parce qu'on n'a rien à dire qu'il faut fermer sa gueule" - Coluche |
| Thread Tools | |
| Display Modes | |
|
|