Re: Logical log restore question
Posted in 1998
Gabor Heppes wrote:
>
> Hi,
>
> I am trying to set up the backing up of logical logs using an alarm
> script. I use ontape -a in the script to backup to a disk file, then
> rename it using the number of the logical log that was backed up (or the
> number of the first if multiple logs were backed up, although this would
> rarely happen) as part of the file name.
>
> What do I do at restore time? I was hoping that I could just concatenate
> the backed up logs and restore them in one go, but that does not seem to
> be happening. Informix will just restore the first one -- I suspect
> there's a record at the end of each log file that tells ontape that it
> has reached the end.
>
> The alternative is to copy the log files one by one every time ontape
> asks if I want to restore another log tape. The problem is I can
> accumulate > 100 logs within a day (level 0 archives are taken daily).
>
> Has anyone used a (semi-)automated script to restore a large number of
> logical logs?
In my utils3_ak package (available from the IIUG Software Repository)
is included the prompt parsing function (readn.c) that I used to make
my eventalarm.c do the log backups with ontape -a as you have in your
script. You could use that function, or expect() if you have it, to
build a "C" program that would set up a set of pipes and fork/exec
ontape to perform the restore and reply to prompts for logfiles by
renaming the multitude of log files to the LTAPEDEV name and respond
to the prompt. You could even configure it to only load logfiles up to
a certain file number. See the source for eventalarm.c as an example
of how to set up the bi-directional pipes and launch ontape and how to
use readn() if you do not have expect().
Art S. Kagel