Script required for Restoration
Posted in 2008
User on IDS 11.10/Solaris 10 wanted to automate an ontape level-0 restore (no logical log restore) on a dev server weekly. S.J. Scheepers suggested feeding the interactive prompts from a file (e.g. a cronrest.keys file containing the y/n answers piped into 'ontape -r'), plus a loop polling onstat to watch recovery and issue 'onmode -m' to bring the server online. Art Kagel and Paul Watson recommended 'expect' scripts as more robust, especially with multiple tapes, with a sample script and a link to oninit.com/download/restore. The original poster reported the piped-keys script worked and the restore succeeded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Backup & Restore, Logging & Checkpoints, Platform-Specific Issues
Hello ALL, IDS 11.10, solaris 10 Is is possible to automate the process of restoration using "ONTAPE" ( level 0 backup only with out logical log resotration) by writing a shell script or any other option available . i need to resotre my prod level 0 on a dev server once every week, if any one has tried some thing like this pls guide me . Thanking you all in advance Regards vikas
Vikas,
yes, use something like - echo "\\
\\
" | ontape -r
etc.
HTH
2008/5/21 VIKAS HIVARKAR <vikashivarkar3@gmail.com>:
> Hello ALL,
>
> IDS 11.10, solaris 10
>
> Is is possible to automate the process of restoration using "ONTAPE"
> ( level 0 backup only with out logical log resotration) by writing a shell
> script or any other option available .
> i need to resotre my prod level 0 on a dev server once every week, if any
> one
> has tried some thing like this pls guide me .
>
> Thanking you all in advance
> Regards
> vikas
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Skip
+264-81-124-2345
Sorry for my previous mail, restore is a bit more complicated :-)
I created a file called cronrest.keys with all the keyboard entries
neccesary, namely y n n n
and then in a script the following
ontape -r < cronrest.keyswhile true
do
engstatus=`onstat - | awk '{ print $8 } '`
case $engstatus in
*Fast) date;
echo "Informix is Recovering...";
sleep 300;;
*On-Line) date;
echo "Informix in Online Mode....Ready to Use...";
exit;;
*Quiescent) date;
echo "Informix is in Quescient mode... taking Online";
onmode -m;;
*) echo "Cannot find Informix Status..";
exit;;
esac
done
Hope this helps ;-)
2008/5/21 VIKAS HIVARKAR <vikashivarkar3@gmail.com>:
> Hello ALL,
>
> IDS 11.10, solaris 10
>
> Is is possible to automate the process of restoration using "ONTAPE"
> ( level 0 backup only with out logical log resotration) by writing a shell
> script or any other option available .
> i need to resotre my prod level 0 on a dev server once every week, if any
> one
> has tried some thing like this pls guide me .
>
> Thanking you all in advance
> Regards
> vikas
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Skip
+264-81-124-2345
Thankyou Scheepers, your script is going to be of great help,atleast now i have the confidence that some thing like this can be done. pls let me know what have you actually scripted in cronrest.keys thanking you once again for prompt help ! Regards, vikas
Another option than the shell script would be to use expect. Expect is a
tool management language built on top of tcl. You would write a script for
it that runs the ontape and has rules like 'If the task says: Mount tape'
you run the tape rewind command and respond "Y"' Very powerful and very
simple to use.
Art S. Kagel
Oninit
On Wed, May 21, 2008 at 4:44 AM, VIKAS HIVARKAR <vikashivarkar3@gmail.com>
wrote:
> Hello ALL,
>
> IDS 11.10, solaris 10
>
> Is is possible to automate the process of restoration using "ONTAPE"
> ( level 0 backup only with out logical log resotration) by writing a shell
> script or any other option available .
> i need to resotre my prod level 0 on a dev server once every week, if any
> one
> has tried some thing like this pls guide me .
>
> Thanking you all in advance
> Regards
> vikas
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
If you have multiple tapes then it is must easier to use an expect script Cheers Paul -----Original Message----- From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of VIKAS HIVARKAR Sent: Wednesday, May 21, 2008 5:44 AM To: ids@iiug.org Subject: Re: Script required for Restoration [12159] Thankyou Scheepers, your script is going to be of great help,atleast now i have the confidence that some thing like this can be done. pls let me know what have you actually scripted in cronrest.keys thanking you once again for prompt help ! Regards, vikas **************************************************************************** *** Forum Note: Use "Reply" to post a response in the discussion forum.
i am sure it must be great ! but honestly i dont know how to use/write a script using expect :(
The docs are very clear and it's a really simple event driven language.
This is off the top of my head and I haven't written one in 5 years or so,
but it's close enough to make the point (and may even work ;-)
spawn "ontape -a";
expect {
"Mount tape" {
touch "my_logical_log_archive.file";
send "y";
}
"current log" {
send "n";
}
exit send_user "Ontape completed logical log archive."
}
Check out the man page at: http://www.tcl.tk/man/expect5.31/expect.1.html
Art S. Kagel
Oninit
On Wed, May 21, 2008 at 10:19 AM, VIKAS HIVARKAR <vikashivarkar3@gmail.com>
wrote:
> i am sure it must be great !
> but honestly i dont know how to use/write a script using expect :(
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
http://www.oninit.com/download/restore should get you started Cheers Paul -----Original Message----- From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of VIKAS HIVARKAR Sent: Wednesday, May 21, 2008 9:19 AM To: ids@iiug.org Subject: Re: RE: Script required for Restoration [12162] i am sure it must be great ! but honestly i dont know how to use/write a script using expect :( **************************************************************************** *** Forum Note: Use "Reply" to post a response in the discussion forum.
Thankyou... thankyou very much Scheepers,
Your script worked absolutely as expected.
I sucessfully restored the level 0 backup (ontape) using your script.
Thanking you once again for this wonderful script !