Re: Multi-threaded server ???

From: Jon Pope <jpope_at_mojo.europe.dg.com>
Date: 1995/06/20
Message-ID: <1995Jun20.102209.24323_at_mojo.europe.dg.com>


Mahesh Vallampati (m0v5533_at_tam2000.tamu.edu) wrote:

: In article <3rphs0$ebr_at_cnn.softart.com>,
: Mark Boxberger <mboxberger_at_softart.com> wrote:

: >I am trying to work through an architecture issue regarding the use of ORACLE's
: >MTS. I have a client server app that has two distinct types of users
: >connecting to the DBMS. The first is a typical human user running a remote
: >C/S application, and the second is an E-MAIL type application also running
: >remotely that is generating 5-10 times the number of transactions as the
: >typical human user. Is it possible to configure the DBMS such that the E-MAIL app
: >has a dedicated connection whenever it connects and have the human users
: >connect to a shared server process.
: >My understanding is that the MTS configuration is server wide, however, can I
: >do anything to force the above architecture? Also, would using SQL*Net V2 and
: >a different protocol on the E-MAIL client force this behavior?
: >Would using SQL*Net V1 on the E-MAIL client force this behavior?
: >Thanks.

I've just been through the same issue for a client of mine.... here's what you need to do:

I'm assuming you are using TCP/IP:

init.ora:

mts_dispatchers="ipc,1"
mts_dispatchers="tcp,1"
mts_max_dispatchers=3
mts_servers=3
mts_max_servers=10
mts_service=JON
mts_listener_address="(ADDRESS=(PROTOCOL=ipc)(KEY=HERE))"
mts_listener_address="(ADDRESS=(PROTOCOL=tcp)(HOST=nostradamus)(PORT=1521))"

This will cause Oracle to start up two dispatchers, one for each protocol. In this case, we have one for local connect requests to the database (using IPC,or plain old pipes/sockets) and one for the IP stuff coming in on port 1521 over tcp/ip (dont forget to add the service to /etc/services)

Then you configure your listener.ora file as follows:

LISTENER=
 (ADDRESS_LIST=
  (ADDRESS=
   (PROTOCOL=IPC)
   (KEY=HERE)
  )
  (ADDRESS=

    (PROTOCOL=TCP)
    (HOST=nostradamus)
    (PORT=1521)

  )
 )

STARTUP_WAIT_TIME_LISTENER = 0
CONNECT_TIMEOUT_LISTENER = 10 SID_LIST_LISTENER=
 (SID_LIST=
  (SID_DESC=
   (SID_NAME=ora716)
   (ORACLE_HOME=/oracle/ora7016)
  )
 )

TRACE_LEVEL_LISTENER = ADMIN
PASSWORDS_LISTENER = (listen)

This example sets the IPC KEY to the string 'HERE'.This can be anything you like,Oracle uses it to hash to the info a little faster, thats all. It MUST match the KEY in your init.ora parameter for the IPC connect dispatcher. I only have the one Oracle SID on my host, nostradamus, but you can add other SIDS here as well.

Once you have started the listener with lsnrctl start, check out the services advocated by the listener. In my init.ora file, I called the MTS service by the name JON, but you can just use the SID if you like, but it gets a bit confusing if you do. Note that you make no reference to the MTS service yet, the listener is only intersted in where connect requests come from (IPC and TCP) and which databases will be connected to. IF you start your listener AFTER your database, the MTS service known as JON will not become available for a few minutes, until the dispatchers time out (120 seconds on my Aviion) and register their mts_service with the listener. Check out the services by starting lsnrctl, set the password if you have one, then enter 'services'. You should see two service descriptions for the JON service, and one for the db SID.

Here's a screen capture from my host:



Script started on Tue Jun 20 11:14:46 1995 <oracle7016_at_nostradamus> lsnrctl

LSNRCTL for 88open UNIX: Version 2.0.15.0.0 - Production on 20-JUN-95 11:14:53

