Sybase ASA自动备份

Sybase ASA数据库(现在叫SQL Anywhere)功能还是很强大的,在它的备份使用当中,可以直接利用它的event来创建自动备份:

看看下边的两个简单的例子:
Instruct the database server to carry out an automatic backup to tape using the first tape drive, every day at 1 A.M.

CREATE EVENT DailyBackup
SCHEDULE daily_backup
START TIME '1:00AM' EVERY 24 HOURS
HANDLER
   BEGIN
      BACKUP DATABASE TO '\\\\.\\tape0'
      ATTENDED OFF
   END;
 

Instruct the database server to carry out an automatic backup of the transaction log only, every hour, Monday to Friday between 8 A.M. and 6 P.M.

CREATE EVENT HourlyLogBackup
SCHEDULE hourly_log_backup
BETWEEN '8:00AM' AND '6:00PM'
EVERY 1 HOURS ON
   ('Monday','Tuesday','Wednesday','Thursday','Friday')
HANDLER
   BEGIN
      BACKUP DATABASE DIRECTORY 'c:\\database\\backup'
      TRANSACTION LOG ONLY
      TRANSACTION LOG RENAME
   END;

你可能感兴趣的:(Sybase)