View a markdown version of this page

為 RDS for SQL Server 建立 BYOM 資料庫執行個體 - Amazon Relational Database Service

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

為 RDS for SQL Server 建立 BYOM 資料庫執行個體

使用 AWS 管理主控台、AWS Tools for PowerShell、 AWS CLI或 Amazon RDS API 建立 BYOM 資料庫執行個體。 AWS CLI 和 AWS Tools for PowerShell 預先安裝在 中AWS CloudShell。

主控台 – 從建立資料庫頁面,您可以建立 BYOM 執行個體,就像建立已包含授權 (LI) 執行個體一樣。主控台會代表您在幕後建立 BYOM 引擎版本。請注意,從您提供的安裝媒體建置引擎版本,會為整體執行個體建立時間增加約 20 分鐘。

若要避免此額外等待,您可以從自訂引擎版本頁面預先建立 BYOM 引擎版本。建立引擎版本後,對其啟動執行個體會遵循與 LI 執行個體相同的時間軸。

AWS CLI 和 AWS Tools for PowerShell – 當您使用 AWS CLI 或 時 AWS Tools for PowerShell,首先建立 BYOM 引擎版本 ( CreateCustomDBEngineVersion操作),然後建立資料庫執行個體 ( CreateDBInstance操作)。當您將 BYOM 資料庫執行個體升級至新的次要版本時,適用相同的兩個步驟。首先,建立目標 BYOM 引擎版本,並等待其達到available狀態。然後,修改資料庫執行個體 ( ModifyDBInstance操作)。

先決條件

建立 BYOM 資料庫執行個體之前,請先驗證下列項目:

建立 BYOM 資料庫執行個體

  1. 登入 AWS 管理主控台 ,並在 https://console.aws.amazon.com/rds/:// 開啟 Amazon RDS 主控台。

  2. 在導覽窗格中,選擇 Databases (資料庫)。選擇建立資料庫,然後選擇完整組態。

  3. 在 Create database (建立資料庫) 頁面上,執行下列動作:

    1. 針對 Engine type (引擎類型) 中,選擇 Microsoft SQL Server。

    2. 請為資料庫管理類型選擇 Amazon RDS。

    3. 針對版本,選擇 SQL Server Enterprise Edition 或 SQL Server Standard Edition。

    4. 在範本下,確認範本選擇。當您選擇版本時,範本選項會變更。對於 Enterprise Edition 和 Standard Edition,選項為生產和開發/測試。

    5. 針對授權模型,選擇 BYOM (自帶媒體)。

    6. 針對主要引擎版本,選擇符合您安裝媒體的主要版本,例如 SQL Server 2025。

    7. 對於次要引擎版本,請選擇次要版本,例如 17.00.5005.3.v1。

    8. 對於資料庫執行個體識別符,輸入資料庫執行個體的唯一名稱。

    9. 設定剩餘的設定 (資料庫執行個體類別、儲存體、連線能力、身分驗證、備份和維護),如同已包含授權的資料庫執行個體一樣。

  4. 選擇建立資料庫。

Amazon RDS 會自動建立 BYOM 引擎版本,並啟動您的執行個體。

搭配 使用 create-db-instance 命令--license-model bring-your-own-media。

aws rds create-db-instance \ --engine sqlserver-ee \ --engine-version 17.00.5005.3.v1 \ --license-model bring-your-own-media \ --db-instance-identifier my-byom-instance \ --db-instance-class db.m8a.xlarge \ --master-username admin \ --manage-master-user-password \ --allocated-storage 200 \ --db-subnet-group-name my-subnet-group \ --vpc-security-group-ids sg-0123456789abcdef0 \ --region us-west-2

此範例使用 --manage-master-user-password來存放主要使用者密碼 AWS Secrets Manager。如需詳細資訊,請參閱使用 Amazon RDS 和 進行密碼管理 AWS Secrets Manager。

若要改為設定您自己的密碼,請以下列--manage-master-user-password內容取代 :

--master-user-password password

搭配 使用 New-RDSDBInstance cmdlet-LicenseModel bring-your-own-media。

New-RDSDBInstance ` -Engine sqlserver-ee ` -EngineVersion 17.00.5005.3.v1 ` -LicenseModel bring-your-own-media ` -DBInstanceIdentifier my-byom-instance ` -DBInstanceClass db.m8a.xlarge ` -MasterUsername admin ` -ManageMasterUserPassword $true ` -AllocatedStorage 200 ` -DBSubnetGroupName my-subnet-group ` -VpcSecurityGroupId sg-0123456789abcdef0 ` -Region us-west-2

此範例使用 -ManageMasterUserPassword $true來存放主要使用者密碼 AWS Secrets Manager。如需詳細資訊,請參閱使用 Amazon RDS 和 進行密碼管理 AWS Secrets Manager。

若要改為設定您自己的密碼,請以下列-ManageMasterUserPassword $true內容取代 :

-MasterUserPassword password

驗證您的 BYOM 資料庫執行個體

建立執行個體之後,請確認其使用 BYOM 授權模型。確認下列值:

  • LicenseModel 是 bring-your-own-media – 執行個體使用您自己的 SQL Server 授權。

  • Engine 是 sqlserver-ee – 正確的引擎版本。

  • EngineVersion is 17.00.5005.3.v1 – 目標引擎版本。

  1. 登入 AWS 管理主控台 ,並在 https://console.aws.amazon.com/rds/:// 開啟 Amazon RDS 主控台。

  2. 在導覽窗格中,選擇資料庫,然後選擇資料庫執行個體的名稱。

  3. 選擇 Configuration (組態) 索引標籤。

確認授權模型顯示使用自有媒體,而引擎版本顯示目標引擎版本。頁面頂端的引擎欄位會顯示 版本。

使用 describe-db-instances 命令。

aws rds describe-db-instances \ --db-instance-identifier my-byom-instance \ --region us-west-2

輸出看起來如下。

... "Engine": "sqlserver-ee", ... "EngineVersion": "17.00.5005.3.v1", ... "LicenseModel": "bring-your-own-media", ...

使用 Get-RDSDBInstance cmdlet。

Get-RDSDBInstance ` -DBInstanceIdentifier my-byom-instance ` -Region us-west-2

輸出看起來如下。

... Engine : sqlserver-ee ... EngineVersion : 17.00.5005.3.v1 ... LicenseModel : bring-your-own-media ...

考量事項

  • 如果您有建立資料庫執行個體的現有自動化,但未指定授權模型,這些工作流程會在您為該引擎版本建立 BYOM 引擎版本後失敗。在啟用 BYOM 引擎版本之前,請更新您的自動化以指定授權模型。