Overview
Displays all created DBLinks under the current tenant.
Columns
field |
Type |
Is NULL |
Description |
|---|---|---|---|
| OWNER | varchar(128) | NO | Username for creating the DBLINK |
| DB_LINK | varchar(128) | NO | DBLINK Name |
| USERNAME | varchar(128) | NO | Username for DBLINK to connect to the remote database |
| CREDENTIAL_NAME | varchar(128) | NO | The name of the credentials used to connect to the remote database. This parameter is for compatibility only. |
| CREDENTIAL_OWNER | varchar(128) | NO | Owner of the credentials used to connect to the remote database, for compatibility only. |
| HOST | text | YES | Host name (IP address) of the remote database to which you want to connect through DBLINK. |
| CREATED | datetime | NO | Time of creating DBLINK |
| HIDDEN | varchar(3) | NO | Internal field, used only for compatibility |
| SHARD_INTERNAL | varchar(3) | NO | Used to indicate whether DBLINK supports shared connections, which helps reduce the number of connections between the local database and remote databases. This parameter is for compatibility only. |
| VALID | varchar(3) | NO | Indicates whether DBLINK is available. This parameter is for compatibility only and defaults to YES. |
| INTRA_CDB | varchar(3) | NO | Internal field, used only for compatibility |
| TENANT_NAME | varchar(128) | NO | Tenant name used by DBLINK to connect to the remote database |
| DATABASE_NAME | varchar(128) | YES | Connect to a specified remote database using DBLINK |
| REVERSE_TENANT_NAME | varchar(128) | YES | Tenant name for reverse DBLINK connection to local database |
| CLUSTER_NAME | varchar(128) | YES | The cluster name used by the DBLINK to connect to the remote database. |
| REVERSE_CLUSTER_NAME | varchar(128) | YES | Cluster name for reverse DBLINK connection to the local database |
| REVERSE_HOST | text | YES | Host name (IP address) of the local database for reverse DBLINK connection |
| REVERSE_PORT | bigint(20) | YES | Port number for reverse DBLINK connection to local database |
| REVERSE_USERNAME | VARCHAR2(128) | YES | Username for reverse DBLINK connection to local database |
Sample query
The system tenant can view the DBLinks created under itself.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_DB_LINKS;
The query result is as follows:
+--------+-----------+----------+-----------------+------------------+---------------------+---------------------+--------+----------------+-------+-----------+-------------+---------------+---------------------+--------------+----------------------+--------------+--------------+
| OWNER | DB_LINK | USERNAME | CREDENTIAL_NAME | CREDENTIAL_OWNER | HOST | CREATED | HIDDEN | SHARD_INTERNAL | VALID | INTRA_CDB | TENANT_NAME | DATABASE_NAME | REVERSE_TENANT_NAME | CLUSTER_NAME | REVERSE_CLUSTER_NAME | REVERSE_HOST | REVERSE_PORT |
+--------+-----------+----------+-----------------+------------------+---------------------+---------------------+--------+----------------+-------+-----------+-------------+---------------+---------------------+--------------+----------------------+--------------+--------------+
| root | ob_dblink | test | | | xx.xx.xx.xx:2881 | 2024-01-25 13:40:35 | | | YES | | sys | mydb | | | | 0.0.0.0 | 0 |
+--------+-----------+----------+-----------------+------------------+---------------------+---------------------+--------+----------------+-------+-----------+-------------+---------------+---------------------+--------------+----------------------+--------------+--------------+
1 row in set