vCenter Server deployment fails when recreating a vCenter Server database
search cancel

vCenter Server deployment fails when recreating a vCenter Server database

book

Article ID: 343507

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

If you deploy jobs that are associated with the vCenter database and are additional to the default jobs deployed with vCenter Server installation, a user other than the vCenter database user (for example vpxuser) might own some of those jobs. In such cases, when you attempt to install a new vCenter Server instance on the vCenter database, the vpxd process fails, and error messages similar to the following are written to the vpxd*.log files at %VMWARE_LOG_DIR%/vmware-vpx:
There are jobs which are associated to VCDB but it owner are not dbo


Environment

VMware vCenter Server 5.5.x
VMware vSphere ESXi 6.0
VMware vCenter Server 5.0.x
VMware vCenter Server 6.0.x
VMware vCenter Server 5.1.x

Resolution

Disable all jobs that do not perform operations on the vCenter database and are not created by the vCenter Server database user
Prerequisites
Verify that your vCenter Server user has all permissions as listed in the Configure Microsoft SQL Server Databases topic in the vSphere Installation and Setup Guide.
Procedure
  1. Log in to SQL Server Management Studio with your vCenter Server user name.
  2. Open a new query window in your vCenter Server database.
  3. To list all jobs created by a different user, run the following query:


    SELECT 1
    FROM msdb.dbo.sysjobsteps js
    INNER JOIN msdb.dbo.sysjobs allj
    ON js.job_id = allj.job_id
    WHERE js.database_name = db_name()
    AND suser_sname(owner_sid) <> CURRENTUSER
    AND allj.enabled = 1;

  4. Log in to SQL Server Management studio as an administrator, for example sa.
  5. For each job name in the output of the query in step 3, run the following query:

    exec msdb.dbo.sp_update_job @job_name = N'job name',@enabled = 0

  6. Install vCenter Server.
  7. When the install process is completed, you can re-enable the jobs from step 3 by running the following query:
    exec msdb.dbo.sp_update_job @job_name = N'job name',@enabled = 1