Skip to Main Content
  • Questions
  • Database Link using the bequeath protocol

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Michael.

Asked: July 21, 2020 - 9:18 am UTC

Last updated: July 22, 2020 - 1:14 pm UTC

Version: 12c

Viewed 1000+ times

You Asked

Hi "Ask Tom"

I'm in a situation where I have to create a database link between two databases running on the same AIX LPAR out of two ORACLE_HOMES. One is 12.1.0.2 and the other is 12.2.0.1 or 19c At the moment we are running the two different 12c versions.
The application running on top of theses DBs are two versions af an OLTP application running apx 1000 simultaneus connections.
This hybrid setup will be running for years.

Some "busy" tables (apx. 10) have to recide only in the new DB (fx CUSTOMER) and a in the old DB a view including a db link to the new DB is to be created.

I have two q's:

1. What is the most efficient connection protocol to use for the database link from the old DB to the new DB?
I was thinking BEQ (same server, no need for the listener to do the normal connection handeling, etc.

If so ..

2. How do I create the BEQ setup for the DB link? I have tried to create a test setup with no luck :-(

In TNSNAMES.ORA added (the two installations are using the same $TNS_ADMIN location)

OLD2NEW_BEQ.alkait.net=
(description=
(address=
 (protocol=BEQ)
 (program=/opt/oracle/product/12201/bin/oracle)
 (ARGV0=oracleTIATST01)
 (ARGS='(Description=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))')
 (ENVS='ORACLE_SID=TIATST01,ORACLE_HOME=/opt/oracle/product/12201')
)
 (CONNECT_DATA= (SID=TIATST01) )
)


The information for OLD2NEW_BEQ.alkait.net refer to the new ORACLE_HOME (12.2.0.1)

In the old DB:

CREATE DATABASE LINK MY_BEQ
CONNECT TO <USER> IDENTIFIED BY< passwd>
using  'OLD2NEW_BEQ.alkait.net';


Database link created.

SQL>
SQL>
select * from tab@my_beq;

select * from tab@my_beq
*
ERROR at line 1:
ORA-12154: TNS:could not resolve the connect identifier specified
SQL>


Just for reference. - a normal db link can be created normally.

CREATE DATABASE LINK MY_NORM
CONNECT TO <USER> IDENTIFIED BY <passwd>
using  'TIATST01.alkait.net';


Database link created.

SQL>
SQL>
select * from tab@my_norm;


TNAME TABTYPE CLUSTERID
------------------------------ ---------------------------- ----------
DAVIA_MAIL_SUBSCRIBER TABLE
ALKA_MAIL_SERVER TABLE
ALKA_MAIL_LOG TABLE
….

Regards
Michael

and Chris said...

Sorry, you're out of luck with bequeath, as this error says:

ORA-09276: All bequeath database links must be loopback database links


You can only use bequeath to create a link back to the same database, not to another.

Connor here - Just to add, check out the following MOS note

How to create a DBLink using IPC protocol instead of TCP (Doc ID 275119.1)


Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database