Note
This view is available starting with V4.1.0.
Purpose
This view displays all DBLinks accessible to the current user.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| OWNER | VARCHAR2(128) | NO | The username of the user who created the DBLink. |
| DB_LINK | VARCHAR2(128) | NO | The name of the DBLink. |
| USERNAME | VARCHAR2(128) | NO | The username used to connect to the remote database. |
| CREDENTIAL_NAME | VARCHAR2(128) | NO | The name of the credentials used to connect to the remote database. This parameter is for compatibility. |
| CREDENTIAL_OWNER | VARCHAR2(128) | NO | The owner of the credentials used to connect to the remote database. This parameter is for compatibility. |
| HOST | VARCHAR2(2000) | NO | The host name (IP address) used to connect to the remote database. |
| CREATED | DATE | NO | The time when the DBLink was created. |
| HIDDEN | VARCHAR2(3) | NO | Internal use only. This parameter is for compatibility. |
| SHARD_INTERNAL | VARCHAR2(3) | NO | Indicates whether the DBLink supports shared connections. This parameter is for compatibility. |
| VALID | VARCHAR2(3) | NO | Indicates whether the DBLink is available. This parameter is for compatibility. The default value is YES. |
| INTRA_CDB | VARCHAR2(3) | NO | Internal use only. This parameter is for compatibility. |
| TENANT_NAME | VARCHAR2(128) | NO | The name of the tenant used to connect to the remote database. |
| REVERSE_TENANT_NAME | VARCHAR2(128) | YES | The name of the tenant used to connect to the local database. |
| CLUSTER_NAME | VARCHAR2(128) | YES | The name of the cluster used to connect to the remote database. |
| REVERSE_CLUSTER_NAME | VARCHAR2(128) | YES | The name of the cluster used to connect to the local database. |
| REVERSE_HOST | VARCHAR2(46) | YES | The host name (IP address) used to connect to the local database. |
| REVERSE_PORT | NUMBER(38) | YES | The port number used to connect to the local database. |
| REVERSE_USERNAME | VARCHAR2(128) | YES | The username used to connect to the local database. |
Sample query
Query all DBLinks accessible to the current user.
obclient [SYS]> SELECT * FROM SYS.ALL_DB_LINKS;
The query result is as follows:
+----------+-----------+----------+----------+-----------------+------------------+---------------------+-----------+--------+----------------+-------+-----------+-------------+---------------------+--------------+----------------------+--------------+--------------+------------------+
| OWNER | DB_LINK | USERNAME | PASSWORD | CREDENTIAL_NAME | CREDENTIAL_OWNER | HOST | CREATED | HIDDEN | SHARD_INTERNAL | VALID | INTRA_CDB | TENANT_NAME | REVERSE_TENANT_NAME | CLUSTER_NAME | REVERSE_CLUSTER_NAME | REVERSE_HOST | REVERSE_PORT | REVERSE_USERNAME |
+----------+-----------+----------+----------+-----------------+------------------+---------------------+-----------+--------+----------------+-------+-----------+-------------+---------------------+--------------+----------------------+--------------+--------------+------------------+
| SYS | OB_DBLINK | SYS | NULL | NULL | NULL | xx.xx.xx.xx:2881 | 22-MAY-23 | NULL | NULL | YES | NULL | oracle001 | NULL | NULL | NULL | 0.0.0.0 | 0 | NULL |
+----------+-----------+----------+----------+-----------------+------------------+---------------------+-----------+--------+----------------+-------+-----------+-------------+---------------------+--------------+----------------------+--------------+--------------+------------------+
1 row in set