1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Oracle 12c listener stopped but oci app still running

Discussion in 'Server Administration and Options' started by Infor_Nancy, Sep 21, 2015.

  1. Infor_Nancy

    Infor_Nancy Starter

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    Mountain View, CA
    Hi! We have a test case where DBA stops the Oracle listener then we expect both a multi-threaded OCI application which executes lots of DML queries and continuous TNSPING on the same client machine to fail with ORA-12541: TNS:no listener error immediately following listener down. This test case worked on all previous Oracle releases. But now we moved onto Oracle 12.1.0.1, and we observed something different. TNSPING still displayed the expected error message immediately after listener was stopped. But OCI application would continue on as if all connections were still intact. This OCI application would only receive the expected no listener error when we restart this application.

    Environment:
    We tried Oracle 64bit 12.1.0.1 Server, Enterprise Edition on both Red Hat Linux 6.3 and on Windows 2008 R2.
    The Oracle 64bit full client is also at 12.1.0.1 on Red Hat Linux 6.3 and Windows 2008 R2.

    I suspect we might have hit a "feature" in Oracle 12c where the listener does not really shutdown until transactions have all been closed. But I could not find such reference in any Oracle 12c documentation.

    I would appreciate any pointer to point me to the Oracle 12c documentation about this new behavior.
    Thank you.

    Regards, Nancy
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,345
    Likes Received:
    347
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    There is no such 'feature'; reading the documentation will provide the necessary insight. Since Version 7.3 the listener does not shut down existing connections if it is either shut down or it stops for some reason. Existing connections also include any connection pools an application may create using the listener; these pools remain until the application is shut down and restarted.
     
  3. Infor_Nancy

    Infor_Nancy Starter

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    Mountain View, CA
    Thank you, David.
    Could you point me to the right document, if its' in OCI Programming Guide, Oracle DBA Guide, Oracle Network, etc.?
    Much Obliged!

    Best Regards, Nancy
     
  4. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,345
    Likes Received:
    347
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    I've looked and cannot find anywhere in the official documentation a mention of why stopping the listener doesn't affect existing connections. I do know that since 7.3 the listener process didn't maintain management of remote connections, it forked new connections (using truss or strace on the listener process will show a fork() process for each new connection the listener establishes). A forked connection is independent of the parent process that generated it. Since these are now independent processes stopping the listener doesn't disconnect existing remote connections; in prior versions of the listener this wasn't true and stopping the listener disconnected all remote sessions. This functionality has steadily improved with each new release of the listener.
     
  5. ocprep

    ocprep Forum Advisor

    Messages:
    277
    Likes Received:
    76
    Trophy Points:
    410
    Location:
    Orlando, Florida
    The Concepts Guide: http://docs.oracle.com/cd/E11882_01/server.112/e40540/dist_pro.htm#CNCPT1274

    The basic steps by which a client establishes a connection through a listener are:
    1. A client process or another database requests a connection.
    2. The listener selects an appropriate service handler to service the client request and forwards the request to the handler.
    3. The client process connects directly to the service handler. The listener is no longer involved in the communication.
     
  6. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,345
    Likes Received:
    347
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Thank you, sir, I obviously missed that in the documentation.
     
  7. ocprep

    ocprep Forum Advisor

    Messages:
    277
    Likes Received:
    76
    Trophy Points:
    410
    Location:
    Orlando, Florida
    Well the first place I looked was probably the first place you did -- the documentation for LSNRCTL STOP. I would have expected a note to the effect of 'FYI -- this will not affect existing connections". When that failed, two things led me to check Concepts -- first that the effect is not something that DBAs must learn how to do, but is simply a matter of how things work and second I tried to think of somewhere you might not have looked so I wasn't duplicating your efforts. :)