论坛首页 综合技术论坛

ASA自动备份

浏览 1468 次
锁定老帖子 主题:ASA自动备份
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2011-09-13  
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;
论坛首页 综合技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics