ma
To prepare a DB2 database to work with vCenter Server, you generally need to cre
ate a DB2 database user that owns the
database schema objects. When you do this, you must make sure that the database
user login is the owner of the database
schema for the vCenter Server system.
For environments in which the user cannot have the DB2 SYSADMIN permissions on t
he vCenter Server database, you can instead run scripts that create the vCenter
Server database schema before you run the vCenter Server installer.
To create the vCenter Server database schema
1) Create the vCenter Server database.
-- =============================================================================
=
-- Run with DB2 SYSADMIN authorization for every new vCenter Server database rep
ository.
-- =============================================================================
=
Use the Command Editor (Start -> Programs -> IBM DB2 -> Command Line Tools -> Co
mmand Editor) to create the DB2 database using the following scripts:
CREATE DATABASE VCDB AUTOMATIC STORAGE YES ON 'C:\' DBPATH ON 'C:\' USING CODESE
T UTF-8 TERRITORY US COLLATE USING SYSTEM
PAGESIZE 4096;
-- Hard coding the default settings in DB2 Version 9.5
UPDATE
UPDATE
UPDATE
UPDATE
DB
DB
DB
DB
CFG
CFG
CFG
CFG
FOR
FOR
FOR
FOR
VCDB
VCDB
VCDB
VCDB
USING
USING
USING
USING
SELF_TUNING_MEM ON;
AUTO_MAINT ON;
AUTO_TBL_MAINT ON;
AUTO_RUNSTATS ON;
-- Enforcing alerts
UPDATE ALERT CFG FOR DATABASE ON VCDB USING db.db_backup_req SET THRESHOLDSCHECK
ED YES;
UPDATE ALERT CFG FOR DATABASE ON VCDB USING db.tb_reorg_req SET THRESHOLDSCHECKE
D YES;
UPDATE ALERT CFG FOR DATABASE ON VCDB USING db.tb_runstats_req SET THRESHOLDSCHE
CKED YES;
-- Default installations of DB2 sets the transaction log space to use about 70 M
B.
-- Some operations of VC may require transaction log space of up to 250 MB.
-- The following script will set the transaction log space size appropriately.
UPDATE DB CFG FOR VCDB USING logprimary 32 logsecond 6 logfilsiz 2048;
--Creating the buffer pools and tablespaces (No changes are required for this sc
ript. The installer checks for the specific tablenames and bufferpools.)
CONNECT TO VCDB;
grant select on sysibmadm.applications to user <USERNAME>;
CREATE BUFFERPOOL VCBP_8K IMMEDIATE SIZE 250 AUTOMATIC PAGESIZE 8 K ;
CREATE LARGE TABLESPACE VCTS_8k PAGESIZE 8 K MANAGED BY AUTOMATIC STORAGE EXTENT
6) Run the scripts on the database. Change the statement termination character f
rom ';' to '@'. Open the scripts one at a
time in the Command Editor window and press Ctrl+Return to execute each script i
n the order shown here:
insert_stats_proc_db2.sql
load_stats_proc_db2.sql
purge_stat1_proc_db2.sql
purge_stat2_proc_db2.sql
purge_stat3_proc_db2.sql
purge_usage_stats_proc_db2.sql
stats_rollup1_proc_db2.sql
stats_rollup2_proc_db2.sql
stats_rollup3_proc_db2.sql
cleanup_events_db2.sql
delete_stats_proc_db2.sql
upsert_last_event_proc_db2.sql
load_usage_stats_proc_db2.sql
calc_topn1_proc_db2.sql
calc_topn2_proc_db2.sql
calc_topn3_proc_db2.sql
calc_topn4_proc_db2.sql
clear_topn1_proc_db2.sql
clear_topn2_proc_db2.sql
clear_topn3_proc_db2.sql
clear_topn4_proc_db2.sql
rule_topn1_proc_db2.sql
rule_topn2_proc_db2.sql
rule_topn3_proc_db2.sql
rule_topn4_proc_db2.sql
process_license_snapshot_db2.sql
7) Ensure that the DB2_ATS_ENABLE registry variable is set. Run these scripts to
set up scheduled jobs on the database.
a)
-- ============================================================================
==
-- Run with DB2 SYSADMIN authorization from the DB2 Command Editor window for e
very new vCenter Server database repository.
-- ============================================================================
==
# Usergroup creation, i.e., "DBSYSMON" is needed - dependent on the OS (alterna
tively use DB2USERS on Windows)
db2set DB2_ATS_ENABLE=YES
db2set DB2_SKIPINSERTED=ON
db2set DB2_EVALUNCOMMITTED=ON
db2set DB2_SKIPDELETED=ON
db2 update dbm cfg using SYSMON_GROUP DBSYSMON
db2stop force
db2start
b)Run the following scripts to set up scheduled jobs in Command Editor with sta
tement termination character set to
'@'
job_schedule1_db2.sql
job_schedule2_db2.sql
job_schedule3_db2.sql
job_cleanup_events_db2.sql
job_topn_past_day_db2.sql
job_topn_past_week_db2.sql
job_topn_past_month_db2.sql
job_topn_past_year_db2.sql
job_property_bulletin_db2.sql
8) On the machine on which you intend to install vCenter Server, create a data s
ource name (DSN) that points to the database server with the vCenter Server sche
ma that you created.
9) Run the vCenter Server installer and, when prompted, provide the database use
r login that you created.