oracle 已提交误删除,恢复 闪回技术

select versions_starttime, versions_endtime, versions_xid,
versions_operation ,‘insert into scott.a values(‘||id||‘,‘||name||‘)‘ --id和name是这个表的字段
from scott.a versions between timestamp minvalue and maxvalue
order by VERSIONS_endTIME,versions_starttime;。或者直接
insert into t1 select * from t1 as
of timestamp to_timestamp(‘2009-03-17 11:06:00‘,‘yyyy-mm-dd hh24:mi:ss‘) ;

----****重点 ****------
SELECT *
FROM FLASHBACK_TRANSACTION_QUERY
where TABLE_OWNER = ‘CLYH‘
AND TABLE_NAME=‘CLPCSTOCK_CKMX‘
AND START_TIMESTAMP <=TO_DATE(‘2020-11-23 20:30:00‘,‘yyyy-mm-dd hh24:mi:ss‘)
AND START_TIMESTAMP >=TO_DATE(‘2020-11-23 20:00:00‘,‘yyyy-mm-dd hh24:mi:ss‘)
AND OPERATION=‘DELETE‘
-- and table_name = ‘clpcstock_ckmx‘
-- and

执行 UNDO_SQL 列的值即可;
----****重点 ****------


--insert into "CLYH"."CLPCSTOCK_CKMX"("SERIALNO","SSBM","TCODE","CKBH","KCXH","WLBH","WLMC","WLPH","WLFL","TM","CKDJ","CKSL","CKJE","OPER","SYSL","WSYSL","INPUTDATE","ORDERH","FIRSTDATE","GYSDM","SCRQ","TNOTE","GMRKFLAG","STM","BZQ","CKDM","LLR") values (‘9‘,‘100‘,‘105‘,‘CKZHGY-YCL20181006036‘,‘9‘,‘DC03000048‘,‘石墨.P1A(MP004).GDGZ0092‘,‘40417‘,‘1‘,‘001601230182‘,‘0‘,‘15‘,‘0‘,‘18801393‘,‘0‘,‘15‘,TO_DATE(‘06-OCT-18‘, ‘DD-MON-RR‘),‘1‘,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
insert into "CLYH"."CLPCSTOCK_CKMX"("SERIALNO","SSBM","TCODE","CKBH","KCXH","WLBH","WLMC","WLPH","WLFL","TM","CKDJ","CKSL","CKJE","OPER","SYSL","WSYSL","INPUTDATE","ORDERH","FIRSTDATE","GYSDM","SCRQ","TNOTE","GMRKFLAG","STM","BZQ","CKDM","LLR") values (‘9‘,‘100‘,‘105‘,‘CKZHGY-YCL20181006036‘,‘9‘,‘DC03000048‘,‘石墨.P1A(MP004).GDGZ0092‘,‘40417‘,‘1‘,‘001601230182‘,‘0‘,‘15‘,‘0‘,‘18801393‘,‘0‘,‘15‘,TO_DATE(‘06-OCT-18‘, ‘DD-MON-RR‘),‘1‘,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
insert into "CLYH"."CLPCSTOCK_CKMX"("SERIALNO","SSBM","TCODE","CKBH","KCXH","WLBH","WLMC","WLPH","WLFL","TM","CKDJ","CKSL","CKJE","OPER","SYSL","WSYSL","INPUTDATE","ORDERH","FIRSTDATE","GYSDM","SCRQ","TNOTE","GMRKFLAG","STM","BZQ","CKDM","LLR") values (‘8‘,‘100‘,‘105‘,‘CKZHGY-YCL820180930004‘,‘8‘,‘DC03000048‘,‘石墨.P1A(MP004).GDGZ0092‘,‘40417‘,‘1‘,‘001601230181‘,‘0‘,‘15‘,‘0‘,‘70354‘,‘0‘,‘15‘,TO_DATE(‘30-SEP-18‘, ‘DD-MON-RR‘),‘1‘,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
insert into "CLYH"."CLPCSTOCK_CKMX"("SERIALNO","SSBM","TCODE","CKBH","KCXH","WLBH","WLMC","WLPH","WLFL","TM","CKDJ","CKSL","CKJE","OPER","SYSL","WSYSL","INPUTDATE","ORDERH","FIRSTDATE","GYSDM","SCRQ","TNOTE","GMRKFLAG","STM","BZQ","CKDM","LLR") values (‘7‘,‘100‘,‘105‘,‘CKZHGY-YCL820180930002‘,‘7‘,‘DC03000048‘,‘石墨.P1A(MP004).GDGZ0092‘,‘40417‘,‘1‘,‘001601230180‘,‘0‘,‘15‘,‘0‘,‘70354‘,‘0‘,‘15‘,TO_DATE(‘30-SEP-18‘, ‘DD-MON-RR‘),‘1‘,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
insert into "CLYH"."CLPCSTOCK_CKMX"("SERIALNO","SSBM","TCODE","CKBH","KCXH","WLBH","WLMC","WLPH","WLFL","TM","CKDJ","CKSL","CKJE","OPER","SYSL","WSYSL","INPUTDATE","ORDERH","FIRSTDATE","GYSDM","SCRQ","TNOTE","GMRKFLAG","STM","BZQ","CKDM","LLR") values (‘6‘,‘100‘,‘105‘,‘CKZHGY-YCL820180930002‘,‘6‘,‘DC03000048‘,‘石墨.P1A(MP004).GDGZ0092‘,‘40417‘,‘1‘,‘001601230179‘,‘0‘,‘15‘,‘0‘,‘70354‘,‘0‘,‘15‘,TO_DATE(‘30-SEP-18‘, ‘DD-MON-RR‘),‘1‘,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
insert into "CLYH"."CLPCSTOCK_CKMX"("SERIALNO","SSBM","TCODE","CKBH","KCXH","WLBH","WLMC","WLPH","WLFL","TM","CKDJ","CKSL","CKJE","OPER","SYSL","WSYSL","INPUTDATE","ORDERH","FIRSTDATE","GYSDM","SCRQ","TNOTE","GMRKFLAG","STM","BZQ","CKDM","LLR") values (‘5‘,‘100‘,‘105‘,‘CKZHGY-YCL820180930002‘,‘5‘,‘DC03000048‘,‘石墨.P1A(MP004).GDGZ0092‘,‘40417‘,‘1‘,‘001601230177‘,‘0‘,‘15‘,‘0‘,‘70354‘,‘0‘,‘15‘,TO_DATE(‘30-SEP-18‘, ‘DD-MON-RR‘),‘1‘,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
insert into "CLYH"."CLPCSTOCK_CKMX"("SERIALNO","SSBM","TCODE","CKBH","KCXH","WLBH","WLMC","WLPH","WLFL","TM","CKDJ","CKSL","CKJE","OPER","SYSL","WSYSL","INPUTDATE","ORDERH","FIRSTDATE","GYSDM","SCRQ","TNOTE","GMRKFLAG","STM","BZQ","CKDM","LLR") values (‘4‘,‘100‘,‘105‘,‘CKZHGY-YCL820180930002‘,‘4‘,‘DC03000048‘,‘石墨.P1A(MP004).GDGZ0092‘,‘40417‘,‘1‘,‘001601230176‘,‘0‘,‘15‘,‘0‘,‘70354‘,‘0‘,‘15‘,TO_DATE(‘30-SEP-18‘, ‘DD-MON-RR‘),‘1‘,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
insert into "CLYH"."CLPCSTOCK_CKMX"("SERIALNO","SSBM","TCODE","CKBH","KCXH","WLBH","WLMC","WLPH","WLFL","TM","CKDJ","CKSL","CKJE","OPER","SYSL","WSYSL","INPUTDATE","ORDERH","FIRSTDATE","GYSDM","SCRQ","TNOTE","GMRKFLAG","STM","BZQ","CKDM","LLR") values (‘3‘,‘100‘,‘105‘,‘CKZHGY-YCL820180929031‘,‘3‘,‘DC03000048‘,‘石墨.P1A(MP004).GDGZ0092‘,‘40417‘,‘1‘,‘001601230173‘,‘0‘,‘15‘,‘0‘,‘70354‘,‘0‘,‘15‘,TO_DATE(‘29-SEP-18‘, ‘DD-MON-RR‘),‘1‘,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
insert into "CLYH"."CLPCSTOCK_CKMX"("SERIALNO","SSBM","TCODE","CKBH","KCXH","WLBH","WLMC","WLPH","WLFL","TM","CKDJ","CKSL","CKJE","OPER","SYSL","WSYSL","INPUTDATE","ORDERH","FIRSTDATE","GYSDM","SCRQ","TNOTE","GMRKFLAG","STM","BZQ","CKDM","LLR") values (‘2‘,‘100‘,‘105‘,‘CKZHGY-YCL820180929029‘,‘2‘,‘DC03000048‘,‘石墨.P1A(MP004).GDGZ0092‘,‘40417‘,‘1‘,‘001601230172‘,‘0‘,‘15‘,‘0‘,‘70354‘,‘0‘,‘15‘,TO_DATE(‘29-SEP-18‘, ‘DD-MON-RR‘),‘1‘,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
insert into "CLYH"."CLPCSTOCK_CKMX"("SERIALNO","SSBM","TCODE","CKBH","KCXH","WLBH","WLMC","WLPH","WLFL","TM","CKDJ","CKSL","CKJE","OPER","SYSL","WSYSL","INPUTDATE","ORDERH","FIRSTDATE","GYSDM","SCRQ","TNOTE","GMRKFLAG","STM","BZQ","CKDM","LLR") values (‘10‘,‘100‘,‘105‘,‘CKZHGY-YCL20181006036‘,‘10‘,‘DC03000048‘,‘石墨.P1A(MP004).GDGZ0092‘,‘40417‘,‘1‘,‘001601230183‘,‘0‘,‘15‘,‘0‘,‘18801393‘,‘0‘,‘15‘,TO_DATE(‘06-OCT-18‘, ‘DD-MON-RR‘),‘1‘,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
insert into "CLYH"."CLPCSTOCK_CKMX"("SERIALNO","SSBM","TCODE","CKBH","KCXH","WLBH","WLMC","WLPH","WLFL","TM","CKDJ","CKSL","CKJE","OPER","SYSL","WSYSL","INPUTDATE","ORDERH","FIRSTDATE","GYSDM","SCRQ","TNOTE","GMRKFLAG","STM","BZQ","CKDM","LLR") values (‘1-1‘,‘100‘,‘105‘,‘CKZHGY-YCL32016042209‘,‘1‘,‘DC03000048‘,‘石墨.P1A(MP004).GDGZ0092‘,‘40403‘,‘1‘,‘001601230031‘,‘0‘,‘15‘,‘0‘,‘700903‘,‘0‘,‘15‘,TO_DATE(‘22-APR-16‘, ‘DD-MON-RR‘),‘2‘,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

select * from CLPCSTOCK_CKMX where serialno=‘1-1‘;
delete CLPCSTOCK_CKMX where serialno=‘1-1‘;

oracle 已提交误删除,恢复 闪回技术

上一篇:DVWA大通关(六、SQL注入)


下一篇:mysql,查询一张表记录,插入另外一张表