interview question perhaphs :-)
Hi
I am a OCP DBA :-) and i do not know the answers to this questions..all of you are welcome to cricize me :-) for askin this simple question..but i have serached the docs before askin this ?
here goes my 2 questions
1)when is the SCN assigned to a transaction..immediately after a commit is issued or after the contents of the redolog buffer are flushed to the disk
2)when you have row migration why does oracle keep a pointer in the block to the row where it has moved now ?
regards
Hrishy
Re: interview question perhaphs :-)
Quote:
Originally posted by hrishy
1)when is the SCN assigned to a transaction..immediately after a commit is issued or after the contents of the redolog buffer are flushed to the disk
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.
Quote:
Originally posted by hrishy
2)when you have row migration why does oracle keep a pointer in the block to the row where it has moved now ?
Only reason i think is to preserve the rowid. The rowid never changes for a row :)
HTH
Re: Re: interview question perhaphs :-)
Quote:
Originally posted by adewri
Only reason i think is to preserve the rowid. The rowid never changes for a row :)
HTH
Hi Amar.
Dude thats a cool answer...even i couldnt think of any other answer..
regards
Hrishy
Re: interview question perhaphs :-)
Quote:
Originally posted by hrishy
Hi
2)when you have row migration why does oracle keep a pointer in the block to the row where it has moved now ?
regards
Hrishy
It's especially essential if the row is in a table that is a Master table for a materilized view (using ROWID), otherwise, every time you had a row migration, you'd have to rebuild the materialized view.
Just one example... :)
Don't worry about asking questions, even DBA's with 10+ years experince don't know everything. If they did.. it'd be a pretty boring job.
Re: Re: interview question perhaphs :-)
Quote:
Originally posted by adewri
Only reason i think is to preserve the rowid. The rowid never changes for a row
Presumably if the rowid did change, all the indexes pointing to it would have to be updated too.
Re: interview question perhaphs :-)
Quote:
Originally posted by hrishy
Hi
2)when you have row migration why does oracle keep a pointer in the block to the row where it has moved now ?
regards
Hrishy
I belive this reason cud be the one of the reasons....
after Insert of data....a pointer pointing to memoray location is assinged to it.
after deletion of data....the pointer is dropped and not actual data is deleted, as writing 0 on disk takes too much time & unnecesssary use of resources.....
So if we think logically, and i AFAIK Oracle is wrriten in C to handle the memory allocation and deallocation part, Pointers to memory location can be assigned or dropped and can be updated but requires complex logic.......instead Pointer to Pointer wud be more flexible and easy....so when a row is migrated...a new pointer is assigned......
Correct me if i am wrong.......
Abhay.