Anda di halaman 1dari 4

Alternative to Allowing the vCenter Server Installer to Create the Database Sche

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

SIZE 32 OVERHEAD 12.67 PREFETCHSIZE 32


TRANSFERRATE 0.18 BUFFERPOOL VCBP_8K;
CREATE BUFFERPOOL VCBP_16K IMMEDIATE SIZE 250 AUTOMATIC PAGESIZE 16 K ;
CREATE LARGE TABLESPACE VCTS_16k PAGESIZE 16 K MANAGED BY AUTOMATIC STORAGE EXTE
NTSIZE 32 OVERHEAD 12.67 PREFETCHSIZE 32
TRANSFERRATE 0.18 BUFFERPOOL VCBP_16K;
CREATE BUFFERPOOL VCBP_32K IMMEDIATE SIZE 250 AUTOMATIC PAGESIZE 32 K ;
CREATE LARGE TABLESPACE VCTS_32k PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE EXTE
NTSIZE 32 OVERHEAD 12.67 PREFETCHSIZE 32
TRANSFERRATE 0.18 BUFFERPOOL VCBP_32K;
CREATE TABLESPACE SYSTOOLSPACE IN IBMCATGROUP MANAGED BY AUTOMATIC STORAGE EXTEN
TSIZE 4
CREATE USER TEMPORARY TABLESPACE SYSTOOLSTMPSPACE IN IBMCATGROUP MANAGED BY AUTO
MATIC STORAGE EXTENTSIZE 4
CREATE SYSTEM TEMPORARY TABLESPACE VCTEMPTS_8K PAGESIZE 8 K MANAGED BY AUTOMATIC
STORAGE BUFFERPOOL VCBP_8K ;
CREATE SYSTEM TEMPORARY TABLESPACE VCTEMPTS_16K PAGESIZE 16 K MANAGED BY AUTOMAT
IC STORAGE BUFFERPOOL VCBP_16K ;
CREATE SYSTEM TEMPORARY TABLESPACE VCTEMPTS_32K PAGESIZE 32 K MANAGED BY AUTOMAT
IC STORAGE BUFFERPOOL VCBP_32K ; commit work;
connect reset;
terminate;

2) Create a vCenter Server database user with the correct permissions.


-- =============================================================================
=
-- Run with DB2 SYSADMIN authorization for every new vCenter Server schema. The
script uses the default schema of the user.
-- =============================================================================
=
Create a user on the OS first. Then run the following script to create the schem
a. Usually the schema name and username are the same. Make the DB2 OS user a mem
ber of db2users group in Windows. For Linux installations, create an OS user and
an OS group. The OS user must be a member of the OS group. This is required for
the sysmon_group privilege.
Grant table space and user defined function privileges to user (OS user created)
GRANT USE OF TABLESPACE VCTS_16K TO USER VPX WITH GRANT OPTION;
GRANT USE OF TABLESPACE VCTS_32K TO USER VPX WITH GRANT OPTION;
GRANT USE OF TABLESPACE VCTS_8K TO USER VPX WITH GRANT OPTION;
commit work;
3) Open a DB2 Command window with the user that you created on the vCenter Serve
r database.
4) Locate the dbschema scripts in the vCenter Server installation package bin/db
schema directory.
5) Run the script on the database. Open the script in the Command Editor window
and press Ctrl+Return to execute the script.
VCDB_db2.SQL
VCDB_views_db2.SQL
TopN_DB_db2.sql

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.

Anda mungkin juga menyukai