Additional Blogs by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

We will now continue the  scenario from DB connect mechanisms in Oracle and SAP - Part I and have a look at the following command:

sqlplus sys/<pw>@NW2 as sysdbaPlease note that for 'remote' connections, there must always be a valid combination of username/password supplied. This is also the reason why the command sqlplus /@NW2 as sysdba will always return 1031 here.getsockname(8, {sa_family=AF_INET, sin_port=htons(53936), sin_addr=inet_addr("169.254.20.62")}, ) = 0
getsockopt(8, SOL_SOCKET, SO_SNDBUF, , ) = 0
getsockopt(8, SOL_SOCKET, SO_RCVBUF, , ) = 0
setsockopt(8, SOL_TCP, TCP_NODELAY, , 4) = 0
fcntl(8, F_SETFD, FD_CLOEXEC) = 0
...
write(8, " 377  1    0191,f117737717737717710  1  305 :  2 AA                        (DESCRIPTION=(SDU=32768)(ADDRESS=(COMMUNITY=SAP.WORLD)(PROTOCOL=TCP)(HOST=nwtest)(PORT=1527))(CONNECT_DATA=(SID=NW2)(GLOBAL_NAME=NW2.WORLD)(CID=(PROGRAM=sqlplus@nwtest)(HOST=nwtest)(USER=nw2adm))))", 255) = 255
read(8, " 10  v   ", 32783) = 8

h6.
the listener receives the string:

listener trace

[31-OCT-2007 19:10:00:398] nttrd: socket 14 had bytes read=255
[31-OCT-2007 19:10:00:398] nttrd: exit
[31-OCT-2007 19:10:00:398] nsprecv: 255 bytes from transport
[31-OCT-2007 19:10:00:399] nsprecv: tlen=255, plen=255, type=1
[31-OCT-2007 19:10:00:399] nsprecv: packet dump
[31-OCT-2007 19:10:00:400] nsprecv: 00 FF 00 00 01 00 00 00  |........|
[31-OCT-2007 19:10:00:400] nsprecv: 01 39 01 2C 0C 01 7F FF  |.9.,....|
[31-OCT-2007 19:10:00:400] nsprecv: 7F FF 7F 08 00 00 01 00  |........|
[31-OCT-2007 19:10:00:400] nsprecv: 00 C5 00 3A 00 00 02 00  |...:....|
[31-OCT-2007 19:10:00:400] nsprecv: 41 41 00 00 00 00 00 00  |AA......|
[31-OCT-2007 19:10:00:400] nsprecv: 00 00 00 00 00 00 00 00  |........|
[31-OCT-2007 19:10:00:400] nsprecv: 00 00 00 00 00 00 00 00  |........|
[31-OCT-2007 19:10:00:401] nsprecv: 00 00 28 44 45 53 43 52  |..(DESCR|
[31-OCT-2007 19:10:00:401] nsprecv: 49 50 54 49 4F 4E 3D 28  |IPTION=(|
[31-OCT-2007 19:10:00:401] nsprecv: 53 44 55 3D 33 32 37 36  |SDU=3276|
[31-OCT-2007 19:10:00:401] nsprecv: 38 29 28 41 44 44 52 45  |8)(ADDRE|
[31-OCT-2007 19:10:00:401] nsprecv: 53 53 3D 28 43 4F 4D 4D  |SS=(COMM|
[31-OCT-2007 19:10:00:401] nsprecv: 55 4E 49 54 59 3D 53 41  |UNITY=SA|
[31-OCT-2007 19:10:00:402] nsprecv: 50 2E 57 4F 52 4C 44 29  |P.WORLD)|
[31-OCT-2007 19:10:00:402] nsprecv: 28 50 52 4F 54 4F 43 4F  |(PROTOCO|
[31-OCT-2007 19:10:00:402] nsprecv: 4C 3D 54 43 50 29 28 48  |L=TCP)(H|
[31-OCT-2007 19:10:00:402] nsprecv: 4F 53 54 3D 6E 77 74 65  |OST=nwte|

strace/truss output

19:10:00.397967 read(14, " 377  1    0191,f117737717737717710  1  305 :  2 AA                        (DESCRIPTION=(SDU=32768)(ADDRESS=(COMMUNITY=SAP.WORLD)(PROTOCOL=TCP)(HOST=nwtest)(PORT=1527))(CONNECT_DATA=(SID=NW2)(GLOBAL_NAME=NW2.WORLD)(CID=(PROGRAM=sqlplus@nwtest)(HOST=nwtest)(USER=nw2adm))))", 8208) = 255

h6.
Now, the listener spawns the server process:

listener trace

[31-OCT-2007 19:10:00:465] sntpcall: hdl[IR]=17, hdl[IW]=16
[31-OCT-2007 19:10:00:466] ntpcon: exit
[31-OCT-2007 19:10:00:466] nserror: entry
[31-OCT-2007 19:10:00:468] sntpcall: About to exec /oracle/NW2/102_64/bin/oracle:

h6. The server process will read the password file:

strace/truss output

19:55:02.617034 open("/oracle/NW2/102_64/dbs/orapwNW2", O_RDWR|O_SYNC) = 8

This method is called 'Redirect Method', since as soon as the listener informs the client which socket should be used by the client to connect to the server process, the listener is no longer involved, therefore, the listener has redirected the client to the server process.

In my next article I will take on the task of busting the myths of the infamous OPS$ connect.