Re: Clearing log in SE/ESQL
Posted in 1993
} } In <3403@esun179.gdc.com> brunner@gdc.COM (Paul Brunner) writes: } } >I am looking for a way to clear the database transaction log in the SE } >without shutting down all ESQL applications for the period of time it takes } >to do a total database backup, and then starting the database. } } >The scenario I would like to follow is to run a program on a periodic basis } >that: } > 1. Waits until it can gain exclusive access to the database, } > 2. locks all the tables, } > 3. turns off database logging, } > 3. clears the database log file, } > 4. starts the database, } > 5. then releases all of the locks. } } Well, I've run into a similar problem, but I'm not attacking it with the } same approach. For example, you don't seem to be worried about the } integrity of the log at all. If you flush the log without doing a } backup then you are subject to losing all those transactions that you } flushed since you did you last backup. If this is the case why not just } set the logfile name to /dev/null? Also, if you are going to lock all } of the tables instead of doing a "database exclusive" then be careful to } use a "set lock mode to wait" or you'll be in trouble. } "Chip" makes a good point. What I would do is take advantage of checkpoints and clear logfiles AFTER a valid archive. Because at that point you have a good copy of the entire engine on tape - or whatever. The logfiles are only useful for rolling forward from that archive. In between archives - yes you need to save those logfiles. j. _____________________________________________________________________________ Jack Parker - Contractor | Hewlett Packard, BSMC Boise, Idaho, USA| If you keep staring at it like that, jparker@hpbs2561.boi.hp.com | your nose is going to grow (208) 396-5388 (W) (208) 384-1623 (H) | into the bark. _____________________________________________________________________________ Any opinions expressed herein are my own and not those of my employers. _____________________________________________________________________________