建立並連線至 Amazon RDS Custom for SQL Server 的資料庫執行個體 - Amazon Relational Database Service

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

建立並連線至 Amazon RDS Custom for SQL Server 的資料庫執行個體

您可以建立RDS自訂資料庫執行個體,然後使用 AWS Systems Manager 或 遠端桌面通訊協定 () 連線到它RDP。

重要

在您建立或連線至 RDS Custom for SQL Server 資料庫執行個體之前,請務必完成 中的任務設定您的 Amazon RDS Custom for SQL Server 的環境

您可以在建立RDS自訂資料庫執行個體時為其加上標籤,但請勿建立或修改RDS自訂自動化所需的AWSRDSCustom標籤。如需詳細資訊,請參閱標記 RDS Custom for SQL Server 資源

第一次建立 RDS Custom for SQL Server 資料庫執行個體時,您可能會收到下列錯誤:服務連結角色正在建立中。請稍後再試。如果收到這個訊息,請等待幾分鐘的時間然後再次嘗試建立資料庫執行個體。

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

使用 或 建立 AWS Management Console Amazon RDS Custom for SQL Server 資料庫執行個體 AWS CLI。程序類似於建立 Amazon RDS 資料庫執行個體的程序。

如需詳細資訊,請參閱建立 Amazon RDS 資料庫執行個體

建立 RDS Custom for SQL Server 資料庫執行個體
  1. 登入 AWS Management Console 並在 開啟 Amazon RDS主控台https://console.aws.amazon.com/rds/

  2. 在導覽窗格中,選擇 Databases (資料庫)。

  3. 選擇 Create database (建立資料庫)。

  4. 選擇 Standard Create (標準建立) 做為資料庫建立方法。

  5. 針對引擎選項 ,選擇引擎類型的 Microsoft SQL Server

  6. 針對資料庫管理類型 ,選擇 Amazon RDS Custom

  7. Edition (版本) 區段中,選擇您想要使用的資料庫引擎版本。

  8. (選用) 如果您要從 建立資料庫執行個體CEV,請勾選使用自訂引擎版本 (CEV) 核取方塊。在下拉式清單CEV中選取您的 。

  9. 對於資料庫版本 ,請保留預設值版本。

  10. Templates (範本) 中,選擇 Production (生產)。

  11. Settings (設定) 區段中,為 DB instance identifier (資料庫執行個體識別符) 輸入唯一的名稱。

  12. 若要輸入您的主要密碼,請執行以下動作:

    1. Settings (設定) 區段,開啟 Credential Settings (登入資料設定)

    2. 清除 Auto generate a password (自動產生密碼) 核取方塊。

    3. 變更 Master username (主要使用者名稱) 值並在 Master password (主要密碼)Confirm password (確認密碼) 中輸入相同的密碼。

    根據預設,新的RDS自訂資料庫執行個體會使用主要使用者自動產生的密碼。

  13. DB instance size (資料庫執行個體大小) 區段中,為 DB instance class (資料庫執行個體類別) 選擇值。

    如需支援的類別,請參閱 RDS Custom for SQL Server 的資料庫執行個體類別支援

  14. 選擇 Storage (儲存) 設定。

  15. 對於RDS自訂安全 ,請執行下列動作:

    1. 對於IAM執行個體設定檔 ,有兩個選項可以選擇 RDS Custom for SQL Server 資料庫執行個體的執行個體設定檔。

      1. 選擇建立新的執行個體設定檔,並提供執行個體設定檔名稱尾碼。如需詳細資訊,請參閱使用 自動建立執行個體描述檔 AWS Management Console

      2. 選擇現有的執行個體設定檔。從下拉式清單中,選擇開頭為 的執行個體設定檔AWSRDSCustom

    2. 針對加密 ,選擇輸入金鑰ARN以列出可用的 AWS KMS 金鑰。然後從清單選擇您的金鑰。

      RDS 自訂需要 AWS KMS 金鑰。如需詳細資訊,請參閱請確定您有對稱加密 AWS KMS 金鑰

  16. 針對其餘區段,指定您偏好的RDS自訂資料庫執行個體設定。如需每項設定的相關資訊,請參閱 資料庫執行個體的設定。以下設定不會出現在主控台中,也不受支援:

    • 處理器功能

    • 儲存體自動調整規模

    • Availability & durability (可用性與持久性)

    • Database authentication (資料庫身分驗證) 中的 Password and Kerberos authentication (密碼和 Kerberos 身分驗證) 選項 (僅支援 Password authentication (密碼身分驗證))

    • Additional configuration (其他組態) 中的 Database options (資料庫選項)

    • Performance Insights (績效詳情)

    • Log exports (日誌匯出)

    • Enable auto minor version upgrade (啟用自動次要版本升級)

    • 刪除保護

    支援 Backup retention period (備份保留期),但是您無法選擇 0 days (0 天)

  17. 選擇 Create database (建立資料庫)。

    View credential details (檢視憑證詳細資訊) 按鈕會顯示在 Databases (資料庫) 頁面上。

    若要檢視RDS自訂資料庫執行個體的主要使用者名稱和密碼,請選擇檢視憑證詳細資訊

    若要以主要使用者的身分連接至資料庫執行個體,請使用出現的使用者名稱和密碼。

    重要

    您無法再次檢視主要使用者密碼。如果您沒有記錄下來,您可能需要進行變更。若要在RDS自訂資料庫執行個體可用後變更主要使用者密碼,請修改資料庫執行個體。如需修改 資料庫執行個體的詳細資訊,請參閱管理 Amazon RDS Custom for SQL Server 資料庫執行個體

  18. 選擇資料庫以檢視RDS自訂資料庫執行個體清單。

  19. 選擇您剛建立的RDS自訂資料庫執行個體。

    在RDS主控台上,新RDS自訂資料庫執行個體的詳細資訊會顯示:

    • 資料庫執行個體在RDS建立自訂資料庫執行個體並準備好使用之前,都會建立 狀態。狀態變更為 Available (可用) 時,您便能連線至資料庫執行個體。視執行個體類別和分配的儲存空間而定,新的資料庫執行個體可能需要幾分鐘才能使用。

    • 角色具有執行個體 (RDS 自訂) 值。

    • RDS 自訂自動化模式具有 完整自動化 的值。此設定表示資料庫執行個體提供自動監控和執行個體復原。

