# rds-management

Part of **RDS**

# ApsaraDB RDS Database Management Console Guide

## Operations Overview

| Operation | Console Entry | Prerequisites | Description |
|----------|---------------|---------------|-------------|
| Create or Delete Database | Console > RDS > Databases | RDS MariaDB instance created | Create a new database with name, character set, and authorized accounts, or delete an existing one. |
| Execute SQL Query | Console > ApsaraDB RDS > Instances > Select Instance > SQL Explorer | Active RDS instance, RAM permissions, network access | Run ad-hoc SQL queries directly in the web-based SQL Explorer interface. |
| Analyze Deadlock | Console > Database Autonomy Service (DAS) > Lock Analysis | RDS for MySQL or PolarDB for MySQL instance, DAS enabled | View and analyze recent deadlocks using DAS lock analysis tools. |
| Update Ganos Extensions | Console > RDS > Instances > Select Instance > Database Management > Extensions | RDS for PostgreSQL instance with GanosBase installed, CLI access | Manually update GanosBase and PostGIS extensions via SQL commands. |
| Connect with Babelfish | Console > Database Services > ApsaraDB RDS > Instances > Select Instance > Connection Settings | RDS for PostgreSQL instance with Babelfish enabled, network access, client tool | Retrieve connection endpoint and port to connect T-SQL compatible clients. |
| Use Clients with Babelfish | Console > RDS > Instances > Connect to Instance | RDS instance with Babelfish enabled, IP whitelist, endpoint/TDS port | Configure SSMS or Data Studio to connect over TDS port 1433. |
| Perform Cross-Database Queries | Console > RDS > Instances > Connect to Instance > Database Console | RDS for PostgreSQL v11+, high-privilege account, remote instance details | Set up postgres_fdw or dblink for querying across databases via SQL. |
| Diagnose Database Issues | Console > ApsaraDB RDS > Instances > Diagnostics | Access to RDS console, valid credentials, running instance | Run health checks and view diagnostic reports for performance issues. |
| Enable Event Subscription | Console > RDS > Autonomous Service > Diagnosis & Optimization > Self-Governance Center | RDS for MySQL instance created, console access | Configure notifications for database events by severity and contact method. |
| Optimize Query Performance | Console > RDS > Instances > Select Instance > Plug-ins > Extension Management | RDS PostgreSQL 10+, privileged account, specific minor engine version | Install and use performance extensions like HypoPG, pg_hint_plan, pg_profile, etc. |

## Operation Steps

### Create or Delete Database

**Navigation**: Console > RDS > Databases

**Prerequisites**:
- Create an RDS MariaDB instance

1. Click the **Databases** section in the left navigation pane
   - Element: **Databases** (menu) — left navigation panel

2. To create a database, click the **Create Database** button
   - Element: **Create Database** (button) — main content area

3. Fill in the database configuration form
   - Element: **Database (DB) Name** (text_input) — form fields
   - Notes: Name must be 2–64 characters, start with a letter, end with letter/digit, and contain only lowercase letters, digits, underscores, and hyphens.

4. Click the **Create** button to finalize
   - Element: **Create** (button) — bottom of form

5. To delete a database, find it in the list and click **Delete** in the Operations column
   - Element: **Delete** (button) — Operations column
   - Notes: For China region, complete validation before clicking OK in the confirmation dialog.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Database (DB) Name | text_input | Yes | — | Must be 2–64 chars, start with letter, end with letter/digit, contain only [a-z0-9_-]. Unique per instance. |
| Supported Character Set | dropdown | No | — | Select a character set as needed for the database. |
| Authorized Account | dropdown | No | — | Select standard accounts that need access. Privileged accounts have all permissions by default. |
| Remarks | text_input | No | — | Optional remarks (max 256 chars) for future management. |

### Execute SQL Query

**Navigation**: Console > ApsaraDB RDS > Instances > Select Instance > SQL Explorer

**Prerequisites**:
- An active ApsaraDB RDS instance
- Valid RAM permissions to access the instance
- Network connectivity to the RDS instance

1. Navigate to the ApsaraDB RDS console
   - Element: **ApsaraDB RDS** (link) — left navigation panel

2. Select the target RDS instance from the instance list
   - Element: **Instance ID or DB Instance Name** (link) — main content area

3. Click on the **SQL Explorer** tab in the instance details page
   - Element: **SQL Explorer** (tab) — top navigation bar of instance details

4. Enter the SQL query in the text input box
   - Element: **Query Input Box** (text_input) — center of the page
   - Notes: Supports standard SQL syntax with syntax highlighting and auto-completion.

