Unix Technical Forum

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

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 --- ...


Go Back   Unix Technical Forum > Database Server Software > Informix

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 07:52 PM
Colin Bull
 
Posts: n/a
Default RE: database restore with ontape -r on Informix Online Dynamic Server 7.31 on Linux


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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 07:52 PM
David Williams
 
Posts: n/a
Default Re: database restore with ontape -r on Informix Online Dynamic Server 7.31 on Linux


"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



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 07:53 PM
S.Dhayanidhi
 
Posts: n/a
Default Re: database restore with ontape -r on Informix Online Dynamic Server 7.31 on Linux

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 07:53 PM
Obnoxio The Clown
 
Posts: n/a
Default Re: database restore with ontape -r on Informix Online Dynamic Server 7.31 on Linux

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:32 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com