Database transfer: Téléchargement du script et configuration de votre base de données MS SQL
Manual steps from the Configuration Wizard are included in HCL Product Documentation for reference and for advanced users. La procédure inclut des variables et des étapes pour différentes bases de données. Lorsque vous utilisez l'assistant pour configurer votre déploiement il remplace la variable par les informations que vous avez fournies dans l'assistant. Il affiche également uniquement les étapes propres à votre environnement. Les instructions générées par l'assistant sont propres à votre environnement.
Pourquoi et quand exécuter cette tâche
Avertissement : Toutes les étapes relatives à tous les environnements de base de données sont incluses quel que soit votre environnement. Utilisez l'Assistant de configuration en vue de générer des instructions personnalisées pour votre environnement.
Procédure
- Copiez le script téléchargé sur le serveur de base de données et extrayez-le.
- Exécutez les instructions SQL répertoriées dans ce script sur votre processeur SQL.
db2 -tvf SetupDB2Database.sql
Exemple de script généré par l'assistant de configuration :
-- 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