本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
建立 Babelfish for Aurora PostgreSQL DB 叢集
Aurora PostgreSQL 13.4 版及更新版本支援 Babelfish for Aurora PostgreSQL。
您可以使用 AWS Management Console 或 AWS CLI 來建立具有 Babelfish 的 Aurora PostgreSQL 叢集。
注意
在 Aurora PostgreSQL 叢集中,為 Babelfish 保留了 babelfish_db
資料庫名稱。若自行在 Babelfish for Aurora PostgreSQLh 上建立 "babelfish_db" 資料庫,可能會導致 Aurora 無法成功佈建 Babelfish。
使用 AWS Management Console建立執行 Babelfish 的叢集
-
開啟 Amazon RDS 主控台 (https://console.aws.amazon.com/rds/
),然後選擇 Create database (建立資料庫)。 -
針對 Choose a database creation method (選擇資料庫建立方法),請執行下列其中一個動作:
-
若要指定詳細的引擎選項,請選擇 Standard create (標準建立)。
-
若要使用預先設定的選項來支援 Aurora 叢集的最佳實務,請選擇 Easy create (輕鬆建立)。
-
-
針對引擎類型,請選擇 Aurora (PostgreSQL 相容)。
-
選擇 Show filters (顯示篩選條件),然後選擇 Show versions that support the Babelfish for PostgreSQL feature (顯示支援 Babelfish for PostgreSQL 功能的版本),以列出支援 Babelfish 的引擎類型。目前 Aurora PostgreSQL 13.4 版及更新版本支援 Babelfish。
-
針對 Available versions (可用的版本),選擇一個 Aurora PostgreSQL 版本。若要取得最新的 Babelfish 功能,請選擇最新的 Aurora PostgreSQL 主要版本。
-
針對 Templates (範本),選擇您的使用案例適合的範本。
-
針對 DB cluster identifier (資料庫叢集識別符),輸入稍後可以在資料庫叢集清單中輕鬆找到的名稱。
-
針對 Master username (主要使用者名稱),輸入管理員使用者名稱。Aurora PostgreSQL 的預設值為
postgres
。您可以接受預設名稱,或選擇不同的名稱。例如,若要遵循 SQL Server 資料庫上使用的命名慣例,您可以輸入sa
(系統管理員) 作為主要使用者名稱。如果現在不建立名為
sa
的使用者,稍後可以在您選擇的用戶端建立。建立使用者後,使用ALTER SERVER ROLE
命令將其新增至叢集的sysadmin
群組 (角色)。警告
主要使用者名稱必須始終使用小寫字元失敗,資料庫叢集無法透過 TDS 連接埠連接到 Babelfish。
-
針對 Master password (主要密碼),建立一個強式密碼並確認密碼。
-
對於下來一直到 Babelfish settings (Babelfish 設定) 區段為止的選項,指定資料庫叢集設定。如需每項設定的相關資訊,請參閱 Aurora 資料庫叢集的設定。
-
若要啟用 Babelfish 功能,請選取 Turn on Babelfish (開啟 Babelfish) 方塊。
-
針對 DB cluster parameter group (資料庫叢集參數群組),請執行下列其中一個動作:
-
選擇 Create new (新建),以建立啟用 Babelfish 的新參數群組。
-
選擇 Choose existing (選擇現有),以使用現有的參數群組。如果您使用現有群組,請務必在建立叢集之前修改群組,並新增 Babelfish 參數的值。如需 Babelfish 參數的資訊,請參閱Babelfish 的資料庫叢集參數群組設定。
如果您使用現有群組,請在後面的方塊中提供群組名稱。
-
-
針對 Database migration modee (資料庫遷移模式),選擇下列其中一項:
-
Single database (單一資料庫),以遷移單一 SQL Server 資料庫。
在某些情況下,多個使用者資料庫可能一起遷移,而您的最終目標是完整遷移至沒有 Babelfish 的原生 Aurora PostgreSQL。如果最終的應用程式需要合併的結構描述 (單一
dbo
結構描述),請務必先將 SQL Server 資料庫合併為單一 SQL Server 資料庫。然後使用 Single database (單一資料庫) 模式來遷移至 Babelfish。 -
Multiple databases (多個資料庫),以遷移多個 SQL Server 資料庫 (來自單一 SQL Server 安裝)。多資料庫模式不合併不是來自單一 SQL Server 安裝的多個資料庫。如需有關遷移多個資料庫的資訊,請參閱搭配單一資料庫或多個資料庫來使用 Babelfish。
注意
從 Aurora PostgreSQL 16 版本,預設會選擇多個資料庫做為資料庫遷移模式。
-
-
針對 Default collation locale (預設定序地區設定),輸入伺服器地區設定。預設值為
en-US
。如需定序的詳細資訊,請參閱 了解 Babelfish for Aurora Postgre 中的定序SQL。 -
針對 Collation name (定序名稱) 欄位,輸入預設定序。預設值為
sql_latin1_general_cp1_ci_as
。如需詳細資訊,請參閱 了解 Babelfish for Aurora Postgre 中的定序SQL。 -
針對 Babelfish TDS 連接埠,請輸入預設連接埠
1433
。目前,Babelfish 僅支援您資料庫叢集的連接埠1433
。 -
針對 DB parameter group (資料庫參數群組),選擇參數群組,或讓 Aurora 使用預設設定為您建立新的群組。
-
針對 Failover priority (容錯移轉優先順序),選擇執行個體的容錯移轉優先順序。如果不選擇值,則預設為
tier-1
。此優先順序決定從主要執行個體失敗中復原時提升複本所按照的順序。如需詳細資訊,請參閱Aurora 資料庫叢集的容錯能力。 -
針對 Backup retention period (備份保留期),選擇 Aurora 保留資料庫備份副本的時間長度 (1 到 35 天)。您可以使用備份副本對資料庫進行時間點復原 (PITR),可精確至秒。預設保留期間為七天。
-
選擇 Copy tags to snapshots (將標籤複製到快照),在建立快照時將任何資料庫執行個體標籤複製到資料庫快照。
注意
從快照還原資料庫叢集時,不會還原為 Babelfish for Aurora PostgreSQL 資料庫叢集。您需要開啟控制資料庫叢集參數群組中 Babelfish 偏好設定的參數,才能再次啟用 Babelfish。如需 Babelfish 參數的詳細資訊,請參閱Babelfish 的資料庫叢集參數群組設定。
-
選擇 Enable encryption (啟用加密),對此資料庫叢集啟用靜態加密 (Aurora 儲存加密)。
-
選擇 Enable Performance Insights (啟用績效詳情),以啟用 Amazon RDS 績效詳情。
-
選擇 Enable Enhanced monitoring (啟用增強型監控),以針對執行資料庫叢集的作業系統,開始即時收集指標。
-
選擇 PostgreSQL log (PostgreSQL 日誌),將日誌檔發佈到 Amazon CloudWatch Logs。
-
選擇 Enable auto minor version upgrade (啟用自動次要版本升級),在有次要版本升級可用時自動更新 Aurora 資料庫叢集。
-
針對 Maintenance window (維護時段),請執行下列動作:
-
若要選擇 Amazon RDS 進行修改或執行維護的時間,請選擇 Select window (選取時段)。
-
若要在非排定時間執行 Amazon RDS 維護,請選擇 No preference (無偏好設定)。
-
-
選取 Enable deletion protection (啟用刪除保護) 方塊,以防止意外刪除您的資料庫。
如果啟用此功能,則無法直接刪除資料庫。相反地,在刪除資料庫之後,您需要修改資料庫叢集並停用此功能。
-
選擇建立資料庫。
你可以在 Databases (資料庫) 清單中看到為 Babelfish 建立的新資料庫。部署完成時,Status (狀態) 欄會顯示 Available (可用)。

