表更改记录及历史数据查询
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
表更新scn查询:
select ora_rowscn from table_name group by ora_rowscn order by ora_rowscn desc
表历史数据查询:
select * from table_name as of scn 633294345 order by daddtime desc
select * from table_name as of timestamp sysdate-1/24*10 order by daddtime desc
表更改记录查询
select versions_startscn,DECODE(versions_operation,'I','Insert','U','Update','D','Delete', 'Original') Operation, table_name.*
from table_name versions between scn minvalue and maxvalue
WHERE VERSIONS_STARTTIME IS NOT NULL ORDER BY VERSIONS_STARTTIME DESC;
表版本查询:
select scandatetimeht,partsno,daddtime,versions_operation,versions_starttime,versions_endtime,versions_xid from table_name versions between timestamp minvalue and maxvalue
where versions_xid is not null order by versions_xid;