Escolar Documentos
Profissional Documentos
Cultura Documentos
The following are the short summarization and example for further recommendation related to the research topic:
Example: UPDATE Account_A SET Balance= Balance -100; 1. Read(A) 2. A = A 100 3. Write(A) UPDATE Account_B SET Balance= Balance +100; 4. Read(B) 5. B = B + 100 6. write(B) o o
Transaction may fail after step 3 and before step 6 (failure could be due to software or hardware) The system should ensure that updates of a partially executed transaction are not reflected in the database
CONSISTENCY - Transaction transform the DB from one correct state to another correct state
Example: UPDATE Account_A SET Balance= Balance -100; 1. Read(A) 2. A = A 100 3. Write(A) UPDATE Account_A SET Balance= Balance +100; 4. Read(B) 5. B = B + 100 6. write(B) o
In this example, the sum of A and B is unchanged by the execution of the transaction
Example: Transaction T1 Transaction T2 1. Read(A) 2. A = A 100 3. Write(A) Read(A), Read(B), Write(A+B) 4. Read(B) 5. B = B + 100 6. write(B) o What will T2 see? Database changes not revealed to users until after transaction has completed o Isolation can be ensured trivially by running transactions serially However, executing multiple transactions concurrently has significant benefits
DURABILITY - Once a transaction commits, changes are permanent: no subsequent failure can reverse the effect of the transaction.
Example: UPDATE Account_A SET Balance= Balance -100; 1. Read(A) 2. A = A 100 3. Write(A) UPDATE Account_A SET Balance= Balance +100; 4. Read(B) 5. B = B + 100 6. write(B) o
Resolve hardware issue: You should check the error log and hardware component. If you will find any problem with the hardware then replace it with the new one.
Restore from Backup: After you have satisfy from the harware and still unable to recover database then restore the SQL Server database from latest backup and fix the problem.
Run DBCC CHECKDB Command: If your backup is not clean and updated the run DBCC CHECKDB command to resolve the problem.