Which statement is true about the FLASHBACK command?

Examine the commands:
SQL> ALTER SESSION SET RECYCLBIN = ON;
Session altered.
SQL> DROP TABLE emp; –(First EMP table)
Total dropped.
SQL> CREATE TABLE emp (id NUMBER CONSTRAINT emp_id_idx PRIMARY KEY, name
VARCHAR2 (15), salary NUMBER(7,2) );
Table created.
You then execute multiple INSERT statements to insert rows into EMP table and drop the
table again:
SQL> DROP TABLE emp; — (Second EMP table)
Table dropped.
SQL> FLASHBACK TABLE emp TO BEFORE DROP;
Which statement is true about the FLASHBACK command?

Examine the commands:
SQL> ALTER SESSION SET RECYCLBIN = ON;
Session altered.
SQL> DROP TABLE emp; –(First EMP table)
Total dropped.
SQL> CREATE TABLE emp (id NUMBER CONSTRAINT emp_id_idx PRIMARY KEY, name
VARCHAR2 (15), salary NUMBER(7,2) );
Table created.
You then execute multiple INSERT statements to insert rows into EMP table and drop the
table again:
SQL> DROP TABLE emp; — (Second EMP table)
Table dropped.
SQL> FLASHBACK TABLE emp TO BEFORE DROP;
Which statement is true about the FLASHBACK command?

A.
It recovers the structure, data, and indexes of the first emp table.

B.
It recovers only the structure of the second emp table.

C.
It returns an error because two tables with the same name exist in the recycle bin.

D.
It recovers the structure, data, and indexes of the second emp table.



Leave a Reply 7

Your email address will not be published. Required fields are marked *


vijay

vijay

Ans is D.
Flashback before drop restores latest table if no object_name is provided.

fol

fol

D tested
ALTER session SET RECYCLEBIN = ON;
CREATE TABLE emp (id NUMBER CONSTRAINT emp_id_idx PRIMARY KEY, name VARCHAR2 (15), salary NUMBER(7,2) );
insert into emp VALUES (1,’AAA’,111);
DROP TABLE emp;
CREATE TABLE emp (id NUMBER CONSTRAINT emp_id_idx PRIMARY KEY, name VARCHAR2 (15), salary NUMBER(7,2) );
insert into emp VALUES (2,’BBB’,222);
DROP TABLE emp;
commit;

FLASHBACK TABLE emp TO BEFORE DROP;
select * from emp;
ID NAME SALARY
———- ————— ———-
2 BBB 222