How to Create Clean Databases 92.03

Results 1 to 1 of 1
  1. #1
    Hardcore Member argeus99 is offline
    MemberRank
    Mar 2019 Join Date
    ColombiaLocation
    127Posts

    How to Create Clean Databases 92.03

    How to Create Clean Databases 92.03
    Since there's so many dmca´s takedowns for dbs, follow this guide for create both Planet and Shared DB's


    Create a database with the name "PlanetDB_2800"

    Ejecute the following query on it

    Code:
    -- ------------------------------ Table structure for DbInfo-- ----------------------------
    
    IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[DbInfo]') AND type IN ('U'))
    
        DROP TABLE [dbo].[DbInfo]
    
    GO
    
    CREATE TABLE [dbo].[DbInfo] ([version] int NULL)
    
    GO
    
    ALTER TABLE [dbo].[DbInfo] SET (LOCK_ESCALATION = TABLE)
    
    GO
    
    -- ------------------------------ Records of DbInfo-- ----------------------------
    
    INSERT INTO [dbo].[DbInfo] ([version]) VALUES (N'363898')
    
    GO
    
    -- ------------------------------ procedure structure for spGetPlanetDatabaseVersion-- ----------------------------
    
    IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[spGetPlanetDatabaseVersion]') AND type IN ('FN', 'FS', 'FT', 'IF', 'TF'))
    
        DROP PROCEDURE[dbo].[spGetPlanetDatabaseVersion]
    
    GO
    
    CREATE PROCEDURE [dbo].[spGetPlanetDatabaseVersion]
    AS
    BEGIN
    BEGIN TRY
    BEGIN TRAN
    SELECT version FROM DbInfo
    END TRY
    BEGIN CATCH
    IF @@TRANCOUNT > 0
    ROLLBACK TRANSACTION     
    print ERROR_MESSAGE()
    END CATCH
    IF @@TRANCOUNT > 0
    COMMIT TRANSACTION
    END

    Now create the database "SharedDB" and run the following query on it

    Code:
    -- ------------------------------ Table structure for DbInfo-- ----------------------------
    
    IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[DbInfo]') AND type IN ('U'))
    
        DROP TABLE [dbo].[DbInfo]
    
    GO
    
    CREATE TABLE [dbo].[DbInfo] ( [version] int NULL)
    
    GO
    
    ALTER TABLE [dbo].[DbInfo] SET (LOCK_ESCALATION = TABLE)
    
    GO
    
    -- ------------------------------ Records of DbInfo-- ----------------------------
    
    INSERT INTO [dbo].[DbInfo] ([version]) VALUES (N'347932')
    
    GO
    
    -- ------------------------------ procedure structure for spGetPlanetDatabaseVersion-- ----------------------------
    
    IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[spGetPlanetDatabaseVersion]') AND type IN ('FN', 'FS', 'FT', 'IF', 'TF'))
    
        DROP PROCEDURE[dbo].[spGetPlanetDatabaseVersion]
    
    GO
    
    CREATE PROCEDURE [dbo].[spGetPlanetDatabaseVersion]
    AS
    BEGIN
    BEGIN TRY
    BEGIN TRAN
    SELECT version FROM DbInfo
    END TRY
    BEGIN CATCH
    IF @@TRANCOUNT > 0
    ROLLBACK TRANSACTION     
    print ERROR_MESSAGE()
    END CATCH
    IF @@TRANCOUNT > 0
    COMMIT TRANSACTION
    END
    That's all, when you start the arbiter server it will create every single database and functions


    Seeya
    Last edited by argeus99; 31-01-21 at 01:27 AM.




Advertisement