5. Click the **Execute** button to run the query
   - Element: **Execute** (button) — bottom-right corner of the query editor
   - Notes: Results appear in a table below the input area.

### Analyze Deadlock

**Navigation**: Console > Database Autonomy Service (DAS) > Lock Analysis

**Prerequisites**:
- ApsaraDB RDS for MySQL or PolarDB for MySQL instance
- DAS service enabled for the instance

1. Navigate to the DAS console
   - Element: **Database Autonomy Service (DAS)** (link) — left navigation panel

2. Click on the **Lock Analysis** tab
   - Element: **Lock Analysis** (tab) — main content area

3. Select a time period for deadlock analysis
   - Element: **Time Period** (dropdown) — top-right corner
   - Notes: Time period can be set to minute or second accuracy.

### Update Ganos Extensions

**Navigation**: Console > RDS > Instances > Select Instance > Database Management > Extensions

**Prerequisites**:
- An ApsaraDB RDS for PostgreSQL instance with GanosBase installed
- Access to the PostgreSQL CLI to connect to the instance

1. Log on to the database using a SQL client or database console
   - Element: **Log on to the database** (button) — top-right corner of the instance details page
   - Notes: Ensure correct credentials and network access.

2. Run the SQL command to check available updates
   - Element: **Run SQL** (button) — main content area
   - Notes: Use `SELECT * FROM pg_available_extensions WHERE name = 'ganos';` to verify versions.

3. Execute the appropriate update function based on version
   - Element: **Run SQL** (button) — main content area
   - Notes: Use `SELECT ganos_update();` for GanosBase or `SELECT PostGIS_Extensions_Upgrade();` for PostGIS.

### Connect with Babelfish

**Navigation**: Console > Database Services > ApsaraDB RDS > Instances > Select Instance > Connection Settings

**Prerequisites**:
- An ApsaraDB RDS for PostgreSQL instance with Babelfish enabled
- Network access from the client machine (VPC or public IP configured)
- Database client tool installed (e.g., pgAdmin, psql, DBeaver)

1. Navigate to the ApsaraDB RDS console and select your PostgreSQL instance
   - Element: **Instances** (link) — left navigation panel

2. Click on the instance ID to open its details page
   - Element: **Instance ID** (link) — instance list

3. Go to the **Connection Settings** tab
   - Element: **Connection Settings** (tab) — top navigation bar of instance details

4. Copy the connection endpoint and port number
   - Element: **Endpoint** (text_input) — Connection Information section
   - Notes: Endpoint format: rds-xxxxx.postgres.rds.aliyuncs.com:5432

5. Use a database client tool to connect using the copied endpoint and credentials
   - Element: **Connect** (button) — bottom of the connection form in the client tool
   - Notes: Use 'postgres' as the database name if connecting to the default DB.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Endpoint | text_input | Yes | — | Network address of the RDS instance (e.g., rds-xxxxx.postgres.rds.aliyuncs.com) |
| Port | number_input | Yes | — | Port number (default 5432 for PostgreSQL) |
| Database | dropdown | No | postgres, template1, your_custom_db | Database name to connect to; defaults to 'postgres' |
| Username | text_input | Yes | — | Database user account with appropriate permissions |
| Password | text_input | Yes | — | Password for the specified database user |

### Use Clients with Babelfish

**Navigation**: Console > RDS > Instances > Connect to Instance

**Prerequisites**:
- An RDS instance with Babelfish enabled
- A Babelfish account
- An IP address whitelist configured to allow your client host
- The endpoint and TDS port of the RDS instance

1. Open SSMS. In the menu bar, choose **File > New > Database Engine Query**
   - Element: **File &gt; New &gt; Database Engine Query** (menu) — menu bar
   - Notes: Do not use Object Explorer to create the connection—it triggers a 'Specified case is not valid' error.

2. Configure the connection parameters and click **Connect**
   - Element: **Connect** (button) — connection dialog
   - Notes: Server name must be Endpoint,Port (e.g., pgm-****.pg.rds.aliyuncs.com,1433). Use SQL Server Authentication.

3. Open Data Studio and click **Create a connection**
   - Element: **Create a connection** (button) — main interface
   - Notes: Use Microsoft SQL Server as the connection type.

4. Configure the connection parameters and click **Connect**
   - Element: **Connect** (button) — connection dialog
   - Notes: Server field must contain Endpoint,Port. Use SQL Login authentication.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Server type | dropdown | Yes | Database Engine | Fixed value; must be Database Engine |