您可以使用 create-db-instance AWS CLI 命令建立RDS自訂資料庫執行個體。

下列選項是必要的:

下列範例會建立名為 的 RDS Custom for SQL Server 資料庫執行個體my-custom-instance。備份保留期為 3 天。

注意

若要從自訂引擎版本 (CEV) 建立資料庫執行個體,請將現有CEV名稱提供給 --engine-version 參數。例如 --engine-version 15.00.4249.2.my_cevtest

用於 Linux, macOS、 或 Unix:

aws rds create-db-instance \ --engine custom-sqlserver-ee \ --engine-version 15.00.4073.23.v1 \ --db-instance-identifier my-custom-instance \ --db-instance-class db.m5.xlarge \ --allocated-storage 20 \ --db-subnet-group mydbsubnetgroup \ --master-username myuser \ --master-user-password mypassword \ --backup-retention-period 3 \ --no-multi-az \ --port 8200 \ --kms-key-id mykmskey \ --custom-iam-instance-profile AWSRDSCustomInstanceProfileForRdsCustomInstance

用於 Windows:

aws rds create-db-instance ^ --engine custom-sqlserver-ee ^ --engine-version 15.00.4073.23.v1 ^ --db-instance-identifier my-custom-instance ^ --db-instance-class db.m5.xlarge ^ --allocated-storage 20 ^ --db-subnet-group mydbsubnetgroup ^ --master-username myuser ^ --master-user-password mypassword ^ --backup-retention-period 3 ^ --no-multi-az ^ --port 8200 ^ --kms-key-id mykmskey ^ --custom-iam-instance-profile AWSRDSCustomInstanceProfileForRdsCustomInstance
注意

指定此處所顯示提示以外的密碼,作為安全最佳實務。

使用 describe-db-instances 命令取得執行個體的詳細資訊。

aws rds describe-db-instances --db-instance-identifier my-custom-instance

下列部分輸出顯示引擎、參數群組及其他資訊。

{ "DBInstances": [ { "PendingModifiedValues": {}, "Engine": "custom-sqlserver-ee", "MultiAZ": false, "DBSecurityGroups": [], "DBParameterGroups": [ { "DBParameterGroupName": "default.custom-sqlserver-ee-15", "ParameterApplyStatus": "in-sync" } ], "AutomationMode": "full", "DBInstanceIdentifier": "my-custom-instance", "TagList": [] } ] }