oracle的确很强大,有数据快照功能,
【测试demo操作示例】:
1. select * from test_table t //查询t_viradsl2中所有的数据,可以看到三条数据
2. delete test_table //删除t_viradsl2中所有的数据,三条数据消失
3. select * from test_table t //无数据。
4. insert into test_table select * from test_table as of timestamp to_Date('2011-01-19 15:28:00', 'yyyy-mm-dd hh24:mi:ss') //已将误删除数据插入表中
www.2cto.com
5. select * from test_table t //又会看到三条数据。
我们来分析下第四步,注意这句:
select * from test_table as of timestamp to_Date('2011-01-19 15:28:00', 'yyyy-mm-dd hh24:mi:ss'),什么意思呢, 找到test_table在2011-01-19 15:28:00这个时间点的所有数据(数据快照)。