Patent ID: 8086564

Claim:
A method for replicating a procedure that executes one or more transactions at a standby database, comprising: receiving an annotated redo log from a primary database, the annotated redo log comprising: one or more entry markers comprising: procedure information, argument data for the procedure if any, and a corresponding transaction identifier (XID), one or more redo records, each comprising a copy of a change to the primary database and a corresponding XID, and an exit marker comprising an exit status for the procedure; upon seeing the entry markers, updating session audit information to indicate that a session is executing the procedure, creating a logical transaction for the procedure, and setting a logical transaction identifier (LXID) for the logical transaction; creating an entry logical change record (LCR) corresponding to the entry markers, the entry LCR comprising the LXID, the procedure information, and a pointer to the argument data for the procedure if any; creating LCRs for the one or more redo records in the session that is executing the procedure, wherein each LCR for the redo records comprises the LXID, the XID of a corresponding redo record of the one or more redo records, and an operation describing the corresponding change to the primary database; creating an exit LCR corresponding to the exit marker, the exit LCR comprising the LXID and the exit status; grouping the LCRs for the redo records into child transactions according to their corresponding XIDs and grouping the child transactions into the logical transaction; and if the exit status indicates a successful execution of the procedure at the primary database, then discarding the child transactions and applying the logical transaction to the standby database, wherein the procedure of the logical transaction is called at the standby database with the argument data if any, wherein if the exit status indicates the execution of the procedure failed at the primary database, then ignoring both the child transactions and the logical transaction at the standby database.