Тёмный

Oracle Database: Oracle Row Lock Contention 

Ni TSOH
Подписаться 1,7 тыс.
Просмотров 2,2 тыс.
50% 1

Oracle Database Row Lock Contention
Oracle Row Lock Contention
Database row lock contention
LOCKS:
- Locks are used by Oracle databases to provide data concurrency and integrity between transactions.
- Locking within an Oracle database is an entirely automatic mechanism that prevent destructive interaction
between transactions accessing the same resource
- There are several levels to locking, but the Oracle Database automatically uses the lowest applicable level of
restrictiveness to provide the highest degree of data concurrency yet also provide fail-safe data integrity
Consistency and concurrency
- Data concurrency means that many users can access data at the same time.
- Data consistency means that each user sees a consistent view of the data,
including visible changes made by the user's own transactions and transactions of other users.
As DBA's, we need to have a good understand of what happens when transactions are issued against the database.
ACID Model:
- A transaction is a logical, atomic unit of work that contains one or more SQL statements.
- A transaction groups SQL statements so that they are either all committed, which means they are applied to
the database, or all rolled back, which means they are undone from the database.
- Oracle Database assigns every transaction a unique identifier called a transaction ID.
- A transaction can either be a DDL or a DML
A Transaction ends when on of the following occurs:
- A user runs a DDL command (Implicit commit)
- A user issues a COMMIT or ROLLBACK
- A user exits normally from most Oracle Database utilities and tools, causing the current transaction to be implicitly committed (graceful shutdown)
- A client process terminates abnormally, causing the transaction to be implicitly rolled back using metadata stored in the transaction table and the undo segment (abort)
To ensure consistency and concurrency, the database uses the ACID model
ACID is an acronym for the following 4 key properties that define a transaction:
A - Atomicity: The entire sequence of actions must be either completed or aborted. The transaction cannot be partially successful.
C - Consistency: The transaction takes the resources from one consistent state to another.
I - Isolation: A transaction's effect is not visible to other transactions until the transaction is committed.
The database must serialize concurrent access to data (Enqueue mechanism)
D - Durability: Changes made by the committed transaction are permanent and must survive system failure.
These 4 properties represent a set of database design principles that emphasize aspects of reliability
that are important for business data and mission-critical applications.
A TX lock therefore is acquired when a transaction initiates its first change and is held until the transaction
does a COMMIT or ROLLBACK.
It is used mainly as a queuing mechanism so that other sessions can wait for the transaction to complete.
Oracle uses what we call an enqueue mechanism:
----------------------------------------------
which is is a sophisticated locking mechanism that permits several concurrent processes to share known
resources to varying degrees.
Enqueues coordinate parallel access to Oracle resources such as objects or data records.
So When multiple transactions need to lock the same resource, the first transaction to request the lock obtains it,
This enqueue mechanism is automatic and requires no administrator interaction.
It is embedded withing the internals of the oracle architecture
There are different levels of locking which can either be automatic or manual but we will not talk about those in this demo
DEMO
#oracle #locks #enqueue #database #locking
Related Videos:
---------------
Introduction to Structured Query Language SQL Oracle Database
• Introduction to Struct...
Follow me:
----------
LinkedIn: / atsohmofor
Twitter: / bindag
OR @Bindag
email: bobsukki@gmail.com
Telegram: NI TSOH
RU-vid: ru-vid.com/show-UCx06... OR NI TSOH

Опубликовано:

 

18 май 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@bobsukki
@bobsukki 2 года назад
Follow me: ---------- LinkedIn: www.linkedin.com/in/atsohmofor/ Twitter: twitter.com/Bindag OR @Bindag email: bobsukki@gmail.com Telegram: NI TSOH RU-vid: ru-vid.com/show-UCx06... OR NI TSOH
@nsar006
@nsar006 2 года назад
very nicely explained and very much informative
@bobsukki
@bobsukki Год назад
Glad it was helpful!
@sota1302
@sota1302 2 года назад
I do not remember blocking sessions explained so eloquently. Thank you for the great video!
@bobsukki
@bobsukki 2 года назад
Wow, thank you. I am happy I provided another perspective 👍🏾
@sota1302
@sota1302 2 года назад
@@bobsukki Indeed! Thank you
@albertoguilberto8194
@albertoguilberto8194 2 года назад
Excellent vidéo ✅
@bobsukki
@bobsukki 2 года назад
Thank you Alberto 🙏
@iconitconsulting7981
@iconitconsulting7981 2 года назад
Great content, I have been waiting on a video that deals with Database Performance. Thank you for making one!
@bobsukki
@bobsukki 2 года назад
I am glad you like it. I plan on addressing more performance related concepts. Thank you
@jkamdem101
@jkamdem101 2 года назад
This is a must have in any Dba’s liked videos on here, well explained… performance tuning made simple. 👍
@bobsukki
@bobsukki 2 года назад
Absolutely! Thank you for such a great recommendation 🙏🏽
@SANDATA764
@SANDATA764 2 года назад
Please do more videos on performance tuning, execution plan and sql tuning. Thanks sir
@bobsukki
@bobsukki 2 года назад
Sure 👍
@velentinende6667
@velentinende6667 2 года назад
Top Notch!! A well structured, educative video with a hands-on activity on row lock contention that is as good as you can get. Great work Atsoh!
@bobsukki
@bobsukki 2 года назад
Much appreciated! Thank you 🙏
@iconitconsulting7981
@iconitconsulting7981 2 года назад
Agreed!
@knowledegofeveryyhing5277
@knowledegofeveryyhing5277 2 года назад
Great and thanks for sharing
@bobsukki
@bobsukki 2 года назад
Absolutely. Thank you
@ahteshambabar1678
@ahteshambabar1678 2 года назад
Hi Sir...Thanks for the nice video.. i have one query which has been asked in an interview.... question--there is a table which is having huge rows and DML operations is going on that table ..at the same time , you need to add couple of columns on that table ..how will you do that ?
@bobsukki
@bobsukki 2 года назад
Well the enqueue mechanism will continue to manage the locks as they are acquired and released. If DML already acquired the lock, no structural change to table can be made until DML completes (commits or rolls back). Alter table statement will hang until DML completes. Hope that helps.
@sheltonbwondara7630
@sheltonbwondara7630 3 месяца назад
Can you paste the sql statements on here somewhere
@bobsukki
@bobsukki 2 месяца назад
Since these are simple statements, would you be able to just follow and copy onto your SQL prompt? Unfortunately, I did not include these in the transcript
@user-tn6qt3xx5w
@user-tn6qt3xx5w 9 месяцев назад
Could you please paste those sql statements here sir
@sheltonbwondara7630
@sheltonbwondara7630 3 месяца назад
Did he paste those SQL statements on here?
Далее
Oracle Database: Oracle SGA Memory Advisor
17:50
Просмотров 2,4 тыс.
Oracle Database: ACTIVE Database DUPLICATION using RMAN
38:37
Hamster Kombat 20 July Mini Game
00:13
Просмотров 10 млн
Tom🍓Jerry 😂 #shorts #achayanarmyfamily
00:14
Просмотров 11 млн
Oracle Database Security Assessment
41:34
Просмотров 1,1 тыс.
DBMS - Locking Methods
5:07
Просмотров 100 тыс.
Goo Goo Dolls - "Iris" Behind-the-Track (Dizzy 20)
5:19
Hamster Kombat 20 July Mini Game
00:13
Просмотров 10 млн