This topic describes how to create database objects manually instead of letting the vCenter Server installer create the data objects automatically.
Procedure
- Log in to a Microsoft SQL Server Management Studio session with the vCenter Server database user account that you created on the vCenter Server and msdb databases.
- In the vCenter Server installation package, locate the dbschema scripts in the vCenter-Server/dbschema directory.
- Open the VCDB_mssql.SQL and the TopN_DB_mssql.sql files by using Microsoft SQL Server Management Studio and replace all occurrences of
$schema
with your schema name. - Open the VCDB_views_mssql.sql file by using Microsoft SQL Server Management Studio and after each occurrence of
;
, insert a new line and writego
. - Run the scripts in a sequence on the database.
The DBO user must own the objects created by these scripts. Open the scripts one at a time in Microsoft SQL Server Management Studio and press F5 to execute each script in the following order:
- VCDB_mssql.SQL
- insert_stats_proc_mssql.sql
- load_stats_proc_mssql.sql
- purge_stat2_proc_mssql.sql
- purge_stat3_proc_mssql.sql
- purge_usage_stats_proc_mssql.sql
- stats_rollup1_proc_mssql.sql
- stats_rollup2_proc_mssql.sql
- stats_rollup3_proc_mssql.sql
- cleanup_events_mssql.sql
- delete_stats_proc_mssql.sql
- upsert_last_event_proc_mssql.sql
- load_usage_stats_proc_mssql.sql
- TopN_DB_mssql.sql
- calc_topn1_proc_mssql.sql
- calc_topn2_proc_mssql.sql
- calc_topn3_proc_mssql.sql
- calc_topn4_proc_mssql.sql
- clear_topn1_proc_mssql.sql
- clear_topn2_proc_mssql.sql
- clear_topn3_proc_mssql.sql
- clear_topn4_proc_mssql.sql
- rule_topn1_proc_mssql.sql
- rule_topn2_proc_mssql.sql
- rule_topn3_proc_mssql.sql
- rule_topn4_proc_mssql.sql
- process_license_snapshot_mssql.sql
- l_stats_rollup3_proc_mssql.sql
- l_purge_stat2_proc_mssql.sql
- l_purge_stat3_proc_mssql.sql
- l_stats_rollup1_proc_mssql.sql
- l_stats_rollup2_proc_mssql.sql
- VCDB_views_mssql.sql
- (Optional) Run the scripts to enable database health monitoring.
- job_dbm_performance_data_mssql.sql
- process_performance_data_mssql.sql
- For all supported editions of Microsoft SQL Server except Microsoft SQL Server Express, run the scripts to set up scheduled jobs on the database.
These scripts ensure that the SQL Server Agent service is running.
- job_schedule1_mssql.sql
- job_schedule2_mssql.sql
- job_schedule3_mssql.sql
- job_cleanup_events_mssql.sql
- job_topn_past_day_mssql.sql
- job_topn_past_week_mssql.sql
- job_topn_past_month_mssql.sql
- job_topn_past_year_mssql.sql
- For all the procedures you created in Step 5, grant the execute privilege to the vCenter Server database user in the vCenter Server database.
For example, to grant execute privilege for the procedures to the vpxuser user, you can run the following script.
grant execute on insert_stats_proc to vpxuser grant execute on purge_stat2_proc to vpxuser grant execute on purge_stat3_proc to vpxuser grant execute on purge_usage_stat_proc to vpxuser grant execute on stats_rollup1_proc to vpxuser grant execute on stats_rollup2_proc to vpxuser grant execute on stats_rollup3_proc to vpxuser grant execute on cleanup_events_tasks_proc to vpxuser grant execute on delete_stats_proc to vpxuser grant execute on upsert_last_event_proc to vpxuser grant execute on load_usage_stats_proc to vpxuser grant execute on load_stats_proc to vpxuser grant execute on calc_topn1_proc to vpxuser grant execute on calc_topn2_proc to vpxuser grant execute on calc_topn3_proc to vpxuser grant execute on calc_topn4_proc to vpxuser grant execute on clear_topn1_proc to vpxuser grant execute on clear_topn2_proc to vpxuser grant execute on clear_topn3_proc to vpxuser grant execute on clear_topn4_proc to vpxuser grant execute on rule_topn1_proc to vpxuser grant execute on rule_topn2_proc to vpxuser grant execute on rule_topn3_proc to vpxuser grant execute on rule_topn4_proc to vpxuser grant execute on process_license_snapshot_proc to vpxuser grant execute on l_stats_rollup3_proc to vpxuser grant execute on l_purge_stat2_proc to vpxuser grant execute on l_purge_stat3_proc to vpxuser grant execute on l_stats_rollup1_proc to vpxuser grant execute on l_stats_rollup2_proc to vpxuser
If you ran the script
process_performance_data_mssql.sql
in Step 5, grant the following execute privilege to the vCenter Server database.grant execute on process_performance_data_proc to vpxuser
Results
Note: During the
vCenter Server installation, when a database reinitialization warning message appears, select
Do not overwrite, leave my existing database in place and continue the installation.