當您使用 建立 Babelfish for Aurora PostgreSQL 時 AWS CLI,您需要傳遞命令資料庫叢集參數群組的名稱,以用於叢集。如需詳細資訊,請參閱資料庫叢集先決條件。
使用 AWS CLI 建立具有 Babelfish 的 Aurora PostgreSQL 叢集之前,請執行下列動作:
-
從 Amazon Aurora 端點和配額上的服務清單中,選擇您的端點 URL。
-
建立叢集的參數群組。如需參數群組的詳細資訊,請參閱Amazon Aurora 的參數群組。
-
修改參數群組,新增參數來啟用 Babelfish。
使用 建立具有 Babelfish 的 Aurora PostgreSQL 資料庫叢集 AWS CLI
下列範例使用預設主要使用者名稱,postgres
。根據需要取代成以您為資料庫叢集建立的使用者名稱,例如 sa
,或者如果您不接受預設值,則取代成任何您選擇的使用者名稱。
-
建立參數群組。
對於 Linux、 macOS或 Unix:
aws rds create-db-cluster-parameter-group \ --endpoint-url
endpoint-url
\ --db-cluster-parameter-group-nameparameter-group
\ --db-parameter-group-familyaurora-postgresql14
\ --description"description"
在 Windows 中:
aws rds create-db-cluster-parameter-group ^ --endpoint-url
endpoint-URL
^ --db-cluster-parameter-group-nameparameter-group
^ --db-parameter-group-familyaurora-postgresql14
^ --description"description"
-
修改參數群組來啟用 Babelfish。
對於 Linux、 macOS或 Unix:
aws rds modify-db-cluster-parameter-group \ --endpoint-url
endpoint-url
\ --db-cluster-parameter-group-nameparameter-group
\ --parameters "ParameterName=rds.babelfish_status,ParameterValue=on,ApplyMethod=pending-reboot"在 Windows 中:
aws rds modify-db-cluster-parameter-group ^ --endpoint-url
endpoint-url
^ --db-cluster-parameter-group-nameparamater-group
^ --parameters "ParameterName=rds.babelfish_status,ParameterValue=on,ApplyMethod=pending-reboot" -
識別新資料庫叢集的資料庫子網路群組和 Virtual Private Cloud (VPC) 安全群組 ID,然後呼叫 create-db-cluster 命令。
對於 Linux、 macOS或 Unix:
aws rds create-db-cluster \ --db-cluster-identifier
cluster-name
\ --master-usernamepostgres
\ --manage-master-user-password \ --engine aurora-postgresql \ --engine-version14.3
\ --vpc-security-group-idssecurity-group
\ --db-subnet-group-namesubnet-group-name
\ --db-cluster-parameter-group-nameparameter-group
在 Windows 中:
aws rds create-db-cluster ^ --db-cluster-identifier
cluster-name
^ --master-usernamepostgres
^ --manage-master-user-password ^ --engine aurora-postgresql ^ --engine-version14.3
^ --vpc-security-group-idssecurity-group
^ --db-subnet-group-namesubnet-group
^ --db-cluster-parameter-group-nameparameter-group
此範例會指定
--manage-master-user-password
選項來產生主要使用者密碼,並在 Secrets Manager 中管理該密碼。如需詳細資訊,請參閱使用 Amazon Aurora 和 進行密碼管理 AWS Secrets Manager。或者,您可以使用--master-password
選項,自行指定和管理密碼。 -
明確為資料庫叢集建立主要執行個體。當您呼叫 create-db-instance 命令時,使用您在步驟 3 中為
--db-cluster-identifier
引數建立的叢集名稱,如下所示。對於 Linux、 macOS或 Unix:
aws rds create-db-instance \ --db-instance-identifier
instance-name
\ --db-instance-classdb.r6g
\ --db-subnet-group-namesubnet-group
\ --db-cluster-identifiercluster-name
\ --engine aurora-postgresql在 Windows 中:
aws rds create-db-instance ^ --db-instance-identifier
instance-name
^ --db-instance-classdb.r6g
^ --db-subnet-group-namesubnet-group
^ --db-cluster-identifiercluster-name
^ --engine aurora-postgresql