Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[已解决] dvbbs8.2数据转换前清理数据的SQL

[复制链接]
commdos 发表于 2012-11-9 14:41:54 | 显示全部楼层 |阅读模式
本帖最后由 commdos 于 2012-11-10 23:00 编辑

在论坛转换前,如果能清除广告垃圾帖子,将加快转换时间,在删除前请做好数据备份!!,在access中执行相关SQL即可(3楼意见可能会误删活动用户帖子,所以进行了修改。)
1.删除Dv_message中的系统消息:delete from Dv_message where title like '欢迎光临*'
2.清理垃圾帖子数据
删除内容重复的帖子
select topic,count(*) into temp3 from dv_bbs1 where len(topic)>6 group by topic having count(*) >1;
select ip into temp4 from dv_bbs1  where topic in (select topic from temp3)  order by ip;
delete from temp4 where ip in (select ip from dv_bbs1 where username in (select username from dv_user where  
lockuser=0 and lastlogin-joindate>15));
delete from dv_bbs1 where ip in (select ip from temp4) ;
删除被锁贴的帖子:
select ip into temp4 from dv_bbs1 where locktopic >0
delete from temp4 where ip in (select ip from dv_bbs1 where username in (select username from dv_user where  
lockuser=0 and lastlogin-joindate>15));
delete from dv_bbs1 where ip in (select ip from temp4) ;
3.删除log日志:delete from dv_log where 1=1;
4.删除锁定广告用户:delete from dv_user where lockuser=1
5.删除过期只登录过一次的用户:
delete from Dv_user where userlogins<2 and joindate < #2012/01/01 0:10:12#

m.king 发表于 2012-11-9 17:45:58 | 显示全部楼层
额,,,这是经验????
回复

使用道具 举报

12153556 发表于 2012-11-10 12:59:49 | 显示全部楼层
1、3、4、5可以操作,2操作起来会误删很多帖子,需要注意
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-28 07:22 , Processed in 0.634616 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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