VCenter database installation in SQL Server 2005, Oracle

This chapter excerpt offers the steps for vCenter database installations in both SQL Server 2005 and Oracle 10g and 11g as well as information on configuration settings.

Solutions provider takeaway: There are vCenter database installation methods other than the default database installation that solutions providers need to be aware of. Use this chapter excerpt to learn about alternate installations for SQL Server 2005 and Oracle 10g and 11g.

About the book
This chapter excerpt on Installing and Configuring vCenter Server (download PDF) is taken from the book VMware vSphere 4 Administration Instant Reference. This book provides information on the ins and outs of vSphere 4 for solutions providers. You will learn about vSphere features, installing and configuring vCenter Server, managing and configuring virtual machines and how to handle licensing issues.

Install a Database

As previously mentioned, VMware utilizes industry-standard databases for vCenter Server. Administrators cannot easily use or access the raw data contained in the vCenter Server database; instead, they must use vSphere Client. Components like the datacenters, clusters, resource pools, hosts, and virtual machines, along with their associated configuration and performance data, are stored in the backend database that vCenter Server is connected to. As mentioned, the default installation includes Microsoft SQL Server 2005 Express Edition. The vCenter Server installer automatically creates a data source name (DSN), the database, and the database schema when using the embedded SQL Server 2005 Express. We'll cover installation of the default database when we discuss vCenter Server installation.

We will examine a few alternate database installations—Microsoft SQL Server 2005 (other than Express Edition) or Oracle 10g or 11g—in the following sections.

Create a vCenter Database in Microsoft SQL Server 2005

The default Microsoft SQL Server 2005 Express Edition installation with vCenter Server supports up to 5 hosts and 50 virtual machines. It is not considered as robust as its cousins, Microsoft SQL Server 2005 Standard and Enterprise Editions. In many cases the Standard and Enterprise Editions are chosen due to their enhanced feature set, which they do not share with the Express Edition.

Tables listing the differences among the various editions of Microsoft SQL Server 2005 can be found on Microsoft's website:

