Share

Oracle Bequeath Connections: Connecting to an Oracle Database Without Using the Listener

Oracle Database provides several methods for establishing database connections. The most commonly used method in client-server environments is connecting through an Oracle Net Listener using TCP/IP. However, Oracle also supports a local connection mechanism known as Bequeath (BEQ).

A Bequeath connection allows a client process running on the database server to connect directly to a local Oracle Database instance without requiring communication through the Oracle Net Listener.

This connection method can be particularly useful for local database administration, troubleshooting, testing Oracle Net configurations, and understanding how Oracle establishes local database sessions.

In this article, we will demonstrate how to configure a Bequeath connection using Oracle Database 19c and how to verify the connection at both the database and operating system levels.

Understanding the Oracle Bequeath Connection

The Bequeath protocol is a local connection mechanism that enables Oracle client processes to communicate directly with an Oracle Database instance on the same server.

Unlike a conventional TCP connection, a Bequeath connection does not require the database listener to accept the connection request.

When a Bequeath connection is initiated, the Oracle client launches an Oracle server process locally. This process is associated with the target Oracle instance and handles the database session.

The connection uses the following Oracle Net protocol:

(PROTOCOL=BEQ)

The main characteristics of a Bequeath connection include:

  • The client and database instance must reside on the same server.
  • The Oracle Net Listener is not required for the connection.
  • The Oracle executable is invoked directly.
  • The connection is established using a local operating system process.
  • Oracle environment variables such as ORACLE_HOME and ORACLE_SID must be defined appropriately.

Configuring a Bequeath Connection in tnsnames.ora

To establish a Bequeath connection using a network service name, we need to define an appropriate entry in the tnsnames.ora file.

In this example, we will create a connection alias named BEQ_ORCL for an Oracle Database instance with the SID ORCL1.

The Oracle Home directory is:

/u01/app/oracle/product/19.24/dbhome_1

The Oracle executable is located at:

/u01/app/oracle/product/19.24/dbhome_1/bin/oracle

The following configuration defines the Bequeath connection:

$ cat tnsnames.ora
BEQ_ORCL =
  (ADDRESS =
    (PROTOCOL = BEQ)
    (PROGRAM = /u01/app/oracle/product/19.24/dbhome_1/bin/oracle)
    (ARGV0 = oracleORCL1)
    (ARGS = '(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))')
    (ENVS = 'ORACLE_HOME=/u01/app/oracle/product/19.24/dbhome_1,ORACLE_SID=ORCL1')
  )

Explanation of the Configuration Parameters

Parameter Description
PROTOCOL=BEQ Specifies that the connection will use the Bequeath protocol.
PROGRAM Defines the Oracle executable that will be invoked to establish the connection.
ARGV0 Specifies the process name displayed by operating system process listing commands.
ARGS Contains the arguments passed to the Oracle executable.
LOCAL=YES Indicates that the connection is a local database connection.
ENVS Defines the environment variables required by the Oracle process.

PROGRAM

The PROGRAM parameter specifies the Oracle executable responsible for creating the local database connection.

In this example:

PROGRAM=/u01/app/oracle/product/19.24/dbhome_1/bin/oracle

The executable must correspond to the Oracle Home used by the target database instance.

ARGV0

The ARGV0 parameter defines the process name that will appear in operating system process listings.

For example:

ARGV0=oracleORCL1

This value is commonly configured by appending the Oracle SID to the executable name.

Although the value can be customized, using a meaningful and recognizable process name is recommended, particularly when monitoring database processes or troubleshooting local connections.

ARGS

The ARGS parameter specifies the arguments passed to the Oracle executable.

ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))'

This configuration indicates that Oracle should establish a local connection using the Bequeath protocol.

ENVS

The ENVS parameter defines the environment variables that will be passed to the Oracle process.

At a minimum, the following variables should be defined:

ORACLE_HOME
ORACLE_SID

For our example:

ENVS='ORACLE_HOME=/u01/app/oracle/product/19.24/dbhome_1,ORACLE_SID=ORCLDB1'

These environment variables ensure that the Oracle executable uses the correct Oracle Home and connects to the intended local database instance.


3. Establishing a Bequeath Connection Using SQL*Plus

After configuring the tnsnames.ora entry, we can establish a connection using SQL*Plus.

The following command connects to the database using the BEQ_ORCL service name:

[oracle@orcldb01 admin]$ sqlplus test/test123@BEQ_ORCL

The connection output is shown below:

SQL*Plus: Release 19.0.0.0.0 - Production
Version 19.24.0.0.0

Copyright (c) 1982, 2024, Oracle. All rights reserved.

Last Successful login time:
Sat Jul 04 2026 15:44:51 +03:00

Connected to:
Oracle Database 19c Enterprise Edition
Release 19.0.0.0.0 - Production
Version 19.24.0.0.0

The connection has been successfully established.

Although the connection string resembles a conventional Oracle Net connection, the connection is not routed through the listener. Instead, Oracle uses the Bequeath protocol to create a local server process.

Identifying the Oracle Server Process

After establishing the connection, we can identify the Oracle server process associated with our session.

The following SQL query retrieves the process information from V$PROCESS:

SELECT spid,
       stid,
       program,
       execution_type
FROM   v$process
WHERE  addr = (
           SELECT paddr
           FROM   v$session
           WHERE  sid = SYS_CONTEXT('USERENV', 'SID')
       );




SPID        STID
------------ ------------
PROGRAM
------------------------------------------------
EXECUTION_TYPE
--------------------
357595      357595

