๐ ์ ๊ณต ๊ณต๋ถ/DB๊ธฐ์ด14 [DB] ๋์์ฑ ์ ์ด Concurrency Control Techniques Concurrency Control Protocols : guarantee serializability (์ง๋ ฌํ ๋ณด์ฅ) Locking Timestamps multiversion CC protocols Optimistic protocols Multiple granularity concurrency control protocol Two-phase Locking Techniques : ์ด์ค ๋ผํน lock ์ํ 1, unlock ์ํ๋ 0 Lock table : lock ์ ๋ณด๋ฅผ ๊ด๋ฆฌํ๋ ์๋ธ์์คํ plus a queue for transactions that are waiting to access item Shared/Exclusive (or Read/Wr.. 2022. 12. 30. [DB] Transaction processing Transaction Concepts Concurrent Executions Transaction Schedule Serializability Recoverability Single-User vs Multiuser Systems ๊ต๋ ์ํ : interleaved concurrency Transaction : an executing program that forms a logical unit of db processing Begin transaction - end transaction; includes DB access operations read-only / read-write transaction read-item(X) : ๋์คํฌ๋ธ๋ก ์ฃผ์์ฐพ๊ธฐ-๋ฒํผ์ ๋ณต์ฌ-ํ๋ก๊ทธ๋จ ๋ณ์๋ก ๋ณต์ฌ write-item(X).. 2022. 12. 30. [DB] Indexing structures for files / ๋ฌผ๋ฆฌ์ DB์ค๊ณ Index structures for files index : ์ถ๊ฐ์ ์ธ ๋ณด์กฐ์ ๊ทผ๊ตฌ์กฐ, ๊ฒ์์๋ ์ฆ๊ฐ, ๋์ฒด๋ฐฉ๋ฒ์ ์ ๊ณตํจ, ํจ์จ์ ๊ฒ์ Single-level ordered indexes primary, secondary, clustering ISAM : Indexed Sequential Access Method Multilevel indexes B trees, B+ trees Types of Single-level ordered indexes Primary index : ํค ํ๋ ์ ๋ ฌ ํ์ผ์์ ์ ๋ ฌ ํค ํ๋์ ๋ํด ์ ์๋ ์ธ๋ฑ์ค Clustering index : ํค๊ฐ ์๋๊ฑธ๋ก ์ ๋ ฌ๋ ํ์ผ์์ ์ ๋ ฌ ํ๋์ ๋ํด ์ ์๋ ์ธ๋ฑ์ค Secondary index : any nonordering field Prima.. 2022. 12. 30. [DB] Disk, ํ์ผ๊ตฌ์กฐ, Hashing, ์ ์ฅ์ ์ค๊ณ DBs are stored physicaly as files of records stored on magnetic disks. storage hierarchy primary storage : ์ฃผ๊ธฐ์ต์ฅ์น operated on directly by the CPU Secondary storage : ๋ณด์กฐ๊ธฐ์ต์ฅ์น, ์จ๋ผ์ธ Tertiary storage : ์คํ๋ผ์ธ ์์นด์ด๋ธ (์จ๋ผ์ธ์ผ๋ก ๋ก๋ ํ์) Memory Hierarchies and storage devices ์์ ์ ์ฅ์ : ๋น ๋ฆ, ์์, ๋น์ ํ์ ์ ์ฅ์ : ๋๋ฆผ, ํผ, ์ Storage of DBs ๋ฌผ๋ฆฌ์ DB ์ค๊ณ files of records : locate them efficiently Primary FIle organizations heap f.. 2022. 12. 30. [DB] SQL programmingโจ๏ธ (2) Java Database Conectivity JDBC : sql connection function calls for java programming can access any DBMS that has a JDBC driver allows connect to data sources steps in JDBC ๋งค๊ฐ๋ณ์ ์ ์ (by “?”) ํ๋ก๊ทธ๋จ ๋ณ์์ ๋งค๊ฐ๋ณ์๋ฅผ ๋ฐ์ด๋ executeQuery๋ก SQL ์คํ ๊ฒฐ๊ณผ๋ฅผ ResultSet์ ๋ฐํ db stored procedures ์ง์์ ์ธ ๋ชจ๋์ DB์๋ฒ ๋ก์ปฌ์ ์ ์ฅ๋จ ์ฅ์ : ์ฌ๋ฌ ์์ฉํ๋ก๊ทธ๋จ์ ์ฌ์ฉ, ์ํต ๋น์ฉ ๊ฐ์, ์ตํต์ฑ SQL persistent stored modules : ์๊ตฌ์ ์ฅ ๋ชจ๋ SQL/PSM SQL + stored functions + a.. 2022. 12. 30. [DB] SQL Programmingโจ๏ธ (1) Database Programming ๋ชฉํ : ๋ํํ ์ธํฐํ์ด์ค๊ฐ ์๋ ์์ฉํ๋ก๊ทธ๋จ์์ DB์ ์ ๊ทผ ์? : ํธ๋ฆฌํ์ง๋ง ๋ถ์ถฉ๋ถํ๊ณ , ๋๋ถ๋ถ์ด ์์ฉ ํ๋ก๊ทธ๋จ์์ ๋ง๋ค์ด์ง DB programming Approaches (์ ๊ทผ๋ฐฉ๋ฒ) ์๋ฒ ๋๋ ํจ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ (API) ์ ์ธ์ด : DBPL (Database Programming Language) → ๋ถ์ผ์น๋ฅผ ์ต์ํํ ์ ์์ Impedance Mismatch : ์ํผ๋์ค ๋ถ์ผ์น ํธ์คํธ ์ธ์ด์ DB๋ชจ๋ธ ์ฌ์ด์ ๋นํธํ์ฑ Typical sequence of interaction in DB Programming ํด๋ผ์ด์ธํธ ํ๋ก๊ทธ๋จ์ด DB์๋ฒ์์ ์ฐ๊ฒฐ์ open ํด๋ผ์ด์ธํธ ํ๋ก๊ทธ๋จ์ด ์ง์์ด๋ฅผ ๋ณด๋ DB์ ๊ทผ์ด ํ์์์ด์ง๋ฉด ์ ์ ์ข ๋ฃ Embedded SQL COBOL, C.. 2022. 12. 30. ์ด์ 1 2 3 ๋ค์ 728x90 ๋ฐ์ํ