View Full Version : [small share]Script for clear database
This stored procedure will clear unused characters with their items, skills and quests.
CREATE PROCEDURE [DBO].[lin_DeleteOldChars]
@days INT
AS
SET NOCOUNT ON
DECLARE @ToDeleteCharacter CURSOR
DECLARE @char_id INT
SET @ToDeleteCharacter = CURSOR FAST_FORWARD FOR
SELECT char_id FROM user_data WHERE account_id <= 0 OR ( logout>login AND logout<GETDATE()-@days)
OPEN @ToDeleteCharacter
FETCH FROM @ToDeleteCharacter INTO @char_id
WHILE @@FETCH_STATUS = 0
BEGIN
DELETE FROM user_item WHERE char_id=@char_id
DELETE FROM user_skill WHERE char_id=@char_id
DELETE FROM Quest WHERE char_id=@char_id
FETCH NEXT FROM @ToDeleteCharacter INTO @char_id
END
CLOSE @ToDeleteCharacter
DEALLOCATE @ToDeleteCharacter
DELETE FROM user_data WHERE account_id <= 0 OR ( logout>login AND logout<GETDATE()-@days)
GO
I would never do something like that... heh.
If you have 1000+ online you may need do this clear every several months...
If you have 1000+ online you may need do this clear every several months...
can you give me some names of the private servers that has 1000+ online average?
Megatronpt
25.02.2006, 04:37
THere are quite a few ;)
And this script can come in handy.. with a change here and there.. ;)
Thanks Nucer!
can you give me some names of the private servers that has 1000+ online average?
Ggg lol
http://l2online.ru/
http://la2.ru/
http://lineageii.ru/
http://lineage2.su/
http://la2.raid.ru/
http://splendor.ru/
http://warsmith.ru/
http://line2.ru/
http://elmore.ru/
http://l2server.ru/
http://la2world.ru/
http://www.lineage2.kiev.ua/
http://www.lineage2.wnet.ua/
http://lineage.trifle.net/
This is not full list of russian servers :D
LT servers:
http://reborn.bfd.lt about 1k-1.1k
beyondc3 (pvp server) 1.5-2.8k
If you have 1000+ online you may need do this clear every several months...
can you give me some names of the private servers that has 1000+ online average?
I would have to say.... you just got owned....
not really.... i just wonder why those sites didn't make it to top200
Megatronpt
26.02.2006, 01:50
Top200 isn't everything.. but don't make me talk, otherwise someone wouldn't like it. ^^
;)
Anybody can apply these SQL at PHP-body (with input account_id or char_id form)? Be amazing!
can you give me some names of the private servers that has 1000+ online average?
Ggg lol
http://l2online.ru/
http://la2.ru/
http://lineageii.ru/
http://lineage2.su/
http://la2.raid.ru/
http://splendor.ru/
http://warsmith.ru/
http://line2.ru/
http://elmore.ru/
http://l2server.ru/
http://la2world.ru/
http://www.lineage2.kiev.ua/
http://www.lineage2.wnet.ua/
http://lineage.trifle.net/
This is not full list of russian servers :D
В десятке 8) :lol:
there is ALREADY proc for delete such things in SERVER
lin_deleteghostdata or something
i guess you never looked ? huh ?
lin_CleanUpGhostData
exec in lin_DeleteNotOwnedItem ;)
but nucer delete "expired" users, as i see chars that not used N days from now. i'm right?
also must delete from
DELETE FROM user_friend WHERE char_id=@char_id
DELETE FROM user_history WHERE char_id=@char_id
DELETE FROM user_deleted WHERE char_id=@char_id
DELETE FROM user_log WHERE char_id=@char_id
DELETE FROM user_punish WHERE char_id=@char_id
DELETE FROM user_surrender WHERE char_id=@char_id
DELETE FROM user_blocklist WHERE char_id=@char_id
DELETE FROM user_ban WHERE char_id=@char_id
DELETE FROM user_ActiveSkill WHERE char_id=@char_id
DELETE FROM shortcut_data WHERE char_id=@char_id
vandalheart
12.04.2006, 17:24
LT servers:
http://reborn.bfd.lt about 1k-1.1k
beyondc3 (pvp server) 1.5-2.8k
LOL , PVP server beyondc3 ? :D with rates x6 ?