As one of the cores of the dispatching automation system,the real-time database management system(DBMS)plays an important role in the safe operation of the smart grid.Nevertheless,with the increase of the openness of the smart grid,the data security in the real-time database,especially the integrity of the security issues,is becoming a matter of ever-increasing concern.An algorithm for the integrity restoring of the data in the real-time database that conforms to the IEC61970standard,i.e.,RDIR algorithm,is proposed.With this method,after the data integrity is destroyed,the real-time database has only to roll back the malicious and affected transactions rather than all the transactions.Moreover,the undo conflict due to the transaction undo in the recovery process can be avoided,thus reducing the database recovery time and improving the survivability of the real-time database system.