Whether you have chosen to utilize Standard or Enterprise Edition, Microsoft recommends certain configuration settings when you're creating the vCenter Server database. The database can reside on the local system or can be accessed remotely. This database can be created automatically using the SQL 2005 management tools. Using the automatic method will require some additional configuration. To accomplish this easily, use the following steps:

  1. If vCenter Server is part of a Windows domain, create a domain account that will be used to access the SQL Server instance.
  2. Note: It is not a best practice to use a Domain Admin account for this purpose but rather a dedicated domain account. Make sure this user has db_datawriter and db_datareader permissions on the SQL instance.

  3. During initial installation and upgrades, the vpxuser account must have db_owner rights on the MSDB database. This access can be revoked after an installation or upgrade.
  4. Load SQL Query Analyzer with a user that has DBO privileges, and run the following instructions:
  5. use [master]
    (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
    use VCDB
    sp_addlogin @loginame=[vpxuser], @passwd=N'vpxuser', →
    @defdb='VCDB', @deflanguage='
    CREATE USER [vpxuser] for LOGIN [vpxuser]
    sp_addrolemember @rolename = 'db_owner', →
    @membername = 'vpxuser'
    use MSDB
    CREATE USER [vpxuser] for LOGIN [vpxuser]
    sp_addrolemember @rolename = 'db_owner', →
    @membername = 'vpxuser'

    Remember that you can change the database user, location, and database name within this script. Keep in mind that these values will need to match the DSN created to access the database.

  6. Use the same SQL Query Analyzer window to run the following scripts in the order they are listed. These scripts, which create the database schema, can be located and run from the vpx/dbshema directory of the installation media.
  7. VCDB_mssql.SQL

  8. There are some additional scripts that work with the SQL Server Agent to handle job scheduling and similar tasks. They are not supported when you're using Microsoft SQL Server 2005 Express Edition, as that edition does not natively provide any scheduling functions. Again, using the same SQL Query Analyzer, load and run each of these scripts in the order listed. Before running the scripts, confirm that the SQL Server Agent is running.
  9. job_schedule1_mssql.sql

  10. The database and database schema have now been created and are ready for a DSN to connect to the VCDB instance.
  11. On the vCenter Server system, open the Windows ODBC Data Source Administrator by choosing Settings → Control Panel → Administrative Tools → Data Sources (ODBC).

    Note: If you're using a 64-bit operating system, you are required to run the 32-bit ODBC Administrator application, which is located at C:\Windows\SysWOW64\odbcad32.exe.

  12. Select the System DSN tab.
  13. Click Add, select SQL Native Client, and click Finish.
  14. Type an ODBC DSN name in the Name field, something like vCenter Server.
  15. Select the server name from the Server drop-down menu and click Next. This can be the local system or a remote system.
  16. Note: With a default installation of SQL Server, only a single instance or installation of SQL is present. If multiple SQL Server installations are present on a server, each additional installation is referred to as a named instance. The primary instance does not have a specific name, other than the server name, while named instances are typically signified as SERVERNAME\InstanceName.

  17. Type the SQL Server machine name in the Server text field (or select it from the Server drop-down list).
  18. Select Windows Authentication.
  19. Select the database created for the vCenter Server system from the Change The Default Database To menu and click Next.
  20. Click Finish.

A DSN that is compatible with vCenter Server is now available. When the vCenter Server installer prompts for the DSN of the database, select vCenter Server, or whatever value you entered in step 10.

Microsoft SQL Server 2005 is a popular database, and as you can see in steps 1 through 15, it is relatively simple to configure.

Create a vCenter Database in Oracle

Not every environment uses Microsoft SQL Server 2005. For various reasons, administrators are often forced to choose databases already being used in their environment. Oracle is a popular database choice, and VMware supports several versions of Oracle, including 10g and 11g. Oracle has another appeal to environments that have a limited Microsoft footprint: it is available for many other platforms, including Linux, Solaris, and HP-UX. You don't have to have Oracle installed locally on the vCenter Server. Just as with Microsoft's database offering, when you're using Oracle, certain configurations are considered best practices when creating the database. Perform these steps to create the database:

  1. Log on to a SQL*Plus session with the system account.
  2. Run the following commands, or script, to create the database:
    '/u01/app/oracle/oradata/vcdb/vpx01.dbf' →

    Note: The datafile path ('/u01/app/oracle/oradata/vcdb/vpx01.dbf' in this case) must be a valid path on your Oracle system; change this to match your particular environment.

  4. Open a SQL*Plus window with a user that has schema owner rights on the vCenter Server database to create the database schema.
  5. Locate the dbschema scripts in the vCenter Server installation package bin/dbschema directory.
  6. In SQL*Plus, run the scripts in sequence on the database. ‹path› is the directory path to the bin/dbschema folder.
  7. @‹path›/VCDB_oracle.SQL

  8. All supported editions of Oracle Server require that these additional scripts be run to set up scheduled jobs on the database:
  9. @‹path›/job_schedule1_oracle.sql

  10. Oracle can use a local or remote Oracle instance. From the same SQL*Plus window, run the following script (where VPXADMIN is the user):
    grant connect to VPXADMIN; →
    grant resource to VPXADMIN; →
    grant create view to VPXADMIN; →
    grant create sequence to VPXADMIN; →
    grant create table to VPXADMIN; →
    grant execute on dbms_lock to VPXADMIN; →
    grant execute on dbms_job to VPXADMIN; →
    grant unlimited tablespace to VPXADMIN;
    20727c03.indd 82 11/6/09 1:07:01 AM

    About the authors
    Scott Lowe has worked in the IT field for more than 10 years and is the author of Mastering VMware vSphere 4. Lowe is currently the IT director for the National Association of Attorneys General and he writes technical articles for CNet's TechRepublic.

    Jason W. McCarty has worked in the IT industry for more than 15 years. McCarty wrote VMware ESX Essentials in the Virtual Data Center and has experience in most Microsoft products and operating systems, several different distributions of Linux and the majority of VMware's virtualization offerings.

    Matthew K. Johnson moderates VMware forums and a weekly VMware podcast and has experience with VMware infrastructures.

  12. If the Oracle database is not installed on the same system as vCenter Server, download and install the Oracle client.
  13. On the vCenter Server system, open the Windows ODBC Data Source Administrator by choosing Settings ➣ Control Panel ➣Administrative Tools ➣ Data Sources (ODBC).
  14. Note: If you are using a 64-bit operating system, run the 32-bit ODBC Administrator application, which is located at C:\Windows\SysWOW64\odbcad32.exe.

  15. Select the System DSN tab and click Add.
  16. Select the appropriate Oracle driver for your installation and click Finish.
  17. Enter the name of the DSN, such as vCenter Server.
  18. Ensure that appropriate values appear in the TNS Names field referencing the local or remote Oracle instances. Select the appropriate TNS Service name.
  19. Enter the username created in the Create User section.
  20. Click OK. An Oracle database is now available for the vCenter Server installer.

Like SQL Server, Oracle is a popular database and is also relatively simple to configure for use with vCenter Server.

Installing and Configuring vCenter Server
  VCenter Server installation requirements
  VCenter database installation in SQL Server 2005, Oracle
  VCenter Server installation steps and components

Printed with permission from Wiley Publishing Inc. Copyright 2009. VMware vSphere 4 Administration Instant Reference by Scott Lowe, Jason W. McCarty and Matthew K. Johnson. For more information about this title and other similar books, please visit Wiley Publishing Inc.

Dig Deeper on Server virtualization technology and services

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.