一、如果是刚刚删除,那么有两方法:
首先用show parameter undo;命令查看当时的数据库参数undo_retention设置。
显示如下:
undo_management string AUTO
undo_retention integer 10800
undo_suppress_errors boolean FALSE
undo_tablespace string UNDOTBS1
undo_retention(保持力),10800单位是秒。即3个小时。
修改默认的undo_retention参数设置:
ALTER SYSTEM SET undo_retention=10800 SCOPE=BOTH;
方法1,通过oracle提供的回闪功能:
exec dbms_flashback.enable_at_time(to_date('2007-07-23 10:21:00','yyyy-mm-dd hh24:mi:ss'));
set serveroutput on
DECLARE r_temp hr.job_history%ROWTYPE;
CURSOR c_temp IS SELECT * FROM hr.job_history;
BEGIN
OPEN c_temp;
dbms_flashback.disable;
LOOP
FETCH c_temp INTO r_temp;
EXIT WHEN c_temp%NOTFOUND;
insert into hr.job_history(EMPLOYEE_ID,JOB_ID,START_DATE,END_DATE) values (r_temp.EMPLOYEE_ID,r_temp.JOB_ID,r_temp.START_DATE,r_temp.END_DATE);
commit;
END LOOP;
CLOSE c_temp;
END;
方法2,insert into hr.job_history
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载