A few weeks back I talked about doing DB incrementals, and found
guarded optimism in this group about it.  Guarded optimism being about
as exuberant most backup types ever get, I was pleased. :)


But I had a surprise once I started doing the incrementals as a matter
of course.  I had expected (for no good reason) that the
DBBACKUPTRIGGER setting which speaks of number of incrementals between
fulls applied to all DB backup processing.  I was wrong.

Pleasantly, because I'm a paranoid, I noticed this the first day I had
expected my incremental to "automatically" be a full, and have been
noodling with it by hand while I prepare a good automatic response.

So, submitted for your approval or tomatoes, I present Allen's
Do-what-i-meant Backup Script.

---

select num_backup_incr from db where num_backup_incr <= -
  (select numicremental from dbbackuptrigger)

if(rc_ok) goto ok_point

bust_point:
  select 'Full backup starting' from db
  backup db type=full devc=remote_ctrl
  goto done
ok_point:
  select 'incremental backup starting' from db
  backup db devc=remote_ctrl

done:exit

---

Not that it's all that fancy or anything.  If you're at or below the
dbbackuptrigger incremental count, this script will run an incr.  If
you're above tolerance, it will run a full.    It also leaves
breadcrumbs in the log (note those fine 'select' statements) so you
can see what it thought it was doing.

I've taken it through a few cycles on my test server, and am about to
unleash it on the Real World. :)




- Allen S. Rout

Reply via email to