一種於具有主伺服器及複數區域伺服器之分散式資料庫中,將主伺服器及區域伺服器之系統狀態一致地還原至欲還原之時間點之方法,包括當區域伺服器偵測到資料庫中系統狀態變更時,分析變更事件以產生事件紀錄並儲存至資料庫中。經過預設條件,區域伺服器產生快照。當主伺服器接收到還原系統狀態至欲還原之時間點的指令時,指示區域伺服器取得儲存在區域伺服器中的事件紀錄及快照、找出最接近欲還原之時間點之快照,並根據快照之時間與欲還原時間之時間點之時間間隔,從事件紀錄找出對應之事件及快照,以回復系統狀態至欲還原之時間點。 A method for recovering system state consistency to any point-in-time in distributed database, wherein the distributed database comprises a primary server and a plurality of region servers, comprising: analyzing the event changes to generate an event log when the region servers detect the system state changes; after default condition, the region servers generate a snapshot respectively; when the primary server receives the instruction to recover system state to designed point-in-time, indicates the region servers to implement: read the event log and snapshots stored in region servers; finding the snapshot closest to the designed point-in-time; finding the event log and snapshot correspond to the interval between the time recorded in snapshot and the designed point-in-time to recover system state to the designed point-in-time. |