Friday, January 2, 2026

What is BEQUEATH Protocol

 What is BEQUEATH Protocol 


The Bequeath Protocol is a SQL*Net protocol which enables local clients to connect to a database without using the network listener. Oracle’s Bequeath protocol internally spawns a server process for each client application. It does the same operation that a remote network listener does for the connection locally.

It has the following characteristics:

  1. Does not use a network listener. Therefore, listener configuration is not required.
  2. Automatically spawns a dedicated server.
  3. Is used for local connections (when client and server programs reside on the same system) where an Oracle Database client application, such as SQL*Plus, communicates with an Oracle Database instance running on the same computer.
  4. Only works in the Dedicated Server mode. It cannot be used in the Shared Server mode.

This method allows you to connect to the database without using the network listener

It should be used to connect only for administration purposes.


--for database

TESTDB_BEQ =

  (DESCRIPTION =

    (ADDRESS =

          (PROTOCOL = BEQ)

          (PROGRAM = oracle)

          (ARGV0 = oracletestdb)

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

    )

    (CONNECT_DATA =

     (SERVICE_NAME = testdb)

    )

  )


Or

Beq-local =

(DESCRIPTION =

(ADDRESS =

(PROTOCOL = BEQ)

(PROGRAM = ORACLE_HOME/bin/oracle)

(ARGV0 = oracleORACLE_SID)

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

(ENVS = 'ORACLE_HOME=ORACLE_HOME,ORACLE_SID=ORACLE_SID')

)

(CONNECT_DATA = (SID = ORCL)

)

)


myconn_java =

(DESCRIPTION=

(ADDRESS = (PROTOCOL = BEQ)(PROGRAM=oracle)

(ARGV0=oracleMYTEST1)

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

)

(CONNECT_DATA=(SID = MYTEST1))

)


--usage:

$export ORACLE_SID=MYTEST1

$sqlplus /@myConn_java


Connected to:

Oracle Database 19c Enterprise Edition Release 19.23.0 - 64bit Production

 

SQL> show user

USER is "ORACLE"

-----------

For ASM:

ASM_BEQ =

(DESCRIPTION =

    (ADDRESS_LIST =

        (ADDRESS =

            (PROTOCOL=BEQ)

            (PROGRAM=oracle)

            (ARGV0=oracle+ASM)

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

        )

    )

    (CONNECT_DATA=

        (SID=+ASM)

    )

)

--usage:

$sqlplus /@ASM_BEQ as sysdba


----

For a jdbc connection:

jdbc:oracle:thin:@(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))

(ENVS=ORACLE_HOME=/var/lib/oracle/dbhome,ORACLE_SID=oraclesid))


Or


DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL=BEQ) (PROGRAM=oracle) (ARGV0=oracle' + db + ") (ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))) (CONNECT_DATA=(SID=" + db + '))


Connect to a Database By Using SSH and the Bequeath Protocol


Connect From a Windows System

  1. Open putty.exe.
  2. In the Category pane, select Session and enter the following fields:
    • Host Name (or IP address):opc@<DB_system_IP_address>
      Use the DB system's private or public IP address depending on your network configuration.
    • Connection type: SSH
    • Port: 22 
  3. In the Category pane, expand Connection, expand SSH, and then click Auth, and browse to select your private key.
  4. Optionally, return to the Session category screen and save this session information for reuse later.
  5. Click Open to start the session.


Connect From a UNIX-style System

Use the following SSH command to access the DB system: 


ssh –i <private_key> opc@<DB_system_IP_address>


<private_key> is the full path and name of the file that contains the private key associated with the DB system you want to access.

Use the DB system's private or public IP address depending on your network configuration.


Access a Database After You Connect

Log in as opc. 
login as: opc


sudo to the grid user.
sudo su - grid


List all the databases on the system.
srvctl config database -v

Output:
cdbm01 /u02/app/oracle/product/12.1.0/dbhome_2 12.1.0.2.0

exadb /u02/app/oracle/product/19.0/dbhome_2 19.18.0

mmdb /u02/app/oracle/product/21.0/dbhome_3 21.0.1

Connect as the oracle user. 


[root@ed1db01 ~]# su - oracle

[oracle@ed1db01 ~]$ . oraenv

ORACLE_SID = [oracle] ? cdbm01

The Oracle base has been set to /u02/app/oracle

Get the details about one of the databases by using the srvctl command.

srvctl config database -d cdbm


Find ORACLE_SID and ORACLE_UNIQUE_NAME from outpost and then:


export ORACLE_SID=cdbm011

export ORACLE_UNIQUE_NAME=cdbm01

sqlplus / as sysdba


--------Alireza Kamrani-------

No comments:

Post a Comment

Bequeath protocol usage in the 26ai for applications

Oracle 26ai Support for the Bequeath Protocol Starting from Oracle AI Database Release  26ai , the JDBC thin driver supports the Bequeath pr...