on 2011 Nov 04 10:49 PM
Here's the code that I use to create a backup event...
CREATE EVENT DailyBackup
SCHEDULE daily_backup
START TIME '11:00 PM' EVERY 24 HOURS
HANDLER
BEGIN
DECLARE day_of_week VARCHAR(9);
DECLARE backup_stmt LONG VARCHAR;
SET day_of_week = substr(dayname(today()),1,3);
SET backup_stmt = 'BACKUP DATABASE DIRECTORY '
|| '''c:\\app\\backups\\' || day_of_week || ''' '
|| 'TRANSACTION LOG TRUNCATE ';
EXECUTE IMMEDIATE backup_stmt;
END
Does anyone have code which will backup the database and validate the backed-up database?
Thanks,
Doug
Request clarification before answering.
Did you check on Brecks Blog. He has more as a handful of Entries that show Backup stratagies.
As an Example Demonstrating Full and Incremental Backups
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Besides Breck's many articles on that, you may also have a look at the maintenance plans facility that let you create events to backup and validate databases in the Sybase Central GUI. After they have been created by the GUI, you can have a look at the SYSEVENT table to study the created event handlers.
I have used them as starting points for own events and modify them for my own requirements.
Note that some folks (apparently including Breck, cf. this discussion) would not use events to backup a database but prefer an automatically executed external batch that calls DBBACKUP. (That's not my opinion, FWIW...)
Some more discussions are available here, e.g. this one - or simply look for the "backup", "validation" or "maintenance-plan" tags...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
64 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.