Patent ID: 7996363

Claim:
A computer-implemented method of replicating data, the method comprising steps of: replicating, to a current standby redo log file in a standby database, writes that occur to a primary redo log file in a primary database as the writes occur; while said replicating is ongoing, continuously reading one or more standby redo blocks from the current standby redo log file and continuously applying, to data in the standby database, while said replicating is ongoing, changes specified in the one or more standby redo blocks; in response to a second primary redo log file in the primary database becoming a current primary redo log file after a first primary redo log file had been the current primary redo log file, setting a second primary log sequence number, which is indicated in the second primary redo log file, to be a value that is different than a first primary log sequence number that is indicated in the first primary redo log file; wherein, at a time that the second primary redo log file becomes the current primary redo log file, the second primary redo log file already contains at least one redo block that indicates a recovery sequence number that is different from said value; writing, to the second primary redo log file, one or more redo blocks that indicate recovery sequence numbers that are the same as said value; determining whether a recovery sequence number indicated in a first redo block in the current standby redo log file is the same as a log sequence number that is indicated in the current standby redo log file; and in response to determining that the first redo block's recovery sequence number is not the same as the current standby redo log file's log sequence number, determining that a logical end of the current standby redo log file has been reached, and refraining from applying, to data contained in the standby database, a change that is specified in the first redo block; wherein the steps are performed by one or more computing devices.