Transactional Control in Oracle

Transactional Control in Oracle:

When we say Transactional control then the first question that comes is like “What is a Transaction?”
It’s a group of commands that can be committed and stored in the database or roll backed and undone.
Usually when we go to a database and change a couple of columns or a set of records on a table then we need to commit that change what we have done.  If we do not commit then we should roll back (means undo it).
The transaction change command that can be made one after other and they can all be committed or undone with a single group.
Normally when we do any changes on the database there will be the four parts that happens. Like we have the database, redo logs, rollback and the person who made the changes. 
So whenever the person does any changes on the transaction then data get changed before committing or rollback. The redo logs will be written to storing record change is made and also the rollback is written too but a little different on what redo logs writes, so when the person commits then the only thing that we do is only to delete the rollback because the changes are already been made to the redo logs and the database.
When we rollback before commit command executed, it will be applied that changes are been made to the redo logs but this also get recorded that the undo changes made by rollback command then rollback command is deleted.
 
A small note on what I have mentioned above :
 
When the data get changed before COMMIT or ROLLBACK command:
  • Database is changed.
  • Logs are written.
  • Rollback is written.
 On COMMIT:
  • Rollback is deleted.
 On ROLLBACK:
  • Rollback is applied to the database.
  • Rollback is recorded in redo logs.
  • Rollback is deleted.
The above note is the basic of a transaction or a database change works in Oracle.
The most important part is the first thing that gets change is the redo logs because it contains records of both changes and rollback undo.
Advertisements

One thought on “Transactional Control in Oracle

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s