使用這種 SQL 資料庫設定方法來建立自訂結構描述 VMW,而非使用現有 dbo 結構描述。您還必須針對使用者啟用「資料庫監控」,然後再使用內嵌式或外部 Platform Services Controller 安裝 vCenter Server

開始之前

在升級 vCenter Server 之前,為確保您具有適當的角色和權限,請更新 vCenter Server 的 SQL Server 資料庫和使用者。

執行這項作業的原因和時機

這種方法需要建立新的資料庫角色,並將這些角色授與資料庫 user

程序

  1. 以 sysadmin 身分或使用具有 sysadmin 權限的使用者帳戶登入 Microsoft SQL Server Management Studio 工作階段。
  2. 執行下列指令碼來建立角色和套用權限。

    該指令碼位於 vCenter Server 安裝套件的 /installation directory/vCenter-Server/dbschema/DB_and_schema_creation_scripts_MSSQL.txt 中。

    CREATE SCHEMA [VMW]
    go
    ALTER USER [vpxuser] WITH DEFAULT_SCHEMA =[VMW]
    
    if not exists (SELECT name FROM sysusers WHERE issqlrole=1 AND name = 'VC_ADMIN_ROLE')
    CREATE ROLE VC_ADMIN_ROLE;
    GRANT ALTER ON SCHEMA ::[VMW] to VC_ADMIN_ROLE;
    GRANT REFERENCES ON SCHEMA ::[VMW] to VC_ADMIN_ROLE;
    GRANT INSERT ON SCHEMA ::[VMW] to VC_ADMIN_ROLE;
    
    GRANT CREATE TABLE to VC_ADMIN_ROLE;
    GRANT CREATE VIEW to VC_ADMIN_ROLE;
    GRANT CREATE Procedure to VC_ADMIN_ROLE;
    
    if not exists (SELECT name FROM sysusers WHERE issqlrole=1 AND name = 'VC_USER_ROLE')
    CREATE ROLE VC_USER_ROLE
    go
    GRANT SELECT ON SCHEMA ::[VMW] to VC_USER_ROLE
    go
    GRANT INSERT ON SCHEMA ::[VMW] to VC_USER_ROLE
    go
    GRANT DELETE ON SCHEMA ::[VMW] to VC_USER_ROLE
    go
    GRANT UPDATE ON SCHEMA ::[VMW] to VC_USER_ROLE
    go
    GRANT EXECUTE ON SCHEMA ::[VMW] to VC_USER_ROLE
    go
    sp_addrolemember VC_USER_ROLE , [vpxuser]
    go
    sp_addrolemember VC_ADMIN_ROLE , [vpxuser]
    go
    use MSDB
    go
    if not exists (SELECT name FROM sysusers WHERE issqlrole=1 AND name = 'VC_ADMIN_ROLE')
    CREATE ROLE VC_ADMIN_ROLE;
    go
    GRANT SELECT on msdb.dbo.syscategories to VC_ADMIN_ROLE
    go
    GRANT SELECT on msdb.dbo.sysjobsteps to VC_ADMIN_ROLE
    go
    GRANT SELECT ON msdb.dbo.sysjobs to VC_ADMIN_ROLE
    go
    GRANT SELECT ON msdb.dbo.sysjobs_view to VC_ADMIN_ROLE
    go
    GRANT EXECUTE ON msdb.dbo.sp_add_job TO VC_ADMIN_ROLE
    go
    GRANT EXECUTE ON msdb.dbo.sp_delete_job TO VC_ADMIN_ROLE
    go
    GRANT EXECUTE ON msdb.dbo.sp_add_jobstep TO VC_ADMIN_ROLE
    go
    GRANT EXECUTE ON msdb.dbo.sp_update_job TO VC_ADMIN_ROLE
    go
    GRANT EXECUTE ON msdb.dbo.sp_add_jobserver TO VC_ADMIN_ROLE
    go
    GRANT EXECUTE ON msdb.dbo.sp_add_jobschedule TO VC_ADMIN_ROLE
    go
    GRANT EXECUTE ON msdb.dbo.sp_add_category TO VC_ADMIN_ROLE
    go
    sp_addrolemember VC_ADMIN_ROLE , [vpxuser]
    go
    use master
    go
    grant VIEW SERVER STATE to [vpxuser]
    go
    GRANT VIEW ANY DEFINITION TO [vpxuser]
    go