Comments:

- You don't account for the case where NUM_BACKUP_INCR is 0.

- I would also change the test for NUM_BACKUP_INCR=20  to 
NUM_BACKUP_INCR>=20. This is because if incremental BACKUP DB operations 
are run between executions of the script, NUM_BACKUP_INCR could be greater 
than 20 by the time the script runs again.

- I do not think the test for LAST_BACKUP_DATE is necessary, as 
NUM_BACKUP_INCR would be 0.

Also, I think the second "if(rc_ok) goto ba_full" statement is extraneous.

So would the following be more concise?

  select * from db where num_backup_incr=0 or num_backup_incr>=20
  if(rc_ok) goto ba_full
  ba_incr: backup db devcl=$1_FILEDEV type=incremental wait=yes
  goto done
  ba_full: backup db devcl=$1_FILEDEV type=full wait=yes
  done:

Regards,

Andy

Andy Raibeck
IBM Software Group
Tivoli Storage Manager Client Development
Internal Notes e-mail: Andrew Raibeck/Tucson/[EMAIL PROTECTED]
Internet e-mail: [EMAIL PROTECTED]

IBM Tivoli Storage Manager support web page: 
http://www.ibm.com/software/sysmgmt/products/support/IBMTivoliStorageManager.html

The only dumb question is the one that goes unasked.
The command line is your friend.
"Good enough" is the enemy of excellence.

"ADSM: Dist Stor Manager" <ADSM-L@VM.MARIST.EDU> wrote on 01/16/2007 
06:27:45 AM:

> Hi all,
> 
> just a quick one we just stumbled upon: running incremental/full dbb 
using
> following script:
> 
> ***snip***
> select * from db where LAST_BACKUP_DATE is NULL
> if(rc_ok) goto ba_full
> select * from db where num_backup_incr=20
> if(rc_ok) goto ba_full
> if(rc_notfound) goto ba_incr
> ba_full: backup db devcl=$1_FILEDEV type=full wait=yes
> goto done
> ba_incr: backup db devcl=$1_FILEDEV type=incremental wait=yes
> done:
> ***snip***
> 
> we just got:
> 
> 16.01.2007 08:56:45 ANR2017I Administrator xxx issued command: select *
> from db where LAST_BACKUP_DATE is NULL
> 16.01.2007 08:56:45 ANR2034E SELECT: No match found using this criteria.
> 16.01.2007 08:56:45 ANR2753I (MAINTAINANCE_LOCAL):ANR2034E SELECT: No 
match
> found using
> 16.01.2007 08:56:45 ANR2753I (MAINTAINANCE_LOCAL):this criteria.
> 16.01.2007 08:56:45 ANR2017I Administrator xxx issued command: select *
> from db where num_backup_incr=20
> 16.01.2007 08:56:45 ANR2034E SELECT: No match found using this criteria.
> 16.01.2007 08:56:45 ANR2753I (MAINTAINANCE_LOCAL):ANR2034E SELECT: No 
match
> found using
> 16.01.2007 08:56:45 ANR2753I (MAINTAINANCE_LOCAL):this criteria.
> 16.01.2007 08:56:45 ANR2017I Administrator xxx issued command: BACKUP DB
> devcl=xxx_FILEDEV type=incremental wait=yes
> 16.01.2007 08:57:08 ANR2361E BACKUP DB: A full database backup is 
required.
> 
> The odd thing about it ist that we have only 13 incrementals, so neither
> the scripted nor the system criteria (20/32 incrementals) are met.
> I got no additional clue from the Reference or tsmwiki. Any Idea?
> 
> Platform: Solaris 9  Server Version 5, Release 3, Level 3.2
> 
> Regards,
> Markus
> 
> 
> 
> --
> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese 
E-Mail
> irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
> vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte
> Weitergabe dieser Mail oder von Teilen dieser Mail ist nicht gestattet.
> 
> Wir haben alle verkehrsüblichen Maßnahmen unternommen, um das Risiko der
> Verbreitung virenbefallener Software oder E-Mails zu minimieren, dennoch
> raten wir Ihnen, Ihre eigenen Virenkontrollen auf alle Anhänge an dieser
> Nachricht durchzuführen. Wir schließen außer für den Fall von Vorsatz 
oder
> grober Fahrlässigkeit die Haftung für jeglichen Verlust oder Schäden 
durch
> virenbefallene Software oder E-Mails aus.
> 
> Jede von der Bank versendete E-Mail ist sorgfältig erstellt worden, 
dennoch
> schließen wir die rechtliche Verbindlichkeit aus; sie kann nicht zu 
einer
> irgendwie gearteten Verpflichtung zu Lasten der Bank ausgelegt werden.
> ______________________________________________________________________
> 
> This e-mail may contain confidential and/or privileged information. If 
you
> are not the intended recipient (or have received this e-mail in error)
> please notify the sender immediately and destroy this e-mail. Any
> unauthorised copying, disclosure or distribution of  the material in 
this
> e-mail or of parts hereof is strictly forbidden.
> 
> We have taken precautions to minimize the risk of transmitting software
> viruses but nevertheless advise you to carry out your own virus checks 
on
> any attachment of this message. We accept no liability for loss or 
damage
> caused by software viruses except in case of gross negligence or willful
> behaviour.
> 
> Any e-mail messages from the Bank are sent in good faith, but shall not 
be
> binding or construed as constituting any kind of obligation on the part 
of
> the Bank.

Reply via email to