Home » RDBMS Server » Server Administration » scn information stored ???
scn information stored ??? [message #177997] Mon, 19 June 2006 00:26 Go to next message
tridentadm
Messages: 142
Registered: March 2006
Senior Member
can someone explain :
where SCN is maintained ?
1) logfile
2) controlfile
3) datafile header

I got this from Documentation
"Whenever a transaction is committed, LGWR writes the transaction’s redo records from the redo
log buffer of the SGA to an online redo log file, and a system change number (SCN)
is assigned to identify the redo records for each committed transaction. Only when
all redo records associated with a given transaction are safely on disk in the online
logs is the user process notified that the transaction has been committed.

Internal to Oracle, each committed transaction has an associated system change
number (SCN) to uniquely identify the changes made by the statements within that
transaction."

But where is it stored ???


--
Re: scn information stored ??? [message #178024 is a reply to message #177997] Mon, 19 June 2006 02:37 Go to previous message
aciolac
Messages: 242
Registered: February 2006
Senior Member
SCN are stored everywhere Smile

At first it is necessary to precise that Oracle maintain some number(not only one) of internal counters, which are named SCN. Every change which performs in database have his SCN. Every change which was applied to datablock (datablock of table, datablock of index, datablock of rollback segment )have his SCN. Every change which must be applayed to datablock, firstly generates in memory, get his SCN, writes in online redo logs, and only after this operations change are applies to datablock.

Not every SCN indicate commited transaction - if transaction was rolled back, he also have SCN; if PMON performs some operations(serving index correctivity, etc.), he also generate new SCN(because this operations also mean changes in datablocks).

When we speak at the language of programmers(not DBA), it is usefull to mean by SCN unique number of transaction performed by user session.

So, as write in Documentation, when are generates some change in database, he firstly are registered in in redo logs.
Also , when datablock chages, and commit(or rollback) performs, SCN which was commited(rolled back ) are writing in the header of datafile, which contain changed datablock - this will present last commited SCN in this datafile.
When database shuts down, last commited(rolled back) SCN are writing in controlfile.

When database starts, he firstly verifies last SCN from redo logs, SCN from controlfiles, and SCN's from datafiles. After analyze of this SCN's, SMON can make decision to open database, make recover, or to make other operations to open database in consistent mode.
Previous Topic: Estimate the size of an index
Next Topic: missing entry in sys.seg$ view
Goto Forum:
  


Current Time: Fri Sep 20 12:39:10 CDT 2024