Вы находитесь на странице: 1из 6

Certificación 1Z0-051

Transacciones - SAVEPOINT

• Completa la siguiente tabla:

Command Rows Visible to the User Rows Visible to Others

truncate table tab;

insert into tab values ('one');

savepoint first;
insert into tab values ('two');

savepoint second;

insert into tab values ('three');

rollback to savepoint second;

rollback to savepoint first;

commit;

delete from tab;

rollback;

© 2017 DxD Applications & IT Solutions, S.L. Formación Oracle PL/SQL 1


Certificación 1Z0-051
Transacciones - SAVEPOINT

• Completa la siguiente tabla:

Command Rows Visible to the User Rows Visible to Others

truncate table tab; 0 0

insert into tab values ('one'); 1 0


savepoint first; 1 0
insert into tab values ('two'); 2 0
savepoint second; 2 0

insert into tab values ('three'); 3 0

rollback to savepoint second; 2 0

rollback to savepoint first; 1 0

commit; 1 1

delete from tab; 0 1

rollback; 1 1

© 2017 DxD Applications & IT Solutions, S.L. Formación Oracle PL/SQL 2


Certificación 1Z0-051
Transacciones

• Completa la siguiente tabla:

Step Session 1 Session 2

1 create table t1 as select * from all_users;

2 select count(*) from t1; select count(*) from t1;

3 delete from t1;

4 select count(*) from t1; select count(*) from t1;

5 rollback;

6 select count(*) from t1; select count(*) from t1;

© 2017 DxD Applications & IT Solutions, S.L. Formación Oracle PL/SQL 3


Certificación 1Z0-051
Transacciones

• Completa la siguiente tabla:

Step Session 1 Session 2

1 create table t1 as select * from all_users;

2 select count(*) from t1; select count(*) from t1;

Results are the same in both sessions

3 delete from t1;

4 select count(*) from t1; select count(*) from t1;

Results differ because transaction isolation conceals the changes

5 rollback;

6 select count(*) from t1; select count(*) from t1;

Results are the same in both sessions

© 2017 DxD Applications & IT Solutions, S.L. Formación Oracle PL/SQL 4


Certificación 1Z0-051
Transacciones

• Completa la siguiente tabla:

Step Session 1 Session 2

7 delete from t1;

8 select count(*) from t1; select count(*) from t1;

9 create view v1 as select * from t1;

10 select count(*) from t1; select count(*) from t1;

11 rollback;

12 select count(*) from t1; select count(*) from t1;

© 2017 DxD Applications & IT Solutions, S.L. Formación Oracle PL/SQL 5


Certificación 1Z0-051
Transacciones

• Completa la siguiente tabla:

Step Session 1 Session 2

7 delete from t1;

8 select count(*) from t1; select count(*) from t1;

9 create view v1 as select * from t1;

10 select count(*) from t1; select count(*) from t1;

11 rollback;

12 select count(*) from t1; select count(*) from t1;

Oh dear! The DDL statement committed the DELETE, so it can’t be rolled back.

© 2017 DxD Applications & IT Solutions, S.L. Formación Oracle PL/SQL 6

Вам также может понравиться