| Server name | text_input | Yes | — | Endpoint and TDS port in format Endpoint,Port |
| Authentication | dropdown | Yes | SQL Server Authentication | Fixed value; must be SQL Server Authentication |
| Login | text_input | Yes | — | Username of the Babelfish account |
| Password | text_input | Yes | — | Password of the Babelfish account |
| Connection type | dropdown | Yes | Microsoft SQL Server | Fixed value; must be Microsoft SQL Server |
| Server | text_input | Yes | — | Endpoint and TDS port in format Endpoint,Port |
| Authentication type | dropdown | Yes | SQL Login | Fixed value; must be SQL Login |
| User name | text_input | Yes | — | Username of the Babelfish account |
| Password | text_input | Yes | — | Password of the Babelfish account |
| Encrypt | checkbox | No | False | Optional; default is False |

### Perform Cross-Database Queries

**Navigation**: RDS > Instances > Connect to Instance > Database Console

**Prerequisites**:
- RDS for PostgreSQL version 11
- High-privilege account or console-created account
- Target database instance details (internal endpoint, port, username, password)
- Snapshot or log backup recommended for data safety

1. Log on to the RDS instance
 - Element: **** (button) — console homepage login entry
   - Notes: Use a high-privilege account or console-created account.

2. Run SQL to install the postgres_fdw extension
 - Element: **SQL ** (text_input) — instance details SQL execution area
   - Notes: Execute `create extension postgres_fdw;`

3. Run SQL to create a remote server
 - Element: **SQL ** (text_input) — instance details SQL execution area
   - Notes: Replace placeholders [$Server_Name], [$Host_Name], [$Port], [$DB] with actual values.

4. Run SQL to create a user mapping
 - Element: **SQL ** (text_input) — instance details SQL execution area
   - Notes: Replace placeholders [$Local_User], [$Server_Name], [$User], [Password] with actual values.

5. Run SQL to create an external table
 - Element: **SQL ** (text_input) — instance details SQL execution area
   - Notes: Replace [$Table_Name] with actual table name; ensure field definitions match the remote table.

6. Run SQL to execute the cross-database query
 - Element: **SQL ** (text_input) — instance details SQL execution area
   - Notes: Execute `select * from [$Table_Name];` to view results.

### Diagnose Database Issues

**Navigation**: Console > ApsaraDB RDS > Instances > Diagnostics

**Prerequisites**:
- Access to the ApsaraDB RDS console
- Valid credentials with appropriate permissions
- An active RDS instance

1. Navigate to the Diagnostics page from the RDS console
   - Element: **Diagnostics** (link) — left navigation panel

2. Select the target RDS instance from the instance list
   - Element: **Instance List** (dropdown) — main content area
   - Notes: Ensure the instance is running before proceeding.

3. Click the **Run Diagnostic** button to start the health check
   - Element: **Run Diagnostic** (button) — top-right corner
   - Notes: The process may take several minutes depending on instance size and load.

### Enable Event Subscription

**Navigation**: Console > RDS > Autonomous Service > Diagnosis & Optimization > Self-Governance Center

**Prerequisites**:
- ApsaraDB RDS for MySQL instance already created
- Access to the Alibaba Cloud console with appropriate permissions

1. Navigate to the **Autonomous Service** section
   - Element: **Autonomous Service** (menu) — left-side navigation panel

2. Select the **Diagnosis & Optimization** tab
   - Element: **Diagnosis & Optimization** (tab) — main content area

3. Click the **Self-Governance Center** tab
   - Element: **Self-Governance Center** (tab) — top of the page

4. Click the **Enable Subscription Service** button
   - Element: **Enable Subscription Service** (button) — top-right corner

5. Turn on **Enable Subscription Service**
   - Element: **Enable Subscription Service** (toggle) — Event Subscription Settings tab

6. Set urgency level for notifications
   - Element: **Urgency** (dropdown) — form fields
   - Notes: Valid values: Critical, Warning, Optimize, Notification

7. Select contacts or contact groups
   - Element: **Existing Contacts/Contact Groups** (checkbox) — left panel
   - Notes: Click the arrow icon to move selected contacts to the right section.

8. Choose notification method
   - Element: **Notification Method** (dropdown) — form fields
   - Notes: Supported: SMS, Webhook, SMS + Webhook, SMS + Email. Webhook supports DingTalk, Enterprise WeChat, Lark, ARMS.

9. Set notification language
   - Element: **Notification Language** (dropdown) — form fields
   - Notes: Only Chinese is supported.

