Use the PolarDB console to create databases, delete databases, and change the database owner in a PolarDB for Oracle or PolarDB for PostgreSQL (Compatible with Oracle) cluster.
Prerequisites
Before you begin, make sure that you have:
A PolarDB for Oracle or PolarDB for PostgreSQL (Compatible with Oracle) cluster
Access to the PolarDB console
Create a database
In the PolarDB console, go to the target cluster. In the left navigation pane, choose Settings and Management > Databases.
Click Create Database, configure the following parameters, and then click OK.
| Parameter | Description |
|---|---|
| Database Name | The name of the database. The name must start with a letter and end with a letter or digit, be 2–64 characters long, and consist of lowercase letters, digits, hyphens (-), or underscores (_). |
| Database Owner | The account that owns the database and has full permissions on it. Leave this field blank to assign an owner later. |
| Character Set | The character encoding for the database. Defaults to UTF8. Select a different encoding from the drop-down list if needed. |
| Collation | The string sort order. Defaults to C. Select en_US.utf8 to support a wider range of languages. |
| Ctype | The character classification. Set automatically based on the selected collation. |
| Description | An optional description to help you identify the database. Must be 2–256 characters and consist of letters, Chinese characters, digits, underscores (_), or hyphens (-). Cannot start with http:// or https://. |
Keep the following in mind when naming a database:
The name must be unique within the cluster.
The name cannot be changed after the database is created. Choose the name carefully.
Avoid reserved keywords. For example, test is not allowed.Delete a database
Deleting a database is a permanent action. All data in the database is purged and can no longer be accessed. Perform this operation with caution.
In the PolarDB console, go to the target cluster. In the left navigation pane, choose Settings and Management > Databases.
Locate the target database, click Delete in the Actions column, and then click OK to confirm.
Change the database owner
In the PolarDB console, go to the target cluster. In the left navigation pane, choose Settings and Management > Databases.
Locate the target database and click Change Owner in the Actions column.
In the Change Owner dialog box, select the new owner and click OK.
API reference
| API | Description |
|---|---|
| CreateDatabase | Creates a database in a PolarDB cluster. |
| DeleteDatabase | Deletes a database from a PolarDB cluster. |
| DescribeDatabases | Queries the details of a specified database in a PolarDB cluster. |