![]() |
[Share/Updated] Remove deleted and banned chars from the DB
As you know, all deleted chars as long as their skills/items/shortcuts etc are being kept in the database. So the db keeps growing up and lagging more. This is a simple script I just finished to remove that kind of useless data:
Code:
declare @var1 varchar(255)Second script: That script will change account_id of all characters inside banned accounts to -1. Execute that script and then the first one to remove those characters completeley from the database. Code:
declare @var1 varchar(255)PS: the banned accounts will remain at the database but empty without chars. I'm looking forward to finish 1 more script that will delete all banned or empty accounts. GL |
nice :)
|
just added a second script. check the first post
|
top-gear
Your first script - perfect! If You can make script, which determinates user logout data and kill all accounts (with chars), what more old, then specified (for instance 30 day or 90 day), this were GRAND BADABOOM!!! 8-) |
Code:
delete from lin2world.dbo.user_data where char_id in (select char_id from lin2world.dbo.user_data where account_id = '-1')one more way to clear db - take info from user_deleted table and don't delete warehouse=2 from user_item |
thank you for the info. warehouse=2 deletion what problems can cause?
|
clan warehouse - char id = pledge id & warehouse=2
|
Quote:
|
I have a php script that runs daily durring a automated server maitenance. It removes all accounts which have been inactive for 6 months.
Code:
<?php |
Thank you! very useful script!
// user_item (clan warehouse) $query = " DELETE FROM [user_item] WHERE (user_item.char_id=".$pledge['pledge_id'].") AND (user_item.warehouse = 2) "; mssql_query($query); That one will cause problems to other clan wh's or not? |
wow nice firedaemon
|
Looks very nice, dear FireDeamon. :)
R U can make full-ability-prepared-for-leachers share? ;) Because your "bleh,bleh,bleh" confused to me. :D |
Why don't you go to www.php.net and use search for function and see params it require? :)
|
| All times are GMT. The time now is 21:55. |