How to reset the VirtualCenter database schema to DBO
Issue
When restoring a SQL 2000 database into a later SQL version that supports schemas (such as SQL 2005/SQL 2008), the database objects may be owned by a schema other than DBO. This may also be caused by granting the sysadmin server role to the VirtualCenter database user.
Resolution
Run the following queries against the database. Assuming the custom schema is VirtualCenter, the database is VCDB, and the database user is vCenter:
use VCDB
go
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_ALARM_REFRESH
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_GUEST_DISK
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_ALARM_RUNTIME
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_NIC
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_CUSTOMIZATION_SPEC
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_EVENT
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HOST_NODE_CPU
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_EVENT_ARG
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_IP_ADDRESS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HOST_PCI_DEVICE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_FIELD_DEF
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HOST_CPUID_FEATURE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_LICENSE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_LOCK
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_EXT
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_ROLE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_EXT_SERVER
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_SAMPLE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_SCHEDULEDTASK
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_EXT_SERVER_EMAIL
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_SCHED_SCHEDULER
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_EXT_CLIENT
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_SCHED_ACTION
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_EXT_TYPE_IDS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_EXT_PRIVS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_SEQUENCE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_PARAMETER
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_DUAL
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_CSL_COLLECTION
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_STAT_CONFIG
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_CSL_COLLECTION_SYSTEM
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_CSL_CREDENTIAL
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_STAT_DEF
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_CSL_DISCOVERY
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_CSL_DOMAIN
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_STAT_ID
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_CSL_SYSTEM
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_CSL_SYSTEM_IP_ADDRESS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_TASK
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_CSL_SYSTEM_DEVICE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_CSL_SYSTEM_PERF
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_DISABLED_METHODS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_VERSION
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HOST_DISABLEADMIN
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HIST_STAT
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_STAT_INTERVAL_DEF
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_PRIV_ROLE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_DEVICE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_ENTITY
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_STAT_COUNTER
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_SAMPLE_TIME1
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_SAMPLE_TIME2
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_SAMPLE_TIME3
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_ACCESS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_SAMPLE_TIME4
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HIST_STAT1
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_SNAPSHOT
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HIST_STAT2
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HIST_STAT3
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HIST_STAT4
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_FIELD_VAL
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_DATACENTER
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_VM
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_WWN
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_VM_STATIC_OVERHEAD_MAP
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_COMPUTE_RESOURCE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_DATASTORE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_NETWORK
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_NW_ASSIGNMENT
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HOST
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HOST_X
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HOST_WARNING
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HOST_DS_LUN
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_VM_RDM_LUN
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_RESOURCE_POOL
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_DS_ASSIGNMENT
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HOST_VM_CONFIG_OPTION
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_COMPUTE_RESOURCE_DAS_VM
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_COMPUTE_RESOURCE_DRS_VM
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_COMPUTE_RESOURCE_DPM_HOST
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HOST_CPU
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_OBJECT_TYPE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_ALARM
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HOST_CPU_THREAD
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_ALARM_EXPRESSION
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HOST_CPU_CPUID_FEATURE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_ALARM_ACTION
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPX_HOST_NODE
go
ALTER SCHEMA dbo TRANSFER VirtualCenter.stats_rollup1_proc
ALTER SCHEMA dbo TRANSFER VirtualCenter.stats_rollup2_proc
ALTER SCHEMA dbo TRANSFER VirtualCenter.stats_rollup3_proc
ALTER SCHEMA dbo TRANSFER VirtualCenter.purge_stat1_proc
ALTER SCHEMA dbo TRANSFER VirtualCenter.purge_stat2_proc
ALTER SCHEMA dbo TRANSFER VirtualCenter.purge_stat3_proc
ALTER SCHEMA dbo TRANSFER VirtualCenter.load_stats_proc
ALTER SCHEMA dbo TRANSFER VirtualCenter.delete_stats_proc
go
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_ALARMS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_COMPUTE_RESOURCE_NETWORK
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_ENTITY
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_FARMGROUPS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_FIELDS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_HIST_STAT_DAILY
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_HIST_STAT_MONTHLY
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_HIST_STAT_WEEKLY
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_HIST_STAT_YEARLY
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_HOST_DATASTORE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_HOST_FIELDS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_HOST_NETWORK
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_HOSTS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_PERF_INTERVALS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_STAT_COUNTERS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_STAT_HISTORICAL_INTERVALS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_TASKS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_TEMPLATES
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_VM_DATASTORE
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_VM_FIELDS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_VM_NETWORK
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_VMGROUPS
ALTER SCHEMA dbo TRANSFER VirtualCenter.VPXV_VMS
go
To map the DBO user to the selected account:
- Ensure the user
IS NOT defined under Databases | VCDB | Security | Users in SQL Server Management Studio
- Ensure the user
IS defined under Security | Logins in SQL Server Management Studio
- Run the following query:
use VCDB
go
EXEC sp_changedbowner @loginame = 'vCenter', @map = 'true'
go
- Check the porperties on the dbo user to ensure it is now mapped to the correct login name.
References
To return the list of tables in the VCDB database run the following query:
use VCDB
go
exec sp_tables '%', '%', 'VCDB', "'table'"
go
To return the list of stored procedures in the VCDB database run the following query:
select * from VCDB.information_schema.routines where routine_type = 'PROCEDURE'
go
To return the list of views in the VCDB database run the following query:
use VCDB
go
exec sp_tables 'VPXV%', '%', 'VCDB', "'view'"
go
Upgrading from VirtualCenter 2.5 to vCenter 4.0 fails with multiple schema errors
http://kb.vmware.com/kb/1011386
VirtualCenter inventory is empty after upgrade
http://kb.vmware.com/kb/1005157
The VirtualCenter Server service does not start after deploying or upgrading VirtualCenter Server with MS SQL 2005
http://kb.vmware.com/kb/6565318
Do not grant or revoke the System Administrator's role to satisfy database permission requirements when upgrading to VirtualCenter 2.5
http://kb.vmware.com/kb/1003346
Host And Other Configuration Data Missing After Upgrading to VirtualCenter 2.5
http://kb.vmware.com/kb/1003610
Administrative credentials are required for Oracle and SQL Server databases when installing or upgrading VirtualCenter
http://kb.vmware.com/kb/1003052
Products
VMware VirtualCenter 2.5
VMware vCenter Server 4.0
Created: 14th April 2010
Updated: 14th April 2010
© 2005-2024 Jamie Morrison