Architecture flow of sql Statement.
1. Once we hit sqlplus statement as
above client process(user) access sqlnet listener.
2. Sql net listener confirms that DB is
open for buisness & create server process.
3. Server process allocates PGA.
4. ‘Connected’ Message returned to user.
5. SQL>select * from emp;
6. Server process checks the SGA to see
if data is already in buffer cache.
7. If not then data is retrived from
disk and copied into SGA (DB Cache).
8. Data is returned to user via PGA
& server process.
9. Now another statement
is SQL>Update emp set sallary=30000 where empid=10;
10. Server process (Via PGA) checks SGA
to see if data is already there in buffer cache.
11. In our situation chances are the data
is still in the SGA (DB Cache).
12. Data updated in DB cache and mark as
‘Dirty Buffer’.
13. Update employee placed into redo
buffer.
14. Row updated message returned to user
15. SQL>commit;
16. Newest SCN obtained from control
file.
17. Data in DB cache is marked as
‘Updated and ready for saving’.
18. commit palced into redo buffer.
19. LGWR writes redo buffer contents to
redo log files & remove from redo buffer.
20. Control file is updated with new SCN.
21. Commit complete message return to
user.
22. Update emp table in datafile &
update header of datafile with latest SCN.
23. SQL>exit;
24. Unsaved changes are rolled back.
25. Server process deallocates PGA.
26. Server process terminates.
27. After some period of time redo log
are archived by ARCH process.
Comments
Post a Comment