Oracle:LBS的数据归档的方法脚本备存
2017-08-22 09:45:34 访问(2005) 赞(0) 踩(0)
select * from vt_location_data
select * from tabs where table_name like 'UTB_%';
-- 重命名表名为归档名 --
rename vt_location_data to VT_LOCATION_DATA_Y17S3;
-- 重命名空表为当前表 --
rename vt_location_data_b to vt_location_data;
select * from UTB_EK_GPS_SERVER_INFO;
-- 把8.21号前面的数据写到当前库 --
insert into VT_LOCATION_DATA
select * from VT_LOCATION_DATA_Y17S3
where
gpstime >= to_date('2017-08-21','yyyy-MM-dd')
-- 删除8.21号前面的数据 --
delete from VT_LOCATION_DATA_Y17S3
where
gpstime >= to_date('2017-08-21','yyyy-MM-dd')
select to_date('2017-08-20 23:59:59','yyyy-MM-dd hh24:mi:ss')
from dual;
-- 更新自动归档的时间 --
select * from Utb_Ek_Gps_Server_Info
update Utb_Ek_Gps_Server_Info t
set t.locationdatabaktime
=
to_date('2017-08-20 23:59:59','yyyy-MM-dd hh24:mi:ss')
commit;
上一条:
下一条:
相关评论
发表评论