Oracle__15. Oracle 1Z0-051 Exam - Transactions Flashcards
What happens to a SAVEPOINT after a commit?
It is deleted
What happens with this series of statements in a transaction? DELETE * FROM table1 WHERE field = 1 SAVEPOINT test DELETE * FROM table1 WHERE field = 2 SAVEPOINT test ROLLBACK TO test;
The second SAVEPOINT over writes the first SAVEPOINT because the savepoint name is the same.
Savepoint can be used to rollback DML statement or DDL statements or both?
Only DML statements
What clause can be added to a select statement which will temporary lock records from other users for updating or deleting?
FOR UPDATE
Can you rollback a DELETE statement?
Yes
Can you rollback a TRUNCATE statement?
No
What does the following statement do? SAVEPOINT test;
create a savepoint in a transaction
What does the following statement do? ROLLBACK to test;
ROLLSBACK the SQL statements to the test SAVEPOINT.
Can you create more than one save point in a transaction?
Yes
What happens to a transaction with several SAVEPOINT when the command ROLLBACK is executed?
all transactions are rolled back.
What type of command will perform an automatic commit?
Any DDL statement.
What will happen with transactions when you exit SQL *Plus?
There will be an Auto Commit.
During a transaction but before the commit can the user view the results by executing a select statement?
Yes
During a transaction but before the commit can another user view the results by executing a select statement?
No
During a transaction but before the commit can another user make changes to the same rows that are pending a change?
No.The rows are locked by the first user.
What happens to SAVEPOINT after a COMMIT?
They are erased
What happens to locked rows after a COMMIT?
They are released
During a transaction but before the commit and if the same user creates a new session, will the user in the new session we the data before the transaction or data from the uncommitted transaction?
The user will see the data prior to any uncommitted transaction in the new session.
What keywords can be added to a select statement to lock records during a transaction?
FOR UPDATE
If another user is in the process of a transaction, what option can be added to the SELECT .. FOR UPDATE so your statement is not locked until the other user performs a COMMIT or ROLLBACK?
NOWAIT
Where in a SELECT statement does the FOR UPDATE clause belong.
Just before the ORDER BY, otherwise the very last clause.
If you SELECT.. FOR UPDATE includes several tables are all select rows in all tables locked?
Yes
What keyword can be added to the SELECT..FOR UPDATE to limit the tables if all many tables are in the select?
FOR UPDATE OF ColumnnameThe columnname may have an alias and identified the particular table in which the rows will be locked.
What will this clause do in a select statement? FOR UPDATE WAIT 5
The select will wait 5 second before locking the row and returning control.