摘要 |
Disclosed are a method and a system for recovering data after switching between a main database and a standby database. The method incudes: after switching between the main database and the standby database, switching business to a new main database; after the main database is restored, analyzing left logs not synchronized into the new main database to obtain one or more executable statements and a front mirror image and a rear mirror image of a relative record of every executable statement; as for every executable statement, if the front mirror image of the relative record to the executable statement matches with current recording in the new main database, replaying the executable statement in the new main database, wherein the relative record of the executable statements refers to operation recording to the executable statements. The system comprises a log analyzing module and an event replaying module. The method and the system for recovering the data after switching between the main database and the standby data have the advantage that data recovering is achieved without affecting performance of a system. |