壹佰网|ERP100 - 企业信息化知识门户

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2113|回复: 8

[天心ERP] 天心数据瘦身法

[复制链接]
发表于 2008/7/11 14:39:42 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622  。

您需要 登录 才可以下载或查看,没有帐号?注册

x
       查询分析器中选择相应的帐套执行这些语句后再做结构更新、分仓存量核算、成本计算、帐户重整、总帐重整(此为删除2008年前已结案单据的语句)。
  1. delete from TF_POS WHERE os_dd IN (SELECT os_dd FROM MF_POS where mf_pos.os_dd<'2008-01-01' and mf_pos.cls_id='T')
  2. delete from mf_pos where os_dd<'2008-01-01'and cls_id='T'
  3. delete from TF_pos WHERE os_NO NOT IN (SELECT os_NO FROM mf_pos)
  4. delete from TF_mo WHERE mo_no IN (SELECT mo_no FROM MF_mo where mf_mo.mo_dd<'2008-01-01' and mf_mo.close_id='T')
  5. delete from mf_mo where mo_dd<'2008-01-01'and close_id='T'
  6. delete from TF_mo WHERE mo_NO NOT IN (SELECT mo_NO FROM mf_mo)
  7. delete from mf_ty where ty_dd<'2008-01-01'and cls_id_ok='T' and cls_id_lost='T'
  8. delete from mf_ti where ti_dd<'2008-01-01'and close_id='T'
  9. delete from mf_zg where zg_dd<'2008-01-01'and cls_id='T'
  10. delete from mf_ml where ml_dd<'2008-01-01'
  11. delete from mf_mm where mm_dd<'2008-01-01'
  12. delete from mf_ij where ij_dd<'2008-01-01'
  13. delete from mf_pss where ps_dd<'2008-01-01'
  14. delete from mf_pt where pt_dd<'2008-01-01'
  15. delete from TF_ml WHERE ml_NO NOT IN (SELECT ml_NO FROM MF_ml)
  16. delete from TF_pt WHERE pt_NO NOT IN (SELECT pt_NO FROM MF_pt)
  17. delete from TF_pss WHERE ps_NO NOT IN (SELECT ps_NO FROM MF_pss)
  18. delete from TF_TY WHERE TY_NO NOT IN (SELECT TY_NO FROM MF_ty)
  19. delete from TF_ij WHERE ij_NO NOT IN (SELECT ij_NO FROM MF_ij)
  20. delete from TF_zg WHERE zg_NO NOT IN (SELECT zg_NO FROM MF_zg)
  21. delete from TF_ti WHERE ti_NO NOT IN (SELECT ti_NO FROM MF_ti)
  22. DELETE FROM MF_MP WHERE MP_DD<'2008-01-01'
  23. DELETE FROM TF_MP1 WHERE MP_NO NOT IN (SELECT MP_NO FROM MF_MP)
  24. DELETE FROM TF_MP2 WHERE MP_NO NOT IN (SELECT MP_NO FROM MF_MP)
  25. DELETE FROM TF_MP3 WHERE MP_NO NOT IN (SELECT MP_NO FROM MF_MP)
  26. delete from sprd where YY<'2007' and MM<'12'
  27. delete from vhed where mak_dat<'2008-01-01'
  28. delete from vdtl where voh_dat<'2008-01-01'
  29. delete from mf_exp where ep_dd<'2008-01-01'
  30. delete from TF_exp WHERE ep_NO NOT IN (SELECT ep_NO FROM mf_exp)
  31. delete from mf_arp where bil_dd<'2008-01-01' and close_id='T'
  32. delete from mf_MON where rp_dd<'2008-01-01'
  33. delete from TF_mon WHERE rp_NO NOT IN (SELECT rp_NO FROM mf_mon)
复制代码

080705.doc

23.5 KB, 下载次数: 32, 下载积分: 努力值 -5 点

发表于 2008/7/11 15:51:46 | 显示全部楼层
删了要是想查以后的岂不是查不到了
 楼主| 发表于 2008/7/11 16:52:46 | 显示全部楼层
当然只有把以前的数据另外备份到其他帐套了,删的原因是避免长期使用导致数据量过大,在检索和存取时影响速度!
发表于 2008/7/13 11:47:50 | 显示全部楼层
这跟sunlike的结转帐套功能有区别吗?
 楼主| 发表于 2008/7/31 14:05:09 | 显示全部楼层
坦白说,转帐套功能其实完全可以达到以上目的,但是转帐套功能当数据大于2G左右时经常报错或是转不成功,因此我才不得不用这样极端的方法去做删除,当然只有你对SUNLIKE熟悉的话才这样做,如果连语句上的表名看了不知道是什么,我还是建议你不要使用!
发表于 2008/8/21 02:40:01 | 显示全部楼层
当然只有把以前的数据另外备份到其他帐套了,删的原因是避免长期使用导致数据量过大,在检索和存取时影响速度!
发表于 2011/6/1 17:34:25 | 显示全部楼层
这个资料真好,收藏了
发表于 2011/9/8 23:10:56 | 显示全部楼层
有难度,还是先备份先
发表于 2011/10/24 15:54:58 | 显示全部楼层
有空尝试一下!{:soso_e100:}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|壹佰网 ERP100 ( 京ICP备19053597号-2 )

Copyright © 2005-2012 北京海之大网络技术有限责任公司 服务器托管由互联互通
手机:13911575376
网站技术点击发送消息给对方83569622   广告&合作 点击发送消息给对方27675401   点击发送消息给对方634043306   咨询及人才点击发送消息给对方138011526

GMT+8, 2025/11/30 00:12 , Processed in 0.021233 second(s), 15 queries , File On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表