Oracle__15. Oracle 1Z0-051 Exam - Transactions Flashcards

1
Q

What happens to a SAVEPOINT after a commit?

A

It is deleted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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;

A

The second SAVEPOINT over writes the first SAVEPOINT because the savepoint name is the same.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Savepoint can be used to rollback DML statement or DDL statements or both?

A

Only DML statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What clause can be added to a select statement which will temporary lock records from other users for updating or deleting?

A

FOR UPDATE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Can you rollback a DELETE statement?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Can you rollback a TRUNCATE statement?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the following statement do? SAVEPOINT test;

A

create a savepoint in a transaction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the following statement do? ROLLBACK to test;

A

ROLLSBACK the SQL statements to the test SAVEPOINT.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Can you create more than one save point in a transaction?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What happens to a transaction with several SAVEPOINT when the command ROLLBACK is executed?

A

all transactions are rolled back.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What type of command will perform an automatic commit?

A

Any DDL statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What will happen with transactions when you exit SQL *Plus?

A

There will be an Auto Commit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

During a transaction but before the commit can the user view the results by executing a select statement?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

During a transaction but before the commit can another user view the results by executing a select statement?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

During a transaction but before the commit can another user make changes to the same rows that are pending a change?

A

No.The rows are locked by the first user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What happens to SAVEPOINT after a COMMIT?

A

They are erased

17
Q

What happens to locked rows after a COMMIT?

A

They are released

18
Q

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?

A

The user will see the data prior to any uncommitted transaction in the new session.

19
Q

What keywords can be added to a select statement to lock records during a transaction?

A

FOR UPDATE

20
Q

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?

A

NOWAIT

21
Q

Where in a SELECT statement does the FOR UPDATE clause belong.

A

Just before the ORDER BY, otherwise the very last clause.

22
Q

If you SELECT.. FOR UPDATE includes several tables are all select rows in all tables locked?

A

Yes

23
Q

What keyword can be added to the SELECT..FOR UPDATE to limit the tables if all many tables are in the select?

A

FOR UPDATE OF ColumnnameThe columnname may have an alias and identified the particular table in which the rows will be locked.

24
Q

What will this clause do in a select statement? FOR UPDATE WAIT 5

A

The select will wait 5 second before locking the row and returning control.

25
Q

Can a FOR UPDATE clause in a select which has more than one table?

A

Yes. Select rows of each table are locked

26
Q

What does the NOWAIT option for the FOR UPDATE do?

A

If any selected rows are locked the SQL statement will not wait and no lock any rows.The default is wait until all rows are released.

27
Q

List 3 main Transaction Control Commands.

A
  1. COMMIT2. ROLLBACK3. SAVEPOINT
28
Q

What is a PL *SQL Package?

A

a schema object that group logically related PL *SQL types, variables and subprograms.Have 2 parts a specification (spec) and bodyHave get and set methods

29
Q

What is different in PL *SQL in Oracle 11g?

A

force triggers of same type to follow a sequence.

30
Q

What happens if you do a ROLLBACK to a SAVEPOINT if the SAVEPOINT does not exist?

A

It creates an error.

31
Q

Where would the FOR UPDATE clause belong in this statement? SELECT Order, name FROM Orders JOIN Customers USING (Customer_id) WHERE order_total > credit limit ORDER BY order_id;

A

After the WHERE and before the ORDER BY.SELECT Order, nameFROM Orders JOIN CustomersUSING (Customer_id)WHERE order_total > credit limitFOR UPDATEORDER BY order_id;

32
Q

Can a DELETE or a TRUNCATE be performed on a table that is a parent of a referential integrity constraint?

A

Only if the table has an ON DELETE rule;

33
Q

Where would the FOR UPDATE clause belong in this statement and only lock the customer table? SELECT Order, name FROM Orders JOIN Customers USING (Customer_id) WHERE order_total > credit limit ORDER BY order_id;

A

SELECT Order, nameFROM Orders JOIN CustomersUSING (Customer_id)WHERE order_total > credit limitFOR UPDATE OF (name)ORDER BY order_id;