Hi,
Is SCN no also stamped in the header of
the oracle data block., if so is there any way
of seeing it.
Regards
sonia
Printable View
Hi,
Is SCN no also stamped in the header of
the oracle data block., if so is there any way
of seeing it.
Regards
sonia
Yes. the block header contains SCN no. for the block. I am not sure but I think dumping the block may show the SCN.
Sanjay
You can see the SCN by dumping the block.
e.g.
00193717 is the HEX value, convert it to decimal which is the SCN for the block.Code:Oracle process number: 11
Unix process pid: 4227, image: oraclefdbsd
*** 2002-09-16 14:29:01.920
*** SESSION ID:(8.868) 2002-09-16 14:29:01.919
Start dump data blocks tsn: 4 file#: 5 minblk 1312 maxblk 1312
buffer tsn: 4 rdba: 0x01400520 (5/1312)
scn:0x0000.00193717 seq:0x03 flg:0x00 tail:0x37171003
frmt:0x02 chkval:0x0000 type:0x10=DATA SEGMENT HEADER - UNLIMITED
Extent Control Header
-----------------------------------------------------------------
Extent Header:: spare1: 0 tsn: 4 #extents: 11 #blocks: 1549
last map rdba: 0x00000000 #maps: 0 offset: 4128
Highwater:: rdba: 0x014020ca ext#: 10 blk#: 97 ext size: 520
Sanjay
thanx sanjay,
Can u pls tell me who is responsible for updating the scn in the block and when it will be updated ? duing a checkpoint ?
Regards
sonia
thanx sanjay,
Can u pls tell me who is responsible for updating the scn in the block and when it will be updated ? duing a checkpoint ?
Regards
sonia
Whenever a transaction is commited a new SCN is issued I am not sure which process will right SCN to the data block.
Sanjay
Hi sanjay,
U had told about dumping the block....
How exactly to do that...
regards
sonia
From SVRMGR do this..
ALTER SYSTEM DUMP DATAFILE FILE# BLOCK BLOCK#;
One trace file will be generated in the UDUMP directory.
Sanjay
I don't think there is anything like block scn scn is for datafile and on dumping the block u see the file scn only am i correct sonia/sanjay
In my little knowledge, I know that SCNs are for Data File Headers, Control Files, Redo Logs and Rollback Segments. They are NOT for data blocks. CKPT archive process writes the SCNs to these files when a COMMIT is initiated.
1. ckpt process does not write at commit
2. lgwr writes at commit only to redologs that includes writing scn as well.
3. at checkpoint datafileheaders/controlfiles are updated with scns
4. certainly there is no block level scn Regards
Of course there is a SCN recorded in each and every block! And each and every block in datafile could have different SCN recorded in it. SCN in block marks the point in time when last changes have been written into that block.
This is the basic principle that allow Oracle to generate a read consistent view for a query. If SCN in a block is greater than te one in which query was started Oracle knows this block was changed after the query has started, so it must obtain a before change immage of that block from rollback segment.
sm8728, quester,
Oracle blocks DO contain the SCN. Read through this and you will know how and why it is there.
http://www.ixora.com.au/notes/cache_header.htm
Sanjay
[Edited by SANJAY_G on 09-20-2002 at 12:59 AM]
SM....
Sanjay is right...every block contains an SCN number.
I am pasting the quote from oracle documetation, just go
through this...
--------------------
Oracle8i Recovery Manager User's Guide and Reference
Release 2 (8.1.6)
How Incremental Backups Work
Each data block in a datafile contains an SCN, which is the SCN at which the last change was made to the block. During an incremental backup,
RMAN reads the SCN of each data block in the input file and compares it to the checkpoint SCN of the parent incremental backup. RMAN reads the
entire file every time whether or not the blocks have been used.
------------------------------
sanjy, u were talking about blocking the dump...i just tried
that, but could not figure out to which path does it write to...can u just explain me abt the same...
regards
sonia
Sonia, blocking the dump or dumping the block :)Quote:
Originally posted by sonia
sanjy, u were talking about blocking the dump...i just tried
that, but could not figure out to which path does it write to...can u just explain me abt the same...
The trace file goes to user_dump_dest.
Sanjay
[Edited by SANJAY_G on 09-20-2002 at 05:25 AM]
when is the block scn written to at commit or at checkpoint which process writes this to the block . can u clarify pls .
u mean to say that the scn no written to datafile header may be different from block scn . I am curous about these .
Dear sir
I am also wondering why SCN number is to be written to
data block in Datafile.
Normally all header information is getting updated due to
checkpoint process.
Checkpoint does synchronization and DBWR will write to datafile header
So Oracle Experts What is correct things
----------------------------------------------
Viraj
Oracle OCA
Read the complete thread properly.. Again!!!Quote:
Originally posted by virajvk
Dear sir
I am also wondering why SCN number is to be written to
data block in Datafile.
Viraj
Oracle OCA
Quote:
Originally posted by jmodic
Of course there is a SCN recorded in each and every block! And each and every block in datafile could have different SCN recorded in it. SCN in block marks the point in time when last changes have been written into that block.
This is the basic principle that allow Oracle to generate a read consistent view for a query. If SCN in a block is greater than te one in which query was started Oracle knows this block was changed after the query has started, so it must obtain a before change immage of that block from rollback segment.
[Edited by Sameer on 09-20-2002 at 06:04 AM]
The most confusion comes from the acronym SCN, bacause it is a common acronym for many different things in Oracle. Among other things, it can mean:
Sytem Commit Number
System Checkpoint Number
System Change Number
In the context of this therad SCN means System Change Number, which can be think of as Oracle's internal clock mechanysm. When whatever change happens to Oracle database this counter is incremented, no matter if that change will later on be commited or not.
Thanks for sharing this information. This is really a good way of looking at it.Quote:
Originally posted by jmodic
Of course there is a SCN recorded in each and every block! And each and every block in datafile could have different SCN recorded in it. SCN in block marks the point in time when last changes have been written into that block.
This is the basic principle that allow Oracle to generate a read consistent view for a query. If SCN in a block is greater than te one in which query was started Oracle knows this block was changed after the query has started, so it must obtain a before change immage of that block from rollback segment.
Quote:
Originally posted by SANJAY_G
Sonia, blocking the dump or dumping the block :)Quote:
Originally posted by sonia
sanjy, u were talking about blocking the dump...i just tried
that, but could not figure out to which path does it write to...can u just explain me abt the same...
The trace file goes to user_dump_dest.
Sanjay
[Edited by SANJAY_G on 09-20-2002 at 05:25 AM]
Hey sanjay.....it was a typO
O IC ;)Quote:
Originally posted by Sonia
Quote:
Originally posted by SANJAY_G
Sonia, blocking the dump or dumping the block :)Quote:
Originally posted by sonia
sanjy, u were talking about blocking the dump...i just tried
that, but could not figure out to which path does it write to...can u just explain me abt the same...
The trace file goes to user_dump_dest.
Sanjay
[Edited by SANJAY_G on 09-20-2002 at 05:25 AM]
Hey sanjay.....it was a typO
Concept of block level SCN is just like our row level locking. It's about efficiency. Think like this, we have a system where each and every transaction updates our datafile headers thus resulting in synchronization of all of the block level SCNs. In this case Oracle will write very aggressivle for each and every transaction resulting in heavy use of CPU. To avoid this, we have different level of SCNs.Quote:
Originally posted by virajvk
Dear sir
I am also wondering why SCN number is to be written to
data block in Datafile.
Normally all header information is getting updated due to
checkpoint process.
Checkpoint does synchronization and DBWR will write to datafile header
So Oracle Experts What is correct things
----------------------------------------------
Viraj
Oracle OCA
Block level SCN => just updates the changed block header. this happens during transaction
Check point SCN => updates all the block headers as well as datafile headers. this happens during check point.
So, in any typical system no. of SCN changes at block level are allways more than check poin SCNs.
(A transaction does not result in checkpoint)
I guess this will arguement will do alot to confuse others and stirr another 10 postings for this thread ;)