【业务流程】--通过临时表归档
一、说明
1、为了快速的减少也流程实例数据,可以先把一定条件的数据迁移到临时表,在对临时表的数据进行归档到历史表
2、特别注意:处理时间一般只能在非生产时间,因为归档可能导致锁表,阻塞等,从而影响实际业务执行。
二、实现步骤
1、 把流程实例数据迁移到临时表中,并删除当前表中的数据,具体脚本为:
--把2021年以前的数据备份到临时表
--1、备份流程实例到temp_instance
select * Into temp_instance from t_bf_instance where FSTARTTIME <'2021-01-01'
--temp_instance创建索引
Create Index Idx_temp_instance on temp_instance(FInstanceId)
--2、备份流程实例节点到temp_instanceEntry
select t0.* Into temp_instanceEntry from t_bf_instanceEntry t0
inner join temp_instance t1 on t1.FInstanceId = t0.FInstanceId
--temp_instanceEntry创建索引
Create Index Idx_temp_instanceEntry on temp_instanceEntry(FRouteId)
--3、备份反写携带量到temp_instanceAmount
select t0.* Into temp_instanceAmount from t_bf_instanceAmount t0
inner join temp_instanceEntry t1 on t1.FROUTEID = t0.FROUTEID
--temp_instanceAmount创建索引
Create Index Idx_temp_instanceAmount on temp_instanceEntry(FRouteId)
--删除两年前的数据
--1、删除流程实例
delete from t_bf_instance where FSTARTTIME <'2021-01-01'
--2、删除流程实例节点
delete from t_bf_instanceEntry where exists (select 1 from temp_instance t1 where t1.FINSTANCEID = t_bf_instanceEntry.FINSTANCEID)
--3、删除反写携带量
delete from t_bf_instanceAmount where exists (select 1 from temp_instanceEntry t1 where t1.FROUTEID = t_bf_instanceAmount.FROUTEID)
2、使用存储过程(附件中),对临时表中的数据进行归档
三、其他参考
1)【业务流程】--存储过程归档 https://wenku.my7c.com/article/388648080687608832?productLineId=1
2)【业务流程】--归档 https://wenku.my7c.com/article/171524?productLineId=1
【业务流程】--通过临时表归档
本文2024-09-16 18:34:40发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-23055.html
- 鼎捷EAI整合規範文件V3.1.07 (集團).pdf
- 鼎捷OpenAPI應用場景說明_基礎資料.pdf
- 鼎捷OpenAPI應用場景說明_財務管理.pdf
- 鼎捷T100 API設計器使用手冊T100 APIDesigner(V1.0).docx
- 鼎新e-GoB2雲端ERP B2 線上課程E6-2應付票據整批郵寄 領取.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程A4使用者建立權限設定.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程C3會計開帳與會計傳票.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程E6-1應付票據.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程A5-1進銷存參數設定(初階篇).pdf
- 鼎新e-GoB2雲端ERP B2 線上課程D2帳款開帳與票據開帳.pdf