4 MSSQL Scripts.
Just like to say Thank you to DarkZONE for telling me some of this info.
(DB cleaner and Log cleaner)
Ask if you need any help.
PS: Remove "SA" and replace it with your own DB's name.
IP Checker - Checks if a players IP address is in the Server more than 1x.
AUTH/DB Cleaner - This restores your AUTH/DB Tables back before your server started.
Log Cleaner - You know them 1GB files? well this cleans them out.
DB Back up to more than 1 file at a time.
Just like to say Thank you to DarkZONE for telling me some of this info.
(DB cleaner and Log cleaner)
Ask if you need any help.
PS: Remove "SA" and replace it with your own DB's name.
IP Checker - Checks if a players IP address is in the Server more than 1x.
PHP:
SELECT ip, acct_name count
FROM ip_log
GROUP BY ip, acct_name
HAVING count(*) > 1
ORDER BY ip
AUTH/DB Cleaner - This restores your AUTH/DB Tables back before your server started.
PHP:
TRUNCATE TABLE "banned_ips"
TRUNCATE TABLE "BuffRemain"
TRUNCATE TABLE "Event"
TRUNCATE TABLE "Friend"
TRUNCATE TABLE "Guild"
TRUNCATE TABLE "GuildAlliance"
TRUNCATE TABLE "GuildCastle"
TRUNCATE TABLE "GuildMember"
TRUNCATE TABLE "GuildWar"
TRUNCATE TABLE "Item"
TRUNCATE TABLE "ItemRestored"
TRUNCATE TABLE "Log"
TRUNCATE TABLE "Mail"
TRUNCATE TABLE "MLM"
TRUNCATE TABLE "MLMMsg"
TRUNCATE TABLE "NameChanged"
TRUNCATE TABLE "PKBulletin"
TRUNCATE TABLE "Player"
TRUNCATE TABLE "PlayerDeleted"
TRUNCATE TABLE "Quest"
TRUNCATE TABLE "ReservedName"
TRUNCATE TABLE "Shortcut"
TRUNCATE TABLE "Skill"
TRUNCATE TABLE "Statistics"
TRUNCATE TABLE "Teleport"
TRUNCATE TABLE "user_ips"
TRUNCATE TABLE "AuthStatistics"
TRUNCATE TABLE "CLogin"
TRUNCATE TABLE "CNum"
TRUNCATE TABLE "ExpTable"
TRUNCATE TABLE "GuildRank"
TRUNCATE TABLE "IP"
TRUNCATE TABLE "iplog"
TRUNCATE TABLE "ItemBuy"
TRUNCATE TABLE "ItemBuy_backup"
TRUNCATE TABLE "ItemDetail"
TRUNCATE TABLE "ItemInfo"
TRUNCATE TABLE "Log"-
TRUNCATE TABLE "Login"
TRUNCATE TABLE "LoginDeleted"
TRUNCATE TABLE "NMLogin"
TRUNCATE TABLE "NMLogin2"
TRUNCATE TABLE "Notice"
TRUNCATE TABLE "PrizeWinner"
TRUNCATE TABLE "Rank"
TRUNCATE TABLE "ResetPK"
TRUNCATE TABLE "Statistics"
Log Cleaner - You know them 1GB files? well this cleans them out.
PHP:
To Clear Logs.
Use Master
go
Backup Log [SA] with truncate_only
go
Use [SA]
go
DBCC shrinkfile ([SA_Log], 2)
go
-- data
Use Master
go
Backup Log [SA] with truncate_only
go
Use [SA]
go
DBCC shrinkfile ([SA_Data], 1)
go
-- Get fileid
use [SA]
go
select * from sysfiles
DB Back up to more than 1 file at a time.
PHP:
BACKUP DATABASE [SA] TO
DISK = N'C:\databace\SA.bak',
DISK = N'C:\SA.bak',
DISK = N'D:\SA.bak'
WITH INIT, FORMAT, NAME = N'SA-Full Database Backup',
SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO