This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How DB actually works when needs to update a table?

 
Kevin Onik
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there.

I'm new to DB and have a quastion.

How actually DB2 or Oracle works when you run a transaction which contains
for example 10 updates?

which one is correct?

1- copies the rows going to be updated to a temp space -->
writes the updates directly to the main table -->
if Commit happens -- > it's OK! and forgets the temp space
if Rollback happens --> rewrites the temp space to the original table

2- inserts the updates to a temp space -->
if Commit happens --> replaces the old rows in the table with new ones
if Rollback happens --> nothing going to do with the original table and forgets about the temp space

could anyone please describe it with a refrence from IBM or Oracle

Thank you in advance.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kamyar,
No updates are written to the main table right away. They are written to a file called a "rollback log" first.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic