Recovery of deleted table contents
Suppose the data of mine table has been deleted and need to recover it so you have to create a CURSOR which will help you to recover it again. The contents of table is deleted at 11:00 PM.
Code:
DECLARE
CURSOR Cur_mine IS
SELECT *
FROM Mine;
v_row Cur_mine%ROWTYPE;
BEGIN
Dbms_Flashback.Enable_At_Time('04-JAN-10 10:55:00');
OPEN Cur_Mine;
Dbms_Flashback.Disable;
LOOP
FETCH Cur_Mine INTO v_row;
EXIT WHEN Cur_Mine%NOTFOUND;
INSERT INTO Mine VALUES
(v_row.Member_id, v_row.first_name,
v_row.last_name, v_row.email_address,
v_row.Contact_number, v_row.hire_date,
);
END LOOP;
CLOSE Cur_Mine;
COMMIT;
END;
Bookmarks