Vous êtes sur la page 1sur 2

Renzy B.

Guinto
BSIT-3D
1. Explain the following statement: a transaction is a logical unit of work.
- A transaction is a sequence of logically related commands that accomplish one task and transform the
database from one consistent state into another.

2. What is a consistent database state, and how is it achieved?


- A consistent database state is one in which all data integrity constraints are satisfied. To achieve a
consistent database state, a transaction must take the database from one consistent state to another.

3. List and discuss the four transaction properties.

Atomicity
A transaction must be an atomic unit of work; either all of its data modifications are performed, or none
of them is performed.
Consistency
When completed, a transaction must leave all data in a consistent state. In a relational database, all rules
must be applied to the transaction's modifications to maintain all data integrity. All internal data
structures, such as B-tree indexes or doubly-linked lists, must be correct at the end of the transaction.
Isolation
Modifications made by concurrent transactions must be isolated from the modifications made by any
other concurrent transactions. A transaction either recognizes data in the state it was in before another
concurrent transaction modified it, or it recognizes the data after the second transaction has completed,
but it does not recognize an intermediate state. This is referred to as serializability because it results in
the ability to reload the starting data and replay a series of transactions to end up with the data in the
same state it was in after the original transactions were performed.
Durability
After a transaction has completed, its effects are permanently in place in the system. The modifications
persist even in the event of a system failure.

4. What does serializability of transactions mean?


When several concurrent transactions are trying to access the same data item, the instructions within
these concurrent transactions must be ordered in some way so as there are no problem in accessing and
releasing the shared data item.

5. What is a transaction log, and what is its function?


Every SQL Server database has a transaction log that records all transactions and the database
modifications made by each transaction. The transaction log must be truncated on a regular basis to keep
it from filling up. However, some factors can delay log truncation, so monitoring log size is important.
Some operations can be minimally logged to reduce their impact on transaction log size.
The transaction log is a critical component of the database and, if there is a system failure, the transaction
log might be required to bring your database back to a consistent state. The transaction log should never
be deleted or moved unless you fully understand the ramifications of doing this.

6. What is a scheduler, what does it do, and why is its activity important to concurrency control?
- DBMS_SCHEDULER is a more sophisticated job scheduler introduced in Oracle 10g. The older job
scheduler, DBMS JOB, is still available, is easier to use in simple cases and fit some needs that
DBMS_SCHEDULER does not satisfy.

7. What is a lock, and how, in general, does it work?


-A lock is a variable associated with a data item that describes the status of the item with respect to
possible operations that can be applied to it. Generally, there is one lock for each data item in the
database. Locks are used as a means of synchronizing the access by concurrenttransactions to the
database item.

8. What are the different levels of lock granularity?


-High granularity and low granularity

9. Why might a page-level lock be preferred over a field-level lock?


For large tables, table locking is often better than row locking.

10. What is concurrency control, and what is its objective?


-The ability to have one transaction work with one set of resources while another transaction
Simultaneously works with others.

11. What is an exclusive lock, and under what circumstances is it granted?


-An exclusive lock prevents any other locker from obtaining any sort of a lock on the object. This provides
isolation by ensuring that no other locker can observe or modify an exclusively locked object until the
locker is done writing to that object.

12. What is a deadlock, and how can it be avoided? Discuss several strategies for dealing with deadlocks.
Deadlocks - A set of processes is deadlocked if each process in the set is waiting for an event that only
another process in the set.

processes are granted exclusive access to devices


we refer to these devices generally as resources

13. What are some disadvantages of time-stamping methods for concurrency control?
14. Why might it take a long time to complete transactions when an optimistic approach to concurrency
control is used?

Vous aimerez peut-être aussi