//
you're reading...
vcenter, vCSA, vSphere5

Configuring vCenter Server Virtual Appliance to use an Oracle database

In previous posts I blogged about what the vCenter Server Virtual Appliance (vCSA) is, its features and benefits, feature parity with the Windows vCenter Server and also how to quickly deploy the vCSA. For more information about the vCSA, please see the resources listed here https://vmwire.com/vmware-vcenter-server-virtual-appliance-vcsa/.

This post extends the series with how to configure an external Oracle database for use by the vCSA.

Why use an Oracle database?

The vCSA comes preinstalled with an embedded DB2 database which has similar use cases as the Windows vCenter Server when configured with SQL Express – intended for small deployments of 5 ESX/ESXi servers or less. The ability for the vCSA to utilise an external Oracle database allows customers to scale and manage larger vSphere infrastructures equivalent to environments with Windows vCenter Servers backed by SQL or Oracle databases.

This post shows how quickly and easily it is to use an external Oracle database instead of the embedded DB2 database. Hopefully you’ll see the benefits of how much quicker it is to configure the Oracle connectivity between the vCSA and the Oracle server vs installing the Oracle 64-bit Client onto a Window Server and configuring tnsnames.ora, followed by configuration of ODBC settings.

Configure an Oracle Database and User

  1. Log into SQL*Plus session with the system account. I’m using Oracle 11g R2 x64 on Windows Server 2008.
    C:`>sqlplus sys/<password> as SYSDBA
  2. Run the following SQL commands to create a vCenter Server database. Note that your directory structure may be different.

    CREATE SMALLFILE TABLESPACE “VPX” DATAFILE ‘e:/app/oracle/oradata/orcl/vpx01.dbf’ SIZE 1G AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

  3. Run the following SQL command to create a vCenter Server database user with the correct permissions. I will create a new user named “VPXADMIN” with a password of “oracle”.
    CREATE USER "VPXADMIN" PROFILE "DEFAULT" IDENTIFIED BY "oracle" DEFAULT TABLESPACE "VPX" ACCOUNT UNLOCK;
    grant connect to VPXADMIN;
    grant resource to VPXADMIN;
    grant create view to VPXADMIN;
    grant create sequence to VPXADMIN; 
    grant create table to VPXADMIN; 
    grant create materialized view to VPXADMIN;
    grant execute on dbms_lock to VPXADMIN;
    grant execute on dbms_job to VPXADMIN;
    grant select on dba_tablespaces to VPXADMIN;
    grant select on dba_temp_files to VPXADMIN;
    grant select on dba_data_files to VPXADMIN;
    grant unlimited tablespace to VPXADMIN;

Configure the vCSA

  1. Log into the vCSA VMware Studio management interface at https://<vcsa>:5480/
  2. Navigate to the vCenter Server tab, then click on Database.
  3. Select oracle as the Database Type using the drop-down menu and enter your environment information into the fields and then click on Save Settings. Note how easy that was, no messing about with installing the Oracle Client, no need to configure tnsnames.ora and no need for any ODBC configuration either.

  4. Wait for around 5 minutes for the vCSA to create the database schema.
  5. Now it’s safe to start the vCenter services, navigate to the Status tab and click on Start vCenter.

  6. You can then start using vCenter when the Service Status reports as Running.

Cleaning up the Oracle configuration

After you’ve tested that everything is working, you can revoke the following privileges using SQL*Plus again.

revoke select on dba_tablespaces from VPXADMIN;
revoke select on dba_temp_files from VPXADMIN;
revoke select on dba_data_files from VPXADMIN;

Total configuration time ~approx 10 minutes.

References

vSphere Installation and Setup Guide

Advertisements

About Hugo Phan

@hugophan

Discussion

14 thoughts on “Configuring vCenter Server Virtual Appliance to use an Oracle database

  1. I am getting the error “failed to initialize schema” after 5 min. of saving. It is because of express edition of oracle or some other issue? Test was ok.
    “failed to execute ‘/usr/sbin/vpxd_servicecfg db write oracle server.name xe system censored’ “

    Posted by Kas Tigar | December 5, 2012, 16:55
  2. Hi, Thanks for the this well documented article, saved my day. But i would like to have some additional details regarding this. Here you have talked about configuring a vCSA to use an external Oracle DB, which works very well indeed. However is there any additional steps required or is there any procedure that you are aware of to migrate embedded postgresql in vCSA to an external oracle DB. I have a vCSA in production environment with multiple hosts in cluster and thus I’m looking at a complete migration. Any help in this direction will be very much appreciated. Thanks

    Posted by Kannan | December 9, 2013, 08:06
    • I don’t think migration from embedded to Oracle is possible. Suggest you contact VMware GSS. There is however an inventory tool that will allow you to capture your vCenter hierarchy so you can manually recreate the inventory in a new vCenter deployment. I’ve not worked with this in a while so don’t know what the current status is for migrations like this.

      Posted by Hugo Phan | December 9, 2013, 08:37
  3. Hi there, great post.
    If you deploy the VCSA with a remote Oracle database.. and later finds that some of the limitations of the VCSA is a problem in your environment. Will it be possible to migrate off the VCSA to a Windows vCenter using the oracle database from the VCSA to migrate all the information and configuration settings? And would it be supported?

    Posted by Heino Skov (@heinoskov) | February 5, 2014, 11:17
  4. If you wish for to take a good deal from this piece of writing then you have to apply such strategies to your won weblog.

    Posted by green time needs | January 7, 2015, 10:12
  5. GoօԀ article. I ѡill be experiencing some of these issues аs աell..

    Posted by amazon books comedy | January 9, 2015, 15:40
  6. Thanks for finally talking about >Configuring vCenter Server Virtual Appliance to usse an Oracle database | VMwire <Loved it!

    Posted by gear.elo.me | May 7, 2015, 15:02

Trackbacks/Pingbacks

  1. Pingback: vSphere 5 vCenter Server Virtual Appliance Quick-Start Guide « VMwire - March 2, 2012

  2. Pingback: Adding sysprep packages to the VMware vCenter Server Virtual Appliance « VMwire - March 14, 2012

  3. Pingback: เปลี่ยนฐานข้อมูลมาใช้ Oracle บน vCenter Server Virtual Appliance | ThaiVirt.com - March 25, 2012

  4. Pingback: เปลี่ยนฐานข้อมูลมาใช้ Oracle บน vCenter Server Virtual Appliance | ThaiVirt.com | ไทยเวิร์ต.คอม.... ฝักใฝ่โลกเสมือน เชิญทางนี้.... - June 22, 2012

  5. Pingback: vSphere 5 vCenter Server Virtual Appliance Quick-Start Guide « Tam Do - August 24, 2012

  6. Pingback: vSphere 5 vCenter Server Virtual Appliance Quick-Start Guide | handonlab - November 7, 2014

  7. Pingback: Configuring Vcenter Server Virtual Appliance To Use An Oracle Database | Badboyremix - August 17, 2016

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: