1
TRANSACTIONS AND THE ACID PROPERTIESट्रांजैक्शन और एसिड गुण
A TRANSACTION is a unit of work that must happen completely or not at all.
- ATOMICITY: all of it or none of it
- CONSISTENCY: it takes the database from one valid state to another
- ISOLATION: concurrent transactions do not see each other's unfinished work
- DURABILITY: once committed, it survives a failure
- COMMIT makes the changes permanent; ROLLBACK undoes them; SAVEPOINT marks a point to roll back to
- एटॉमिसिटी: सब कुछ या कुछ भी नहीं
- कंसिस्टेंसी: यह डेटाबेस को एक वैध अवस्था से दूसरी वैध अवस्था में ले जाता है
- आइसोलेशन: समवर्ती ट्रांजैक्शन एक-दूसरे का अधूरा काम नहीं देखते
- ड्यूरेबिलिटी: कमिट होने के बाद यह विफलता में भी बचा रहता है
- कमिट बदलाव स्थायी करता है; रोलबैक उन्हें पलटता है; सेवपॉइंट वह बिंदु चिह्नित करता है जहाँ तक लौटा जा सके
2
LOCKING AND CONCURRENCY CONTROLलॉकिंग और समवर्तिता नियंत्रण
CONCURRENCY CONTROL stops simultaneous transactions from corrupting each other's data.
- Without it you get LOST UPDATES, DIRTY READS of uncommitted data, and inconsistent reads
- A SHARED LOCK lets many transactions read; an EXCLUSIVE LOCK lets one transaction write
- TWO-PHASE LOCKING: a transaction acquires all its locks before it releases any
- DEADLOCK: two transactions each wait for a lock the other holds. The DBMS rolls one back
- इसके बिना आपको लॉस्ट अपडेट, अकमिटेड डेटा के डर्टी रीड, और असंगत रीड मिलते हैं
- शेयर्ड लॉक कई ट्रांजैक्शनों को पढ़ने देता है; एक्सक्लूसिव लॉक एक ट्रांजैक्शन को लिखने देता है
- टू-फेज लॉकिंग: ट्रांजैक्शन कोई लॉक छोड़ने से पहले अपने सभी लॉक ले लेता है
- डेडलॉक: दो ट्रांजैक्शन एक-दूसरे के पास के लॉक की प्रतीक्षा करते हैं। डीबीएमएस एक को रोलबैक करता है
3
ROLL BACK AND ROLL FORWARDरोल बैक और रोल फॉरवर्ड
After a failure the database recovers in two directions.
- ROLL FORWARD re-applies the changes recorded in the REDO LOGS, including the archived ones
- ROLL BACK undoes the changes of transactions that had NOT committed, using the ROLLBACK or UNDO data
- After recovery, every committed transaction is restored, and every uncommitted one is rolled back
- SMON performs this instance recovery when the database restarts
- रोल फॉरवर्ड रीडू लॉग में दर्ज बदलाव फिर लागू करता है, आर्काइव्ड लॉग सहित
- रोल बैक उन ट्रांजैक्शनों के बदलाव पलटता है जो कमिट नहीं हुए थे, रोलबैक या अनडू डेटा से
- पुनर्प्राप्ति के बाद हर कमिटेड ट्रांजैक्शन बहाल होता है, और हर अकमिटेड रोलबैक होता है
- डेटाबेस फिर शुरू होने पर एसमॉन यह इंस्टेंस पुनर्प्राप्ति करता है