This topic describes how to use DMS and a client to connect to a PolarDB cluster compatible with Oracle.

Use DMS to connect to a PolarDB cluster compatible with Oracle

Data Management (DMS) provides an integrated solution for data management. DMS supports data management, schema management, access control, BI charts, trend analysis, data tracing, performance optimization, and server management. DMS supports relational databases such as MySQL, SQL Server, and PostgreSQL, as well as NoSQL databases such as MongoDB and Redis. DMS also supports the management of Linux servers.

Prerequisites:

You have created a privileged account or a standard account for an existing database cluster. For more information, see Create a database account.

Procedure:

  1. Log on to the ApsaraDB for PolarDB console.
  2. Find the target cluster and click the cluster ID to go to the Overview page.基本信息
  3. In the upper corner of the page, click Log On to Database to go to the Database Logon page.登录
  4. On the Database Logon page, enter the primary endpoint and the port number, and separate them with a colon (:). Then enter the username and password of the privileged or standard account, and click Log On.
    Note When connecting to a cluster through DMS, you can only use the primary endpoint. Cluster endpoints are not supported. For more information about how to view the endpoint, see View endpoints.

Use a client to connect to a PolarDB cluster compatible with Oracle

You can also use the pgAdmin 4 client to connect to a PolarDB cluster compatible with Oracle. PolarDB compatible with Oracle does not support configuring a whitelist for a cluster. Only instances that are in the same VPC can access the cluster. Therefore, the server where the client resides and the PolarDB cluster compatible with Oracle must be in the same VPC.

  1. Start the pgAdmin 4 client.
  2. Right-click Servers and choose Create > Server from the shortcut menu, as shown in the following figure. 创建服务器
  3. On the General tab of the Create - Server dialog box, enter the name of the server, as shown in the following figure. 输入服务器名称
  4. Click the Connection tab and enter the information of the destination instance, as shown in the following figure. 输入实例信息

    Parameter description:

    • Hostname/address: the internal endpoint of the PolarDB cluster compatible with Oracle. To view the endpoint and port information of the PolarDB cluster compatible with Oracle, follow these steps:

      1. Log on to the ApsaraDB for PolarDB console.
      2. Find the target cluster and click the cluster ID.
      3. In the Connection Information section, view the endpoint and port information.
    • Port: the internal port of the PolarDB cluster compatible with Oracle.
    • Username: the name of the privileged account of the PolarDB cluster compatible with Oracle.
    • Password: the password of the privileged account of the PolarDB cluster compatible with Oracle.
  5. Click Save.
  6. If the connection information is correct, choose Servers > Server Name > Databases > postgres. The connection is successful if the following interface is displayed.
    Note postgres is the default system database of the PolarDB compatible with Oracle. Do not perform any operation on the database.
    连接成功

Use the CLI to connect to a PolarDB cluster compatible with Oracle

Additionally, you can run commands on clients to connect to a PolarDB cluster compatible with Oracle. For more information about how to download and install the clients, see Download clients and drivers.