f



RE: database restore with ontape -r on Informix Online Dynamic Server 7.31 on Linux

 David Williams wrote
> 
> "Andy Kent" <andykent.bristol@virgin.net> wrote in message
> news:a3525a11.0401080308.64a1ed12@posting.google.com...
> > Why ever would you want to run a cold restore unattended?
> >
> > Great laxative ...
> >
> 
>   To create a reporting database once per week...
> 
>   Once all the ontape stuff is finished don't forget to
> 
> a)  Sit in a loop running onstat - and check the return
> code each time.Wait for the server to reach quiescent
> mode. This can take 45 mins.
> 
> b) onmode -m to move to Online mode.
> 
> Otherwise a reboot means another restore!
> 
> I had this working great for a customer a while back!
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

This seems to work on our automated restore of live for testing.
I know the grep line looks like a load of boll*cks. But it works.
Tru64 5.1 and ksh

Colin Bull
c.bull@videonetworks.com 

sending to informix-list
0
Colin
1/9/2004 9:14:06 AM
comp.databases.informix 16081 articles. 0 followers. Post Follow

1 Replies
1014 Views

Similar Articles

[PageSpeed] 53

"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
> 
> This seems to work on our automated restore of live for testing.
> I know the grep line looks like a load of boll*cks. But it
> works. Tru64 5.1 and ksh

'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)

HTH
Christian
-- 
#include <std_disclaimer.h> 
/* The opinions stated above are my own and not 
   necessarily those of my employer. */
0
Christian
1/9/2004 10:20:08 AM
Reply: