关灯
开启左侧

清理长期没有登录的游戏账号数据的方法

  [复制链接]
admin实名认证 发表于 2016-4-20 23:11:50 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
 
运行久了以后。。很多账号长时间没有登录,导致大量数据冗余。需要清理一下。以下是清理方法:


DELETE FROM `realmd`.`account` WHERE `last_login` < '2009-07-31 00:00:00';delete from `realmd`.`realmcharacters` where `acctid` not in (select `id` from `realmd`.`account`);
DELETE FROM `characters`.`characters` WHERE `account` NOT IN (SELECT `id` FROM `realmd`.`account`);
delete from `characters`.`account_data` where `account` not in (SELECT `id` FROM `realmd`.`account`);
delete from `characters`.`arena_team` where `captainguid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`arena_team_member` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`) and `arenateamid` not in (select `characters`.`arena_team`.`arenateamid` from `characters`.`arena_team`);
delete from `characters`.`arena_team_stats` where `arenateamid` not in (select `characters`.`arena_team`.`arenateamid` from `characters`.`arena_team`);
delete from `characters`.`character_account_data` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_achievement` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_achievement_progress` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_action` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_aura` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_equipmentsets` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_homebind` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_inventory` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_pet` where `owner` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_queststatus` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_reputation` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_skills` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_social` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_spell` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_spell_cooldown` where `guid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`character_tutorial` where `account` not in (select `realmd`.`account`.`id` from `realmd`.`account`);
delete from `characters`.`cheaters` where `acctid` not in (select `realmd`.`account`.`id` from `realmd`.`account`);
delete from `characters`.`group_member` where `leaderguid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`) and `memberguid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`groups` where `leaderguid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`guild` where `leaderguid` not in (select `characters`.`characters`.`guid` from `characters`.`characters`);
delete from `characters`.`guild_bank_eventlog` where `guildid` not in (select `characters`.`guild`.`guildid` from `characters`.`guild`);
delete from `characters`.`guild_bank_item` where `guildid` not in (select `characters`.`guild`.`guildid` from `characters`.`guild`);
delete from `characters`.`guild_bank_right` where `guildid` not in (select `characters`.`guild`.`guildid` from `characters`.`guild`);
delete from `characters`.`guild_bank_tab` where `guildid` not in (select `characters`.`guild`.`guildid` from `characters`.`guild`);
delete from `characters`.`guild_eventlog` where `guildid` not in (select `characters`.`guild`.`guildid` from `characters`.`guild`);
delete from `characters`.`guild_member` where `guildid` not in (select `characters`.`guild`.`guildid` from `characters`.`guild`);
delete from `characters`.`guild_rank` where `guildid` not in (select `characters`.`guild`.`guildid` from `characters`.`guild`);

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

本版积分规则

  • 最佳新人

    注册账号后积极发帖的会员
  • 活跃会员

    经常参与各类话题的讨论,发帖内容较有主见
  • 热心会员

    经常帮助其他会员答疑
  • 推广达人

    积极宣传本站,为本站带来更多注册会员
  • 宣传达人

    积极宣传本站,为本站带来更多的用户访问量
  • 灌水之王

    经常在论坛发帖,且发帖量较大
  • 突出贡献

    长期对论坛的繁荣而不断努力,或多次提出建设性意见
  • 优秀版主

    活跃且尽责职守的版主
  • 荣誉管理

    曾经为论坛做出突出贡献目前已离职的版主
  • 论坛元老

    为论坛做出突出贡献的会员

0关注

5粉丝

3421帖子

排行榜
作者专栏

QQ交流群&&微信订阅号

QQ交流群

微信订阅号

吾爱尚玩资源基地永久域名:

Www.523Play.Com

在线管理员QQ:1589479632

邮箱:Email@523play.com

QQ交流群:558936238

Copyright   ©2015-2116  吾爱尚玩资源基地|523play.comPowered by©523Pplay.Com技术支持:吾爱尚玩资源基地