oracle@orcldb01.interiva.local
PROCESS

The query identifies the operating system process associated with the current database session.

The process ID is:

357595

We can use this process ID to inspect the process from the operating system.

Verifying the Connection at the Operating System Level

The Oracle server process can be examined using the ps command.

From SQL*Plus, we can execute an operating system command using the HOST command:

SQL> HOST ps -Lfp &pid 
Enter value for pid: 357595

The output is:

UID      PID    PPID   LWP    C NLWP STIME TTY TIME CMD

oracle  357595     1 357595  0    1 15:47 ? 00:00:00
oracleORCL1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))

This output provides important evidence about the connection mechanism.

The process name is:

oracleORCL1

The process arguments contain:

(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))

These details confirm that the Oracle server process was initiated using a local Bequeath connection.

The process does not represent a connection accepted and handled through a TCP listener. Instead, the Oracle executable was invoked locally to establish the database session.

Identifying the Client and Server Information

We can also use Oracle’s SYS_CONTEXT function to identify the host information associated with the current session.

Execute the following SQL statement:

SELECT SYS_CONTEXT('USERENV', 'SERVER_HOST') AS server,
       SYS_CONTEXT('USERENV', 'HOST')        AS client,
       SYS_CONTEXT('USERENV', 'SESSION_USER') AS user
FROM   dual;



SERVER
------------------------------------------------

CLIENT
------------------------------------------------

USER
--------

orcldb01

orcldb01.saglik.lokal

TEST

The returned values indicate:

Parameter Value Description
SERVER_HOST orcldb01 Database server host
HOST orcldb01.saglik.lokal
SESSION_USER TEST Connected database user

Because the connection originates from the database server itself, the client and server host information refer to the same machine.

This is one of the characteristics of a local Bequeath connection.

Verifying the Network Service Used by the Session

Oracle provides the V$SESSION_CONNECT_INFO view to display connection-related information for database sessions.

The following query retrieves the network service banner for the current session:

SELECT network_service_banner
FROM   v$session_connect_info
WHERE  sid = SYS_CONTEXT('USERENV', 'SID');
NETWORK_SERVICE_BANNER
----------------------------------------------------------------

Oracle Bequeath NT Protocol Adapter for Linux:
Version 19.0.0.0.0 - Production

Authentication service for Linux:
Version 19.0.1.0.0 - Production

Encryption service for Linux:
Version 19.0.1.0.0 - Production

Crypto-checksumming service for Linux:
Version 19.0.1.0.0 - Production

The most important line is:

Oracle Bequeath NT Protocol Adapter for Linux

This confirms that the current database session is using the Oracle Bequeath protocol adapter.

The remaining lines provide information about the authentication, encryption, and crypto-checksumming services associated with the session.


8. Checking the IP Address of the Session

We can also check the IP address associated with the current session using the SYS_CONTEXT function.

SELECT SYS_CONTEXT('USERENV', 'IP_ADDRESS') AS ip FROM   dual;

IP
------------------------------------------------------------------

In this example, the IP address is returned as NULL.

This is expected for a local Bequeath connection because the session is not established through a TCP/IP network connection.

Unlike a TCP-based Oracle Net connection, there is no remote client IP address associated with the Bequeath session.

Bequeath Connection vs. TCP Listener Connection

The primary difference between a Bequeath connection and a conventional TCP connection is how the Oracle server process is initiated and how the client communicates with the database.

Feature Bequeath Connection TCP Connection
Oracle Net protocol BEQ TCP
Requires Listener No Yes
Client and database on same server Yes Not necessarily
Network communication Local process-based connection TCP/IP
Oracle server process Initiated locally Established through listener
Remote database connectivity No Yes
Client IP address Typically NULL Normally available
Common usage Local administration and troubleshooting Client-server applications

A Bequeath connection should not be considered a replacement for TCP-based connections in application environments. It is primarily intended for local connectivity scenarios where the client and database reside on the same server.

When Should Bequeath Connections Be Used?

Bequeath connections can be useful in several scenarios:

Local Database Administration

DBAs can connect directly to a local database instance without relying on the Oracle Net Listener.

Listener Troubleshooting

When the listener is unavailable or its configuration is incorrect, a local Bequeath connection may still allow database administrators to connect to the database, provided the database instance is running and the local environment is correctly configured.

Oracle Net Troubleshooting

Bequeath connections can help isolate whether a connection problem is related to the listener, TCP/IP networking, or the database itself.

Local Testing

DBAs can test local database connectivity using a dedicated Bequeath service name without changing existing TCP-based service configurations.

Conclusion

Oracle Bequeath connections provide a practical method for establishing local database sessions without using the Oracle Net Listener.

By defining a PROTOCOL=BEQ entry in the tnsnames.ora file and specifying the appropriate Oracle executable, arguments, and environment variables, administrators can establish direct local connections to Oracle Database instances.

The connection can be verified through several methods, including:

  • V$PROCESS to identify the Oracle server process.
  • Operating system ps commands to inspect process arguments.
  • SYS_CONTEXT to identify session and host information.
  • V$SESSION_CONNECT_INFO to identify the Oracle network service adapter.
  • SYS_CONTEXT('USERENV', 'IP_ADDRESS') to verify the absence of a TCP client IP address.

Understanding Bequeath connections is particularly valuable for Oracle DBAs when performing local administration, diagnosing Oracle Net connectivity issues, and troubleshooting database environments where listener-based connections are unavailable or problematic.

Loading

You may also like