Oracle's Locking Architecture
I'm specifically talking about 9i & 10G.
Is there any info that explains Oracle Locking mechanisms? I tried to find something on metalink but all I found was how to detect locks. I need to start from the beginning so that I understand the lock types when data is read, modified or deleted.
Any info please?
So in a nutshell, Oracle obtains an UPDATE lock to
modify data but does obtain any locks to read data.
Have I read this correctly?Effectively, yes.
That's Oracle's magic ..... 'readers do not block writers and writers do not block readers'
Oracle uses a 'Consistent Read' mechanism to rebuild any data block back to the time of query. If a user updates a row but has not committed, and another needs to see that row, the second user will recreate the image of the row using the in-memory copy of the updated row and the rollback/undo information about the row.
A query only needs to put sufficient locks in place to ensure the table does not get whacked. Nothing at the row level.
An update needs sufficient locks to ensure other writers can not change the row ... and to tell the readers to rebuild the block instead of using the 'current' version.
Similar Messages
-
Oracle BPM 10g architecture diagram
Hi,
Could you please anyone share the Oracle BPM 10g architecture diagram. Please send to my id : [email protected]
Regards,
Anandh PHi Daniel, Thanks a lot for posting the Architectuer details. We now know how the fantastic product works internally. Would you mind posting the newer version of the document? Thanks in advance.
-
What are the different situations in which Oracle will lock existing table/index statistics automatically?
As per my undrstanding to lock the statistics we must use "dbms_stats" package with lock_table_stats/lock_schema_stats procedures. I dont see any other situation where Oracle automatically locks the statistics.
Please share your experience.I dont see any other situation where Oracle automatically locks the statistics.Oracle never locks the statistics on its own. Oracle has only given methods so that one can decide whether to collect the statistics for volatile/static tables; so that the execution plans do not change drastically.
-
Where can I get oracle dead lock information
Hi Experts,
two days back I find oracle dead lock information at SM21 log file but when I checked today the old data was over written by new data.
Where can I find oracle dead lock information other than SM21? can anyone please help
Thanks in advance
Regards
Veera
Edited by: Veerab on Apr 27, 2011 8:22 AMHi,
Have you refered [SAP Note 84348 - Oracle deadlocks, ORA-00060 |https://service.sap.com/sap/support/notes/84348]? It contains good detailed description about possible oracle deadlock situations and analysis.
Along with the trace file generated by oracle (at directory /oracle/<SID>/saptrace/usertrace/), You can get historical information from alert<SID>.log file located at /oracle/<SID>/saptrace/background/.
In alert<SID>.log file the deadlock situation is written with deadlock graph at the time of occurances.
Regards,
Bhavik G. Shroff -
Oracle database Internal architecture
Hi
Any one Can explane me about oracle database internal architecture
thanks & regardsuser9098698 wrote:
Hi
Any one Can explane me about oracle database internal architectureYes, there are people who can explain this to you.
How much time do you want to spend? I've been learning the Oracle internal architecture for over 20 years and there are still new things to learn. (Well ... it also depends on what you mean by 'internal architecture'.)
If you want the basics - the Oracle Documentation set at http://tahiti.oracle.com has a Concepts manual that does a decent job of describing the basic architecture. And the Windows Platform Guide, the Unix Administrator's Reference give a fair bit of additional information. As does the Oracle Networking reference.
And there are courses. Oracle University courses provide a decent overview of the architecture. And Jonathan Lewis, Richard Foote and others give excellent courses and seminars on specific aspects of the architecture.
ANd there are books. Search for books by Tom Kyte. Robert Stackowiak.
And internet search.
And http://orainfo.com/architecture/architecture.htm
And ... -
How can I prevent oracle from locking accounts after failed logins?
how can I prevent oracle from locking accounts after failed logins?
Thankssvarma wrote:
So what is the difference between the profile settings ...FAILED_LOGIN_ATTEMPTS and the parameter settings SEC_MAX_FAILED_LOGIN_ATTEMPTS?
Prior to 11g we only used profiles to control failed_login_attempts.. Then why we need thsi new parameter now?http://download.oracle.com/docs/cd/E11882_01/server.112/e17110/initparams221.htm#I1010274
http://download.oracle.com/docs/cd/E11882_01/server.112/e17222/changes.htm#UPGRD12504
http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_6010.htm#SQLRF01310
As documented ...
FAILED_LOGIN_ATTEMPTS is a property of a profile, and will lock an account
SEC_MAX_FAILED_LOGIN_ATTEMPTS is an initialization parameter and will drop a connection but says nothing about locking accounts. -
Oracle's locking strategy question
I have a question related to Oracle's locking mechanism which I understand is related to taking "snapshots in time" to avoid writers blocking readers (which happens in SQL Server).
Suppose I had a table T1 with 1 billion records and column C1 = 4 in every row. Suppose the following events occur:
12:00 update T1 set C1 = 5
12:01 select C1 from T1 where ... (and this statement returns only one row)
1:00 the update statement executed at 12:00 finally finishes
Would oracle return the value 4 regardless or which row was selected at 12:01?
Why would this be more correct than locking the table and waiting until 1:00 and returning 5? Sure, this would be a long wait, but at 12:00 a command was issued to set every value to 5!You are question is related to oracle transaction
control and read consistency in the database in
Oracle database all the SQL and DML runs with SCN
timestamp.
for example
Session 1 SQL 12:00 > UPDATE t1 SET c4=5 ;
---assuming this runs for an hour
before updating c4=5 it takes the snapshot of the C4
column data and keeps in
UNDO segments to make other sessions read
consistent.
Session 2 SQL 12:01 > SELECT c4 FROM t1 WHERE ....
this will return 4 as the DML is not yet comminted in
the Session 1
To happen this Oracle database server process reads
the data from UNDO to answer your question.locks are
matianed at the database BLOCK header level.
Let me put a simple thought here
You have two debit cards issued for one account one
is with you and the other one is with your beloved
one.Balance in your account = Rs 40000
1) at 12:00 you went to a ATM and inserted your debit
card to draw amt Rs 20000
and your transaction is still processing ( you not
recieved the cash)
2) at 12:01 your beloved one went an another ATM and
interested to see the balance so do you think Rs
40000 should be shown or Rs 20000.
hope you got some ideaNot to pick nits, but I think this is a bad example. If you had such an important action (especially if it was going to take a long time to complete) you would/should have some kind of lock on modifying the account value so that this very thing couldn't happen! Only one transaction at a time gets to update the balance. In a sense, that might make Oracle look like the SQL Server you appear to be familiar with (the 2nd transaction would wait. A very long time!) But for a bank account type transaction, you almost have to.
Gaff -
Hello experts ,
Once again i want to clear my basic knowldge in terms of oracle locks.
what i knows is that oracle atumatically locked the object whenever we perform any dml operation.( update,delete)
but it is row level exclusive lock ( i.e. RX,in v$locked_object, it show locked mode 3 )
It is implicit lock which oracle provided automatically.
and the other lock is Explicit lock,
it is either we have to locked the by using LOCK statement ( by using LOCK statement we can lock the table in modes
(i.e row share(2),row exclusive(3), share(4), row share exclusive(5),exclusive(6) )
OR
the table is also locked by statemet "select ..for update"( but its row exlusive lock (RX 3))
but
when and in what condition we apply explicit lock?
what are the practical future of these lock?
can you please explain about these explicit lock like
row share(2)
row exclusive(3)
share(4)
row share exclusive(5)
exclusive(6)
I have read about these lock from books , blogs and other internet sites , but still my concepts is not clear
in these area.
Thanks in advance for your help.
Regards,
Prashant MhatreOracle uses locks (aka enqueues) to prevent destructive concurrent operations on a resource. Here is a short description of the different lock types written by Jonathan Lewis ("the international recognized Oracle Expert"): http://jonathanlewis.wordpress.com/2010/06/21/locks/.
Except of the SELECT FOR UPDATE case I don't think there are many situation in which setting an explicit lock is necessary - the server knows where and when locks have to be used. -
1Z1-478-Oracle Service-Oriented Architecture 11g Essentials
Hi All,
I would like to do the 1Z1-478-Oracle Service-Oriented Architecture 11g Essentials certification.And also it is closed on 30Mar13 after that will go into the production, If I do Beta Exam certification on or before 30Mar13,it is sufficient or I have to do the Beta Production certification also.
Regards
Mani
Edited by: Mani on Mar 29, 2013 3:46 AMHi Eric,
When you log back in to your account at ilearining.oracle.com, there should be a support link. Please post your question to the iLearning support team. You could also contact Oracle University at http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=225. This is an Oracle University product rather than an Oracle Certification product, so they would be the best team to assist. I hope this helps.
Regards,
Brandye Barrington -
Ingres vs Oracle exclusive locking
Ingres allows an exclusive lock on tables, set lockmode on tablename where readlock = exclusive which means the users can't access the same
rows that are being modified by another query.
Is there anything in oracle that does the same thing ? All of Oracle's locking seesm to be that you can
still read data. And that is what my user is afraid of. He doesn't want to read old data, when it's
being changed.
How do you work around this ?
Thanks.Ingres allows an exclusive lock on tables, set lockmode on tablename where readlock = exclusive which means the users can't access the same
rows that are being modified by another query.
Is there anything in oracle that does the same thing ? All of Oracle's locking seesm to be that you can
still read data. And that is what my user is afraid of. He doesn't want to read old data, when it's
being changed.
How do you work around this ?
Thanks. -
Does Index in Oracle Text lock local files?
Hi, I am planing to implement content search using file datastore. Let me explain how the whole search going to work, Users are going to upload the file, I am going to store the information about the file like filename, size, keywords, file path etc in Oracle table and I am going to store the original file in a different server. When indexing on filepath, does index lock local files on the Operating system? Does it affect the live data? Please I need answers to this ASAP. Can anyone help?
Thanks,
MeenaHi,
there are differences between the Engine of Text indexing, in 10G it was Verity, in 11G (from version 11.1.0.7) it is the Stellent technology, but I do not hope this is it.
Maybe you could make a dump of the creation of the indexes in both 10g and 11g. This can be done through:
select ctxsys.ctx_report.create_index_script('KSK_FILE_TABLE_CTX1') from dual;
This wil give you a create script with all the parameters. Maybe there is a different in your default settings for text indexes, possible the FILTER.
Herald ten Dam
Superconsult.nl -
Hi,
I am talking to an Oracle 8.1.7 db through Perl DBI for a certain Web Application.
In the back-end, a script is invoked every hour to sync parts of this db, with the master db. The sync'ing script takes quite a while to complete and it consists of a single transaction ( several update statements followed by a single commmit at the very end).
Now, I want to know what happens to any user who tries to modify something through the web-interface. If a query from the web-interface finds that a row is locked by the syncing script, how long will it wait before a timeout? ( if any timeout occurs at all, in the first place ! ). Can I control this timeout?
Please repond ASAP.
Thanks in advance,
RajeshHow much control do you have over the SQL being generated? There is a keyword 'NOWAIT' that can be added to a statement indicating that it shouldn't wiat for resources-- if it can't lock them immediately, it returns an ORA-00054 (if memory serves) resource locked and NOWAIT specified. Otherwise, by default, the statement will wait indefinitely.
In ODBC, you can specify a query timeout that will kill all queries after some amount of time.
Justin -
Oracle 11g R2 Architecture Diagram
Hi,
I trust this is the right way to go about the following
Few years ago I created an architecture diagram for 10g. I have now updated that diagram to include new features of Oracle 11g. Obviously there is so much one can detail in one page PDF Architecture diagram. It is in draft stage so I will appreciate any feedback on the diagram before I release it to the community. I have not released it on any website yet as I am keen on direct feedbacks. Anyone who is interested please send me an email to [email protected] and I will forward the diagram for their comments.
Regards,
MichHave you seen Oracle's interactive diagram?
Oracle's URLs are subject to sudden change without any user-friendly redirection, but current URL is:
http://www.oracle.com/webapps/dialogue/ns/dlgwelcome.jsp?p_ext=Y&p_dlg_id=9575302&src=7027600&Act=54 -
Can some help me to understand the oracle DB architecture. I'm in learning stage.
Besides reading the guides already given to you, try to enroll for a training program as well. Db architecture is not so small or simple that can be explained just like that.
Aman.... -
Hi Friends,
What kind of root issue leads to AE lock(Edition Lock) in oracle 11.2?
How do we implement a solution for AE type locked?
Thanks
newdbaHi Karan,
Thanks for your explaining. the reason is we have slow performance in database. Per checked, I found lots of block with AE. per your recommendation as
OWNER VIEW_NAME TEXT_LENGTH TEXT TYPE_TEXT_LENGTH TYPE_TEXT OID_TEXT_LENGTH OID_TEXT VIEW_TYPE_OWNER VIEW_TYPE SUPERVIEW_NAME EDITIONING_VIEW READ_ONLY
SYS CURRENTEDITION_OBJ 1490 select o."OBJ#",o."DATAOBJ#",o."OWNER#",o."NAME",o."NAMESPACE",o."SUBNAME",o."TY N N
N N
Thanks
newdba
Maybe you are looking for
-
Flash Player No Longer Working
My Adobe flash player has stopped working on Internet pages. (I can no longer view flash videos.) I have a 64-bit PC using Windows 7 and am running Internet Explorer 11. I've made sure I have the latest version of Flash Player installed, but still n
-
I need help with editing and formatting a newly created pdf file
-
How to measure the size of a string
windows app store how to measure the size of a string? string str = "Hello word windows app store";
-
How can i delete sync pics in my iphone
how can i delete sync pics in my iphone
-
At line selection in blocked ALV
HI FRIENDS,