17
Locks and Locking Michal Šimoník [email protected] http://www.michalsimonik.com

Locks And Locking - EN

Embed Size (px)

Citation preview

Locks and Locking

Michal Šimoník

[email protected]://www.michalsimonik.com

Independent consultant

+11 years in IT+10 years with Oracle

Database ArchitectData Modeling and TuningSQL TuningDatabase TroubleshootingConsulting

Michal Šimoník© 2015

About me

Oracle Database

Architecture

Michal Šimoník© 2015

Oracle Locking system

Oracle Database

Architecture

● Oracle vs Others

● Things to know first ...

Michal Šimoník© 2015

Transactions and Locking

Oracle Database

Architecture

Michal Šimoník© 2015

Transactions and Locking

Oracle Database

Architecture

Michal Šimoník© 2015

Transactions and Locking

Oracle Database

Architecture

Michal Šimoník© 2015

Lock types

Oracle Database

Architecture

● DML locks

● DDL locks

● Internal locks and latches

Michal Šimoník© 2015

Deadlock

Oracle Database

Architecture

Michal Šimoník© 2015

Row Locks (TX) and Table Locks (TM)

Oracle Database

Architecture

● Row Locks○ TX - Exclusive

● Table Locks○ RS: Row Share○ RX: Row Exclusive○ S: Share○ SRX: Share row exclusive○ X: Exclusive

Michal Šimoník© 2015

Select ...

Oracle Database

Architecture

Michal Šimoník© 2015

DML and Automatic Locks

Oracle Database

Architecture

Michal Šimoník© 2015

DML and Automatic Locks

Oracle Database

Architecture

Michal Šimoník© 2015

DDL Locks

Oracle Database

Architecture

● Exclusive DDL locks

● Share DDL locks

● Breakable parse locks

Michal Šimoník© 2015

Latches

Oracle Database

Architecture

Michal Šimoník© 2015

Latches

Oracle Database

Architecture

Michal Šimoník© 2015

Oracle RAC - Global Enqueue Service (GES)

Oracle Database

Architecture

GES maintains synchronization of● Dictionary cache● Library cache● Transaction locks● DDL locks

Michal Šimoník© 2015

Thank you for your attention

Oracle Database

Architecture

Q&A