当前位置: 代码迷 >> 综合 >> oracle数据迁移常用脚本
  详细解决方案

oracle数据迁移常用脚本

热度:39   发布时间:2024-01-17 04:44:08.0

1.批量修改
(1)update table2 set xm=(select xm from tb1 where table1.id=table2.id),
xb=(select xb from table1 where table1.id=table2 .id)
where id in(select id from table1);  
(2)update table2 set(xm,xb)=(select xm,xb from table1 where table1.id=table2 .id)
where id in(select id from table1); 

2.查询2017-12-10 17:00:00这个时间点时的数据
select * from table as of timestamp to_Date('2017-12-10 17:00:00', 'yyyy-mm-dd hh24:mi:ss') 

找回某个表5分钟前删除的数据
select * from emp as of timestamp sysdate - 5/1440;  --timestamp 后面为时间点