«

»

Dec 07 2011

Print this Post

VMware – SQL script to create the vCenter 4.1 database

use [master]
 go
 CREATE DATABASE [VCDB] ON PRIMARY
 (NAME = N'vcdb',
  FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.VIMSQL\MSSQL\DATA\VCDB.mdf',
  SIZE = 2000KB,
  FILEGROWTH = 10%)
 LOG ON
 (NAME = N'vcdb_log',
  FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.VIMSQL\MSSQL\DATA\VCDB.ldf',
  SIZE = 1000KB ,
  FILEGROWTH = 10%)
 COLLATE SQL_Latin1_General_CP1_CI_AS
 go
 use VCDB
 go
 sp_addlogin @loginame=[vpxuser],
             @passwd=N'@Password',
             @defdb='VCDB',
             @deflanguage='us_english'
 go
 ALTER LOGIN [vpxuser] WITH CHECK_POLICY = OFF
 go
 CREATE USER [vpxuser] for LOGIN [vpxuser]
 go
 CREATE SCHEMA [VMW]
 go
 ALTER USER [vpxuser] WITH DEFAULT_SCHEMA =[VMW]
 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

Permanent link to this article: https://ituda.com/vmware-sql-script-to-create-the-vcenter-4-1-database/

%d bloggers like this: