Sybase啟用增量備份時如何預防資料庫日誌飽滿

2022-09-11 19:57:25 字數 1040 閱讀 4517

按照增量備份的邏輯,

1,資料庫設定了自動清除日誌,則不能做增量備份。

2,(關閉自動清除日誌)手工清除日誌後,需要乙個新的全庫備份後,才能開始新的增量備份。

資料庫日誌快滿時,系統會觸發一次last chance threshold,這個時候,會自動執行sp_thresholdaction儲存過程。

sp_thresholdaction系統沒有定義,使用者可以根據自己的需求來書寫sp_thresholdaction。

對應我們的應用,可以這樣:

use hh_lc

gocreate procedure sp_thresholdaction

@dbname varchar(30),

@segmentname varchar(30),

@space_left int,

@status int

asdump transaction @dbname with truncate_only

go還可以自己定義 user defined threshold,當日誌剩餘空間達到使用者指定的值時,觸發使用者指定的儲存過程。

定義user defined threshold後,相當於雙保險,因為有些資料庫可能由於某些原因(比如資料庫建庫混亂),系統的last chance threshold失效。

--user defined threshhold and action:

use hh_lc

gosp_addthreshold "hh_lc", "logsegment", 50000, user_threshold_proc --日誌空間剩餘50000頁時執行user_threshold_proc

gocreate procedure user_threshold_proc

@dbname varchar(30),

@segmentname varchar(30),

@space_left int,

@status int

asdump transaction @dbname with truncate_only

go

啟用增量備份

啟用增量備份 要指定是否對資料庫啟用增量備份,需要使用trackmod配置引數。這個引數指定資料庫管理器是否跟蹤資料庫修改,以讓備份工具能夠檢測到應該對資料庫的哪些部分進行增量備份,並將其包含到備份映像中。trackmod配置引數可以使用以下值之一 下面的例子顯示了如何為 sample 啟用增量備份...

虛擬機器增量備份如何啟用CBT操作步驟

vmware產品中vm的cbt change block tracing 特性可有效助力vm執行增量備份功能。cbt功能可識別和跟蹤自上次備份後修改過的塊,所有這些修改都會存放到日誌檔案中國,跟蹤記錄塊的變化。在vm上啟用cbt後,我們常用的備份軟體 如vdr vmware date recover...

增量更新專案時的備份MyBak

在增量更新專案時,做好備份十分重要,這裡提供乙個方法備份j a web所更新的檔案。import j a.io.bufferedwriter import j a.io.file import j a.io.fileinputstream import j a.io.filenotfoundexce...