本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
建立並連線至 Amazon RDS Custom for SQL Server 的資料庫執行個體
您可以建立 RDS Custom 資料庫執行個體,然後使用 AWS Systems Manager 或遠端桌面通訊協定 (RDP) 與它連線。
重要
您必須完成 設定您的 Amazon RDS Custom for SQL Server 的環境 中的任務,才能建立或連線至 RDS Custom for SQL Server 資料庫執行個體。
當您建立 RDS Custom 資料庫執行個體時可以為它加上標籤,但是請勿建立或修改 RDS Custom 自動化所需的 AWSRDSCustom 標籤。如需更多詳細資訊,請參閱 標記 RDS Custom for SQL Server 資源。
第一次建立 RDS Custom for SQL Server 資料庫執行個體時,您可能會收到下列錯誤:服務連結角色正在建立的程序中。請稍後再試。如果收到這個訊息,請等待幾分鐘的時間然後再次嘗試建立資料庫執行個體。
主題
建立 RDS Custom for SQL Server 資料庫執行個體
使用 AWS Management Console 或 AWS CLI 建立 Amazon RDS Custom for SQL Server 資料庫執行個體。該程序與建立 Amazon RDS 資料庫執行個體的程序類型。
如需更多詳細資訊,請參閱 建立 Amazon RDS 資料庫執行個體。
若要建立 RDS Custom for SQL Server 資料庫執行個體
登入 AWS Management Console,開啟位於 https://console.aws.amazon.com/rds/
的 Amazon RDS 主控台。 -
在導覽窗格中,選擇 Databases (資料庫)。
-
選擇 Create database (建立資料庫)。
-
選擇 Standard Create (標準建立) 做為資料庫建立方法。
-
針對 Engine options (引擎選項),選擇 Microsoft SQL Server 做為引擎類型。
-
針對 Database management type (引擎管理類型),選擇 Amazon RDS Custom。
-
在 Edition (版本) 區段中,選擇您想要使用的資料庫引擎版本。
-
(選用) 如果您想要從 CEV 建立資料庫執行個體,請核取 Use custom engine version (CEV) (使用自訂引擎版本 (CEV)) 核取方塊。在下拉式清單中選取您的 CEV。
-
針對資料庫版本,保留 SQL Server 2019 預設值。
-
在 Templates (範本) 中,選擇 Production (生產)。
-
在 Settings (設定) 區段中,為 DB instance identifier (資料庫執行個體識別符) 輸入唯一的名稱。
-
若要輸入您的主要密碼,請執行以下動作:
-
在 Settings (設定) 區段,開啟 Credential Settings (登入資料設定)。
-
清除 Auto generate a password (自動產生密碼) 核取方塊。
-
變更 Master username (主要使用者名稱) 值並在 Master password (主要密碼) 和 Confirm password (確認密碼) 中輸入相同的密碼。
根據預設,新 RDS Custom 資料庫執行個體會將自動產生的密碼用於主要使用者。
-
-
在 DB instance size (資料庫執行個體大小) 區段中,為 DB instance class (資料庫執行個體類別) 選擇值。
如需支援的類別,請參閱 RDS Custom for SQL Server 的資料庫執行個體類別支援。
-
選擇 Storage (儲存) 設定。
-
針對 RDS Custom security (RDS Custom 安全),請執行下列操作:
-
針對 IAM 執行個體設定檔,您有兩個選項可為您的 RDS Custom for SQL Server 資料庫執行個體選擇執行個體設定檔。
-
選擇建立新的執行個體描述檔,並提供執行個體描述檔名稱尾碼。如需更多詳細資訊,請參閱 使用 自動建立執行個體描述檔 AWS Management Console。
-
選擇現有的執行個體設定檔。從下拉式清單中,選擇開頭為
AWSRDSCustom的執行個體設定檔。
-
-
針對 Encryption (加密),選擇 Enter a key ARN (輸入金鑰 ARN) 以列出可用的 AWS KMS 金鑰。然後從清單選擇您的金鑰。
RDS Custom 需要 AWS KMS 金鑰。如需更多詳細資訊,請參閱 請確定您擁有對稱加密 AWS KMS 金鑰。
-
-
在其餘區段,指定您偏好的 RDS Custom 資料庫執行個體的設定。如需每項設定的相關資訊,請參閱 資料庫執行個體的設定。以下設定不會出現在主控台中,也不受支援:
-
處理器功能
-
儲存體自動調整規模
-
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 天)。
-
-
選擇 Create database (建立資料庫)。
View credential details (檢視憑證詳細資訊) 按鈕會顯示在 Databases (資料庫) 頁面上。
若要檢視 RDS Custom 資料庫執行個體的主要使用者名稱和密碼,請選擇 View credential details (檢視憑證詳細資訊)。
若要以主要使用者的身分連線至資料庫執行個體,請使用出現的使用者名稱和密碼。
重要
您無法再次檢視主要使用者密碼。如果您沒有記錄下來,您可能需要進行變更。若要在 RDS Custom 資料庫執行個體可供使用後變更主要使用者密碼,請修改資料庫執行個體。如需修改 資料庫執行個體的詳細資訊,請參閱管理 Amazon RDS Custom for SQL Server 資料庫執行個體。
-
選擇 Databases (資料庫) 以檢視 RDS Custom 資料庫執行個體的清單。
-
選擇您剛剛建立的 RDS Custom 資料庫執行個體。
在 RDS 主控台上,新 RDS Custom 資料庫執行個體的詳細資訊即會出現:
-
在 RDS Custom 資料庫執行個體建立完成且可供使用之前,資料庫執行個體會處於 Creating (建立中) 狀態。狀態變更為 Available (可用) 時,您便能連線至資料庫執行個體。視執行個體類別和分配的儲存空間而定,新的資料庫執行個體可能需要幾分鐘才能使用。
-
Role (角色) 具有 Instance (RDS Custom) (執行個體 (RDS Custom)) 值。
-
RDS Custom automation mode (RDS Custom 自動化模式) 具有 Full automation (全自動化) 值。此設定表示資料庫執行個體提供自動監控和執行個體復原。
-
您可以使用 create-db-instance AWS CLI 命令來建立 RDS Custom 資料庫執行個體。
下列選項是必要的:
-
--db-instance-identifier -
--db-instance-class(如需支援執行個體類別的清單,請參閱 RDS Custom for SQL Server 的資料庫執行個體類別支援) -
--engine(custom-sqlserver-ee、custom-sqlserver-se或custom-sqlserver-web) -
--kms-key-id -
--custom-iam-instance-profile
下列範例會建立名稱為 my-custom-instance 的 RDS Custom for SQL Server 資料庫執行個體。備份保留期為 3 天。
注意
若要從自訂引擎版本 (CEV) 建立資料庫執行個體,請將現有的 CEV 名稱提供給 --engine-version 參數。例如 --engine-version 15.00.4249.2.my_cevtest
在 Linux、macOS 或 Unix 中:
aws rds create-db-instance \ --enginecustom-sqlserver-ee\ --engine-version15.00.4073.23.v1\ --db-instance-identifiermy-custom-instance\ --db-instance-classdb.m5.xlarge\ --allocated-storage20\ --db-subnet-groupmydbsubnetgroup\ --master-usernamemyuser\ --master-user-passwordmypassword\ --backup-retention-period3\ --no-multi-az \ --port8200\ --kms-key-idmykmskey\ --custom-iam-instance-profileAWSRDSCustomInstanceProfileForRdsCustomInstance
在 Windows 中:
aws rds create-db-instance ^ --enginecustom-sqlserver-ee^ --engine-version15.00.4073.23.v1^ --db-instance-identifiermy-custom-instance^ --db-instance-classdb.m5.xlarge^ --allocated-storage20^ --db-subnet-groupmydbsubnetgroup^ --master-usernamemyuser^ --master-user-passwordmypassword^ --backup-retention-period3^ --no-multi-az ^ --port8200^ --kms-key-idmykmskey^ --custom-iam-instance-profileAWSRDSCustomInstanceProfileForRdsCustomInstance
注意
指定此處所顯示提示以外的密碼,作為安全最佳實務。
使用 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": [] } ] }