Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Bequeath vs. TNS connections

Re: Bequeath vs. TNS connections

From: Pascal Byrne <nospam-byrne_at_icada.net>
Date: Wed, 24 Jul 2002 10:57:37 +0200
Message-ID: <3D3E6C01.4090700@icada.net>


Hello Gregor,
Thanks for the reply. It is interesting that tnsping does not try to connect to the database over TCP. This would seem to reduce its usefulness significantly in the real world.

You are correct in saying that sqlplus will use bequeath automatically but other clients like Java applications using JDBC must be coded to use it by specifiying the full connect line otherwise they use TCP.

If you need a news server for posting I suggest news://news.cis.dfn.de. You need to register (for free) at http://news.cis.dfn.de

Regards,
pascal

Gregor Theis wrote:

> Hello Pascal
>
> Sorry. Currently I do not have write access to newsgroups that's why I am sending this directly.
>
> tnsping is quite unfair to test the speed of a connection.
>
> Here is why it is unfair:
>
> tnsping with TCP basically opens a TCP port to the listener, sends a ping packet and closes the connection. tnsping with TCP does NOT start or connect to the database. You might see tnsping working but you still can not connect to the database (most of the time a bad ORACLE_HOME in the listener.ora :-).
>
> For a bequeath connection the story is different. With bequeath the listener ist not involved at all.
>
> I tried the following (8.1.7.4 on Solaris):
> tnsnames.ora:
> GREGOR =
> (DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS = (PROTOCOL = BEQ) (PROGRAM = oracle)
> (ARGV0 = oracleVODDEV) (ARGS = '(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))
> )
> (CONNECT_DATA = (SERVICE_NAME = VODDEV))
> )
>
> oracle_at_prosper2:/opt/oracle/mndba/tmp>tnsping GREGOR 10
>
> TNS Ping Utility for Solaris: Version 8.1.7.4.0 - Production on 24-JUL-2002 08:11:59
>
> (c) Copyright 1997 Oracle Corporation. All rights reserved.
>
> Attempting to contact (ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=oracleVODDEV)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))
> OK (80 msec)
> OK (80 msec)
> OK (70 msec)
> OK (90 msec)
> OK (100 msec)
> OK (80 msec)
> OK (70 msec)
> OK (80 msec)
> OK (90 msec)
> OK (100 msec)
>
> oracle_at_prosper2:/opt/oracle>tnsping VODDEV 10
>
> TNS Ping Utility for Solaris: Version 8.1.7.4.0 - Production on 24-JUL-2002 08:13:10
>
> (c) Copyright 1997 Oracle Corporation. All rights reserved.
>
> Attempting to contact (ADDRESS=(PROTOCOL=TCP)(Host=prosper2-g0)(Port=7001))
> OK (10 msec)
> OK (0 msec)
> OK (0 msec)
> OK (0 msec)
> OK (0 msec)
> OK (10 msec)
> OK (0 msec)
> OK (0 msec)
> OK (0 msec)
> OK (10 msec)
>
>
> For a bequeath connection you will get a dedicted server forked for you even in a tnsping situation. That is what is taking the time in this situation.
>
> Here a bit from the "truss -f tnsping GREGOR" output. I think the equivalent on Linux is strace (truss traces system calls):
> ...
> 13601: write(1, " A t t e m p t i n g t".., 141) = 141
> 13601: pipe() = 3 [4]
> 13601: pipe() = 5 [6]
> 13601: fork1() = 13604
> 13604: fork1() (returning as child ...) = 13601
> 13601: sigfillset(0xEEFA9D50) = 0
> 13601: sigprocmask(SIG_BLOCK, 0xEFFFCC24, 0x00000000) = 0
> 13604: fork1() = 13606
> 13601: sigaction(SIGPIPE, 0xEFFFCA28, 0xEFFFCB74) = 0
> 13601: sigprocmask(SIG_UNBLOCK, 0xEFFFCC1C, 0x00000000) = 0
> 13606: fork1() (returning as child ...) = 13604
> 13606: close(4) = 0
> 13606: close(5) = 0
> 13604: _exit(0)
> 13606: setsid() = 13606
> 13601: waitid(P_PID, 13604, 0xEFFFCBD8, WEXITED|WTRAPPED) = 0
> 13606: getuid() = 30094 [30094]
> 13601: close(3) = 0
> 13601: close(6) = 0
> 13606: setsid() Err#1 EPERM
> 13606: execve("/usr/bin/oracle", 0x00022458, 0x00035238) Err#2 ENOENT
> 13606: execve("oracle", 0x00022458, 0x00035238) Err#2 ENOENT
> 13606: execve("/usr/bin/oracle", 0x00022458, 0x00035238) Err#2 ENOENT
> 13606: execve("/usr/ccs/bin/oracle", 0x00022458, 0x00035238) Err#2 ENOENT
> 13606: execve("/usr/ucb/oracle", 0x00022458, 0x00035238) Err#2 ENOENT
> 13606: execve("/etc/usr/etc/oracle", 0x00022458, 0x00035238) Err#2 ENOENT
> 13606: execve("/usr/sbin/oracle", 0x00022458, 0x00035238) Err#2 ENOENT
> 13606: execve("/usr/local/bin/oracle", 0x00022458, 0x00035238) Err#2 ENOENT
> 13606: execve("/opt/oracle/bin/oracle", 0x00022458, 0x00035238) Err#2 ENOENT
> 13606: execve("./oracle", 0x00022458, 0x00035238) Err#2 ENOENT
> 13606: execve("/opt/SUNWcluster/bin/oracle", 0x00022458, 0x00035238) Err#2 ENOENT
> 13606: execve("/opt/oracle//admin/tools/shows/oracle", 0x00022458, 0x00035238) Err#2 ENOENT
> 13606: execve("/opt/oracle/setup/oracle", 0x00022458, 0x00035238) Err#2 ENOENT
> 13606: execve("/opt/oracle/product/817332/bin/oracle", 0x00022458, 0x00035238) argc = 2
> 13606: stat("/opt/oracle/product/817332/bin/oracle", 0xEFFFF658) = 0
> ...
>
> You can see the fork() and the execve() from tnsping. It is starting the ORACLE executable for me.
>
> BTW: even without an tnsnames.ora entry a bequeath connection is used by default if you are on the same machine as the database, have no TWO_TASK environment variable and just type "sqlplus sys/change_on_install".
>
> Have a nice day
>
> Gregor
> --
> Dipl.-Ing. Gregor Theis (ORACLE OCP DBA 8,8i,9i)
> TATS Database Support Testing KIAS 2000
> Porsche Gelb, E2/05
> Telefon +49 211 533 4149 Mobil +49 171 6701288
> gregor.theis_at_vodafone.de
>
>
Received on Wed Jul 24 2002 - 03:57:37 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US