Ask the Expert

Exact contents of redo logs

I want to know the contents of the redo logs. Do redo logs contain exact data inserted by users or instructions to redo transactions in case of failure?

    Requires Free Membership to View

The online redo logs contain the exact SQL statements to replay the transaction in case of a failure. These SQL statements vary from the actual SQL issued by the user. For instance, assume the user issues the following:
DELETE FROM emp WHERE empno IN (1001,1002);
The online redo logs will contain the following:
DELETE FROM {obj#1785} WHERE {col1} = 1001;
DELETE FROM {obj#1785} WHERE {col1} = 1002;
The original DELETE statement can be broken down into two DELETE statements. Also notice that Oracle references the table by object number and the column by column position.

In addition, your transaction generates undo stored in the undo segments. Oracle needs to replay the changes to the undo segments in case it needs to roll back any uncommitted transactions. So the online redo logs also contain the SQL to undo any operation.

This was first published in October 2006

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: