To simplify the process of creating the SQL Server database, users, and privileges, you can run a script. You also can create the database manually.

In the script, you can customize the location of the data and log files.

The user created by this script does not follow any security policy. Change the passwords as appropriate.

To prepare a SQL Server database to work with vCenter Server, you generally need to create a SQL Server database user with database operator (DBO) rights. Make sure that the database user login has the db_owner fixed database role on the vCenter Server database and on the MSDB database. The db_owner role on the MSDB database is required for installation and upgrade only, and you can revoke it after installation.

If you run this script as well as the script to create the database schema, you do not have to grant DBO permissions on the vCenter Server database. For environments in which the vCenter Server database user cannot have DBO permissions, these scripts are especially useful. The user created by this script has DBO privileges on both VCDB and MSDB databases. To change this, remove the two occurrences of this line:

sp_addrolemember @rolename = 'db_owner', @membername = 'vpxuser'
Important

If you remove these lines, you must also run the script that creates the vCenter Server database schema, instead of allowing the vCenter Server installer to create the schema.

1

Log in to a Query Analyzer session as the sysadmin (SA) or a user account with sysadmin privileges.

2

Run the following script.

The script is located in the vCenter Server installation package /<installation directory>/vpx/dbschema/DB_and_schema_creation_scripts_MSSQL.txt file.

use [master] 
go 
CREATE DATABASE [VCDB] ON PRIMARY 
(NAME = N'vcdb', FILENAME = N'C:\VCDB.mdf', SIZE = 2000KB, FILEGROWTH = 10% ) 
LOG ON 
(NAME = N'vcdb_log', FILENAME = N'C:\VCDB.ldf', SIZE = 1000KB, FILEGROWTH = 10%) 
COLLATE SQL_Latin1_General_CP1_CI_AS 
go
use VCDB 
go 
sp_addlogin @loginame=[vpxuser], @passwd=N'vpxuser!0', @defdb='VCDB', @deflanguage='us_english'
go 
ALTER LOGIN [vpxuser] WITH CHECK_POLICY = OFF 
go 
CREATE USER [vpxuser] for LOGIN [vpxuser] 
go 
sp_addrolemember @rolename = 'db_owner', @membername = 'vpxuser' 
go 
use MSDB 
go 
CREATE USER [vpxuser] for LOGIN [vpxuser] 
go
sp_addrolemember @rolename = 'db_owner', @membername = 'vpxuser' 
go

You now have a Microsoft SQL Server database that you can use with vCenter Server.

You can run the script to create the database schema.