quiz 3 - week 9 content Flashcards
A transaction comprises a unit of ___ ___
Transactions take the database from one ___ ___ to the next ___ ___
in Oracle databases a transaction implicitly begins with the ______________________
Issuing either a _____ or ____ statement explicitly ends a transaction
database work
consistent state, consistent state
in Oracle databases a transaction implicitly begins with the first statement that modifies data
commit or rollback
When you issue a COMMIT, you are assured that :
all of your changes have been ___ ___
that any data ___ ___ and ___ have been validated
successfully saved
integrity checks, rules
what does rollback do
ends transaction
undo any uncommitted changes
is an undo button
savepoint
rollback to
SET TRANSACTION:
savepoint- creates a marked poiint
rollback to - rolls back transactions to the marked point without rolling back any of the work that preceded it
allows you to set various transaction attributes, such as the transaction’s isolation level and whether it is read-only or read-write.
atomicity
a transaction is atomic if it __________________ or __________________
DDL are implemented in a manner that:
1
2
3
succeeds as a whole
fails as a whole
commit outstanding work, ending a transactions in place.
perform DDL
Commit DDL, roll back if failed
consistency
should not introduce ___ ___ to the database
tools to minimize data inconsistencies
____________
wrong data
tabular structure, data types, constraints
3rd normal form
1nf
2nf
3nf
atomic, unique pk
non-key columns are fully functionally dependent on the pk
every non-key column must depend only on the primary key, not on another non-key column
__________-Is the contract between the database and the user that
states that a transaction is stored in the database when it is
completed no matter what happens (even if the system will
fail)
durability
___________- * Every transaction has to be dealt with in isolation even if
the transactions are concurrent
- For example there should be a mechanism that allows to
resolve the conflicts arising from multiple users updating
same data at the same time
isolation
Whenever an INSERT, UPDATE or DELETE statement is issued, the data is not immediately sent to the table but, rather, is temporarily stored in the ___ __
When the user issues a SELECT statement to view the data, data from the table is combined with the data from the buffer before presenting it to the user and the
user thinks that the data has been inserted
Other users, however, do not see the data. Locks prevent users from ___________________ when they are simultaneously making changes and so are very
important
user’s buffer.
destroying each other’s data
___ are acquired when any process accesses a piece of data where there is a chance that another concurrent process will need this piece of data as well at the same time. By locking the piece of data we ensure that we are able to action on that data the way we expect.
- ____ occur when two processes need access to same piece of data concurrently so one process locks the data and the other one needs to wait for the other one to complete and release the lock. As soon as the first process is complete, the blocked process resumes operation. The blocking chain is like a queue: once the blocking process is complete, the next processes can continue.
- _____ occurs when one process is blocked and waiting for a second process to complete its work and release locks, while the second process at the same time is blocked
and waiting for the first process to release the lock
Locks
blocks
Deadlock
you can save part of a transaction t/f
f
You can not save part of the transaction to the database. It will either be saved as a whole or none of the modifications will be saved
A transaction is defined as all the _________________
DML statements that are placed between two COMMITs
A ___ ___ occurs when a transaction reads data that another transaction has modified but not yet committed. If the other transaction is rolled back, the first transaction is left with incorrect data
A __________ happens when a transaction reads the same data twice but finds it has changed between the two reads due to another transaction’s update
___ ___ occur when a transaction reads a set of rows that satisfy a condition, but another transaction inserts or deletes rows that meet the same condition, causing the result set to change upon a re-read
dirty read
non-repeatable read
Phantom reads
4 isolation levels
_______:
* Allows a transaction to read data that has been modified by other transactions but not yet
committed.
__________:
* A transaction can only read data that has been committed by other transactions.
__________:
* Ensures that if a transaction reads a set of rows, it will see the same set of rows throughout the entire transaction.
___________:
* Provides the highest level of isolation.
* Ensures complete isolation between transactions, preventing any interference
READ UNCOMMITTED
READ COMMITTED
REPEATABLE READ
SERIALIZABLE