[Tool] MSSQL Commands

Results 1 to 8 of 8
  1. #1
    http://kalserverace.com Ace-SG1- is offline
    MemberRank
    Sep 2006 Join Date
    HawaiiLocation
    1,711Posts

    [Tool] MSSQL Commands

    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.
    PHP Code:
    SELECT ipacct_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 Code:
    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 Code:
    To Clear Logs.

    Use 
    Master
    go

    Backup Log 
    [SAwith truncate_only
    go

    Use [SA]
    go

    DBCC shrinkfile 
    ([SA_Log], 2)
    go

    -- data
    Use Master
    go

    Backup Log 
    [SAwith 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 Code:
    BACKUP DATABASE [SATO
    DISK 
    N'C:\databace\SA.bak',  
    DISK N'C:\SA.bak',  
    DISK N'D:\SA.bak' 

    WITH INITFORMAT,  NAME N'SA-Full Database Backup'
    SKIPNOREWINDNOUNLOAD,  STATS 10
    GO 


  2. #2
    Arrogant Wizard DeathArt is offline
    MemberRank
    Mar 2007 Join Date
    StockholmLocation
    2,657Posts

    Re: [Release] / [Tool] MSSQL Commands

    AUTH/DB Cleaner - This restores your AUTH/DB Tables back before your server started.
    No, it trunicates your tables. Restore means to restore data in them, not delete data.

    And you should explain precisely WHAT log you're cleaning. Because the transaction log you're cleaning then removes the ability to do a rollback.

  3. #3
    Account Upgraded | Title Enabled! SAL-HOAX is offline
    MemberRank
    Sep 2006 Join Date
    DenmarkLocation
    575Posts

    Re: [Release] / [Tool] MSSQL Commands

    Quote Originally Posted by DeathArt View Post
    No, it trunicates your tables. Restore means to restore data in them, not delete data.

    And you should explain precisely WHAT log you're cleaning. Because the transaction log you're cleaning then removes the ability to do a rollback.
    Father-DeathArt :-DD hehe... GURU of MSSQL etc...

  4. #4
    http://kalserverace.com Ace-SG1- is offline
    MemberRank
    Sep 2006 Join Date
    HawaiiLocation
    1,711Posts

    Re: [Release] / [Tool] MSSQL Commands

    hey hey hey... i was told it was some logs... thats it.

  5. #5
    Arrogant Wizard DeathArt is offline
    MemberRank
    Mar 2007 Join Date
    StockholmLocation
    2,657Posts

    Re: [Release] / [Tool] MSSQL Commands

    lol.. you're releasing SQL scripts, not knowing what they do...

  6. #6
    Account Upgraded | Title Enabled! TrueDarKZONE is offline
    MemberRank
    Nov 2006 Join Date
    Some Were In ALocation
    686Posts

    Re: [Release] / [Tool] MSSQL Commands

    hes right ace if some 1 was to run the log cleaner on there db with out knowing what the hell it does it will fuck it up

  7. #7
    Kal Craker cristy_abaddon is offline
    MemberRank
    Apr 2006 Join Date
    acasaLocation
    859Posts

    Re: [Release] / [Tool] MSSQL Commands

    ty ace ;) ya and dont use that if u dont know what to do :D

  8. #8
    http://kalserverace.com Ace-SG1- is offline
    MemberRank
    Sep 2006 Join Date
    HawaiiLocation
    1,711Posts

    Re: [Release] / [Tool] MSSQL Commands

    Quote Originally Posted by cristy_abaddon View Post
    ty ace ;) ya and dont use that if u dont know what to do :D
    sooo right... last night was fun... LOL... restoring a fucked up DB useing the MDFs... LOL...

    and thank you.



Advertisement