10. Set minimum notification interval
    - Element: **Minimum Notification Interval** (text_input) — form fields
    - Notes: Defines minimum time between repeated notifications for the same event.

11. Click **OK** to save settings
    - Element: **OK** (button) — bottom of the form

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Urgency | dropdown | Yes | Critical, Warning, Optimize, Notification | Lowest severity level for notifications |
| Select Contacts/Contact Groups | checkbox | No | — | Contacts/groups to receive notifications |
| Notification Method | dropdown | Yes | SMS, Webhook, SMS + Webhook, SMS + Email | Method for sending notifications |
| Notification Language | dropdown | Yes | Chinese | Language for notifications (Chinese only) |
| Minimum Notification Interval | text_input | No | — | Minimum time between repeated notifications for same event |

### Optimize Query Performance

**Navigation**: Console > RDS > Instances > Select Instance > Plug-ins > Extension Management

**Prerequisites**:
- RDS PostgreSQL 10 or later instance
- Privileged account on the instance
- For RDS PostgreSQL 17: minor engine version 20241030 or later

1. Go to the RDS instance list and select a region
   - Element: **RDS instance list** (link) — top navigation panel

2. Click the instance ID to open its details page
   - Element: **instance ID** (link) — instance list

3. In the left navigation pane, click **Plug-ins**
   - Element: **Plug-ins** (menu) — left navigation panel

4. On the Extension Management page, click the **Uninstalled Extensions** tab
   - Element: **Uninstalled Extensions** (tab) — top of the page

5. Search for the desired extension (e.g., pg_hint_plan) and click **Install** in the Actions column
   - Element: **Install** (button) — Actions column

6. In the dialog box, select the target database and a privileged account, then click **OK**
   - Element: **OK** (button) — dialog box

7. To use the extension, connect via SQL Console and run relevant commands
   - Element: **SQL Console** (text_input) — main content area
   - Notes: Example for HypoPG: `SELECT hypopg_create_index('CREATE INDEX ON table(column)');`

## FAQ

Q: Where do I find the SQL Explorer feature in the RDS console?
A: Navigate to Console > ApsaraDB RDS > Instances, select your instance, and click the "SQL Explorer" tab in the instance details page.

Q: What permissions do I need to create a database in RDS MariaDB?
A: You need an RDS MariaDB instance and sufficient privileges to access the Databases section in the console. Standard accounts can be authorized during creation, but only privileged accounts can manage all databases.

Q: Can I modify database parameters after creation?
A: Yes, you can modify certain parameters through the Parameters section in the instance details page, but some changes require a restart. Always check parameter descriptions for modification constraints.

Q: How do I connect to a Babelfish-enabled PostgreSQL instance using SSMS?
A: Use "File > New > Database Engine Query" (not Object Explorer), set Server name to "Endpoint,1433", and use SQL Server Authentication with your Babelfish account credentials.

Q: Why can't I install certain PostgreSQL extensions in RDS?
A: Some extensions are restricted due to security reviews on specific minor engine versions. Check the "Restrictions on extension creation" documentation and consider upgrading your instance's minor version if needed.

## Pricing & Billing

### Billing Model
Most console operations (database creation/deletion, SQL execution, diagnostics, event subscription) are included with your RDS instance pricing and do not incur additional charges. Extensions like HypoPG, pg_hint_plan, and UUID generators are also free to use. However, the underlying RDS instance is billed per hour based on its specifications.

### Free Tier
- SQL Explorer: Available at no additional cost with all RDS instances.
- Lock Analysis: Free for supported RDS for MySQL instances with DAS enabled.
- Diagnostic Reports: Free for RDS High-availability and Cluster Editions.
- Event Subscription: Provided at no additional charge.
- Most PostgreSQL extensions (HypoPG, pg_hint_plan, UUID-OSSP, etc.): No extra cost beyond standard RDS pricing.

### Quota Limits
- Databases per instance: Up to 100 databases per RDS MariaDB instance.
- Concurrent connections: Varies by instance type (e.g., up to 100 for some PostgreSQL instances, up to 10000 for others).
- Diagnostic tasks: Up to 10 per hour per instance for some diagnostic features.
- Inspection time range: Maximum 7 days for RDS AI Assistant inspections.

### Billing Notes
- Billing starts when the instance is created and stops when released.
- Charges apply based on instance type, storage, and duration (minimum 1 hour for some editions).
- Cross-database queries and extension usage do not add extra fees but may increase instance load.
- RDS AI Assistant Professional Edition features (batch/scheduled inspection) require a subscription.