To use an Oracle database with vCenter Server, you must create the database with certain tablespaces and privileges, and the database user with certain permissions.

You must first create a tablespace and user for vCenter Server. Then you grant permissions to the database user. You must also enable database monitoring for the user before you install vCenter Server. See Database Permission Requirements for vCenter Server.

To perform the following procedure, you can either use the graphical user interface or run scripts. The vCenter Server installer package contains example scripts in the vCenter-Server\dbschema\DB_and_schema_creation_scripts_PostgreSQL.txt file.

Log in to a SQL*Plus session with the system account.

1

Create a tablespace for vCenter Server.

For example, to create the tablespace VPX, you can run the following script:

CREATE SMALLFILE TABLESPACE "VPX" DATAFILE 'C:\database_path\vpx01.dbf'
SIZE 1G AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT 
SPACE MANAGEMENT AUTO;
2

Create a database user with the correct permissions for vCenter Server.

For example, to create the VPXADMIN user, you can run the following script:

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_lock 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 select on v_$session to VPXADMIN;
grant unlimited tablespace to VPXADMIN;

By default, the RESOURCE role has the CREATE PROCEDURE, CREATE TABLE, and CREATE SEQUENCE privileges assigned. If the RESOURCE role lacks these privileges, grant them to the vCenter Server database user.

Note

Instead of granting unlimited tablespace, you can set a specific tablespace quota. The recommended quota is unlimited with a minimum of at least 500MB. To set an unlimited quota, use the following command.

alter user "VPXADMIN" quota unlimited on "VPX";

If you set a limited quota, monitor the remaining available tablespace to avoid the following error.

ORA-01536: space quota exceeded for tablespace 'tablespace'

You now have an Oracle database user for vCenter Server.

3

Enable database monitoring for the vCenter Server database user.

For example, to grant database disk size monitoring permissions to the VPXADMIN user, you can run the following script:

grant select on v_$system_event to VPXADMIN;
grant select on v_$sysmetric_history to VPXADMIN;
grant select on v_$sysstat to VPXADMIN;
grant select on dba_data_files to VPXADMIN;
grant select on v_$loghist to VPXADMIN;