+

Search Tips   |   Advanced Search

Database transfer: Download the script and setup the MS SQL database

Note that manual steps from the Configuration Wizard can be found in the IBM Knowledge Center.

  1. Copy the downloaded script to the database server and extract it.

  2. Run the SQL statements listed in this script in the SQL processor. db2 -tvf SetupDB2Database.sql

    Example of the script the Configuration Wizard generates

    -- Create the schema USE [WPSDB];
    GO
    CREATE SCHEMA release;
    GO
    -- Create the configuration user USE [WPSDB];
    EXEC sp_addlogin 'config_ID', 'config_pwd', 'WPSDB';
    -- Add a role to the user for XA transactions USE [master];
    EXEC sp_addrolemember N'SqlJDBCXAUser', N'config_ID';
    GO
    -- Add the configuration user to the database USE [WPSDB];
    EXEC sp_grantdbaccess 'config_ID';
    GO
    -- Create the runtime user USE [WPSDB];
    EXEC sp_addlogin 'runtime_ID', 'run_pwd', 'WPSDB';
    -- Add a role to the user for XA transactions USE [master];
    EXEC sp_addrolemember N'SqlJDBCXAUser', N'runtime_ID';
    GO
    -- Add the runtime user to the database USE [WPSDB];
    EXEC sp_grantdbaccess 'runtime_ID';
    GO
    -- Create the configuration role USE [WPSDB];
    CREATE ROLE [WP_BASE_CONFIG_USERS];
    GRANT CREATE TABLE TO [WP_BASE_CONFIG_USERS];
    GRANT ALTER, SELECT, INSERT, UPDATE, DELETE, REFERENCES ON SCHEMA::[release] TO [WP_BASE_CONFIG_USERS];
    EXEC sp_addrolemember N'WP_BASE_CONFIG_USERS', N'config_ID';
    GO
    -- Create the runtime role CREATE ROLE [WP_BASE_RUNTIME_USERS];
    EXEC sp_addrolemember N'WP_BASE_RUNTIME_USERS', N'runtime_ID';
    GO
    -- Create the schema USE [WPSDB];
    GO
    CREATE SCHEMA community;
    GO
    -- Add the configuration user to the database USE [WPSDB];
    EXEC sp_grantdbaccess 'config_ID';
    GO
    -- Add the runtime user to the database USE [WPSDB];
    EXEC sp_grantdbaccess 'runtime_ID';
    GO
    -- Create the configuration role USE [WPSDB];
    GRANT ALTER, SELECT, INSERT, UPDATE, DELETE, REFERENCES ON SCHEMA::[community] TO [WP_BASE_CONFIG_USERS];
    EXEC sp_addrolemember N'WP_BASE_CONFIG_USERS', N'config_ID';
    GO
    -- Create the runtime role EXEC sp_addrolemember N'WP_BASE_RUNTIME_USERS', N'runtime_ID';
    GO
    -- Create the schema USE [WPSDB];
    GO
    CREATE SCHEMA customization;
    GO
    -- Add the configuration user to the database USE [WPSDB];
    EXEC sp_grantdbaccess 'config_ID';
    GO
    -- Add the runtime user to the database USE [WPSDB];
    EXEC sp_grantdbaccess 'runtime_ID';
    GO
    -- Create the configuration role USE [WPSDB];
    GRANT ALTER, SELECT, INSERT, UPDATE, DELETE, REFERENCES ON SCHEMA::[customization] TO [WP_BASE_CONFIG_USERS];
    EXEC sp_addrolemember N'WP_BASE_CONFIG_USERS', N'config';
    GO
    -- Create the runtime role EXEC sp_addrolemember N'WP_BASE_RUNTIME_USERS', N'runtime_ID';
    GO
    -- Create the schema USE [WPSDB];
    GO
    CREATE SCHEMA jcr;
    GO
    -- Add the configuration user to the database USE [WPSDB];
    EXEC sp_grantdbaccess 'config_ID';
    GO
    -- Add the runtime user to the database USE [WPSDB];
    EXEC sp_grantdbaccess 'runtime_ID';
    GO
    -- Create the configuration role USE [WPSDB];
    CREATE ROLE [WP_JCR_CONFIG_USERS];
    GRANT CREATE TABLE TO [WP_JCR_CONFIG_USERS];
    GRANT CREATE VIEW TO [WP_JCR_CONFIG_USERS];
    GRANT ALTER, SELECT, INSERT, UPDATE, DELETE, REFERENCES ON SCHEMA::[jcr] TO [WP_JCR_CONFIG_USERS];
    EXEC sp_addrolemember N'WP_JCR_CONFIG_USERS', N'config_ID';
    GO
    -- Create the runtime role CREATE ROLE [WP_JCR_RUNTIME_USERS];
    EXEC sp_addrolemember N'WP_JCR_RUNTIME_USERS', N'runtime_ID';
    GO
    -- Create the schema USE [WPSDB];
    GO
    CREATE SCHEMA feedback;
    GO
    -- Add the configuration user to the database USE [WPSDB];
    EXEC sp_grantdbaccess 'config_ID';
    GO
    -- Add the runtime user to the database USE [WPSDB];
    EXEC sp_grantdbaccess 'runtime_ID';
    GO
    -- Create the configuration role USE [WPSDB];
    CREATE ROLE [WP_PZN_CONFIG_USERS];
    GRANT CREATE TABLE TO [WP_PZN_CONFIG_USERS];
    GRANT ALTER, SELECT, INSERT, UPDATE, DELETE, REFERENCES ON SCHEMA::[feedback] TO [WP_PZN_CONFIG_USERS];
    EXEC sp_addrolemember N'WP_PZN_CONFIG_USERS', N'config_ID';
    GO
    -- Create the runtime role CREATE ROLE [WP_PZN_RUNTIME_USERS];
    EXEC sp_addrolemember N'WP_PZN_RUNTIME_USERS', N'runtime_ID';
    GO
    -- Create the schema USE [WPSDB];
    GO
    CREATE SCHEMA likeminds;
    GO
    -- Add the configuration user to the database USE [WPSDB];
    EXEC sp_grantdbaccess 'config_ID';
    GO
    -- Add the runtime user to the database USE [WPSDB];
    EXEC sp_grantdbaccess 'runtime_ID';
    GO
    -- Create the configuration role USE [WPSDB];
    GRANT CREATE PROCEDURE TO [WP_PZN_CONFIG_USERS];
    GRANT ALTER, SELECT, INSERT, UPDATE, DELETE, REFERENCES ON SCHEMA::[likeminds] TO [WP_PZN_CONFIG_USERS];
    EXEC sp_addrolemember N'WP_PZN_CONFIG_USERS', N'config_ID';
    GO
    -- Create the runtime role EXEC sp_addrolemember N'WP_PZN_RUNTIME_USERS', N'runtime_ID';
    GO


Parent Manual Steps: Database Transfer