Copyright (c) Oracle Corporation 1993. All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> set password listen
The command completed successfully
LSNRCTL> services
Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=HERE)) Services Summary...
  JON has 2 service handlers
    DISPATCHER established:0 refused:0 current:0 max:60 state:ready

      D000 (machine: nostradamus, pid: 3068)
      (ADDRESS=(PROTOCOL=ipc)(DEV=13)(KEY=#3068.1))
    DISPATCHER established:0 refused:0 current:0 max:60 state:ready
      D001 (machine: nostradamus, pid: 3070)
      (ADDRESS=(PROTOCOL=tcp)(DEV=13)(HOST=152.62.242.47)(PORT=1336))
  ora716                has 1 service handlers
    DEDICATED SERVER established:0 refused:0 The command completed successfully
LSNRCTL> exit
<oracle7016_at_nostradamus> psme

     UID PID PPID C STIME TTY TIME CMD

  oracle  3300  3298  4 11:14:06 pts/1    0:00 -sh 
  oracle  3120  2722  4 15:46:27 pts/2    0:02 -su 
  oracle  3314  3300  4 11:14:46 pts/1    0:00 script 
  oracle  3315  3314  4 11:14:46 pts/1    0:00 script 
  oracle  3316  3315  4 11:14:46 p0       0:00 /sbin/sh /sbin/sh 
  oracle  3318  3316  4 11:15:07 p0       0:00 /sbin/sh /sbin/sh 
  oracle  3319  3318  4 11:15:07 p0       0:00 ps -fuoracle 
  oracle  2362  2360  4 13:39:05 pts/3    0:12 -su 
  oracle  3226  2362  4 16:16:25 pts/3    0:00 lsnrctl 
  oracle  3234     1  4 16:17:30 pts/3    0:04 /oracle/ora7016/bin/tnslsnr LISTENER -inherit 
  oracle  3061     1  4 15:33:31 ?        0:14 ora_pmon_ora716 
  oracle  3062     1  4 15:33:33 ?        0:06 ora_dbwr_ora716 
  oracle  3063     1  4 15:33:35 ?        0:04 ora_lgwr_ora716 
  oracle  3064     1  2 15:33:37 ?        0:40 ora_smon_ora716 
  oracle  3065     1  4 15:33:39 ?        0:00 ora_s000_ora716 
  oracle  3066     1  4 15:33:41 ?        0:00 ora_s001_ora716 
  oracle  3067     1  4 15:33:43 ?        0:00 ora_s002_ora716 
  oracle  3068     1  4 15:33:45 ?        0:01 ora_d000_ora716 
  oracle  3070     1  4 15:33:47 ?        0:01 ora_d001_ora716 
<oracle7016_at_nostradamus>
script done on Tue Jun 20 11:15:12 1995

And finally..... here's the most important bit,the tnsnames.ora file:

ora=
  (DESCRIPTION=

	(ADDRESS=
		(PROTOCOL=IPC)(KEY=HERE)
	)
	(CONNECT_DATA=
		(SID=ora716)
		(SERVER=DEDICATED)
	)

  )

oramts=
  (DESCRIPTION=

	(ADDRESS=
		(PROTOCOL=IPC)(KEY=HERE)
	)
	(CONNECT_DATA=
		(SID=JON)
	)

  )

oratcp=
  (DESCRIPTION=

	(ADDRESS=
		(PROTOCOL=TCP)(HOST=nostradamus)(PORT=1521)
	)
	(CONNECT_DATA=
		(SID=ora716)
		(SERVER=DEDICATED)
	)

  )

oramtstcp=
  (DESCRIPTION=

	(ADDRESS=
		(PROTOCOL=TCP)(HOST=nostradamus)(PORT=1521)
	)
	(CONNECT_DATA=
		(SID=JON)
	)

  )

Not that I have entered all possible connect aliases here in the one file for completeness. I then distribute this file around my PC's, running DOS, Windows, NT, DG/UX etc. So, for local accounts on my Aviion, I can connect to the database in one of four ways:

  1. locally, using standard pipes sqlplus system/manager_at_ora
  2. locally, using the MTS via local unix sockets sqlplus system/manager_at_oramts
  3. locally, using the IP stack (though Codd knows why...) sqlplus system/manager_at_oratcp
  4. locally, using the MTS via the local IP stack sqlplus system/manager_at_oramtstcp

And from my PC clients, they specify the connect alias as option 3 or 4 above depending on whether they need a dedicated server or are happy to use the shared servers.

Bear in mind that the shared servers are NOT a faster way to execute sql over the net - you get shared sql and all that stuff regardless of the MTS. There are more queues to navigate,so the execution path is longer.However, the MTS is a great saver of memory, and slightly slower performance due to using the MTS access path is far more preferable to terrible performance becuase your server just ran bang out of memory and is swapping itself into oblivion (as most UNIX systems tend to do when out of memory).

Hope this was useful, SQL*Net V2 can be pretty confusing if you're used to V1 simple connect strings. The Oracle documentation is pretty poor for the MTS setup, and some UNIX ports dont support a local IPC connect to the MTS, only TCP.

Regards, and good luck...

-- 
******************* :-) *******************************************************
Jon Pope email:	jpope_at_mojo.europe.dg.com
Senior Database Consultant
Data General UK Ltd.
Received on Tue Jun 20 1995 - 00:00:00 CEST

Original text of this message