Re: Ctrl C in SQLPlus exits Windows

  • From: Mladen Gogala <gogala.mladen@xxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Mon, 8 Apr 2019 15:27:55 -0400

Too quick with pressing "send":

Winduhs is not POSIX compliant. If you check the POSIX signals, here:

https://dsa.cs.tsinghua.edu.cn/oj/static/unix_signal.html

You will find that signals are delivered to the processes. Microsoft Windows is not process oriented OS, it's thread oriented. Oracle on Windows does not use shared memory, semaphores and other POSIX  IPC primitives. The main architect of the monstrosity known as "Windows" is the guy named Dave Cuttler, the very same guy who has also been the main architect of VMS. In both VMS and Windows, creating process is an expensive operation which done from scratch, by creating the process context, page tables and all the accompanying structures. The old VAX/VMS machines were much slower than contemporary Unix boxes running on 66 MHZ i486 processors mostly because of the OS architecture. Windows avoids the trap by using user-mode threads and there is a problem with delivering signals to user mode threads.  User mode threads are scheduled by the process which has spawned them, not by the system scheduler. That means that any signal handler, which runs in the process context and not thread context will have very limited options for handling the signal. In case of Oracle, it's "break the connection".

When you use threaded execution on Linux, which also has user mode threads. you are actually connecting to listener, not to the background server thread. It's very similar to shared server architecture. One advantage of threads is that thread mutexes are much cheaper than semaphores and latches and that latch contention will not kill your system.

Regards


On 4/7/19 9:13 PM, Jared Still wrote:

CTL-C is handled differently on Windows than it is on any other OS that Oracle runs on.

Linux for instance supports out of band breaks in the TCP stack, while Windows does not.

When a database on a Linux service is supporting a connection from a Windows machine, every 4th packet Oracle polls the client; kind of asking "are you still there?"

The out of band breaks are how CTL-C is detected on linux clients, while on Windows it is a polling operation.

It appears that there is a bug in the CTL-C handling for Windows clients.

It is kind of funny you referred to my 10 year old post on the topic.

1) the poster responded that sometimes Oracle is installed on Windows.  yeah, I knew that, as I had spend 8 years at that time adminstering Windows based databases, but I did it mostly from Linux.

2) if thus is a bug, it is a very old bug.  but sometimes you have to file an SR to get a bug fixed. Two weeks ago I got fed up and filed and SR for a sqlnet bug that has been around since at least 11gR2, but was still present in 19c.

you may want to create an SR. :)



On Sun, Mar 10, 2019 at 00:00 Ram K <lambu999@xxxxxxxxx <mailto:lambu999@xxxxxxxxx>> wrote:

    Installed Oracle in my home Windows PC and playing around with it.
    But pressing Ctrl-C always exits SQL Plus, when I run queries.
    grr... Tried searching online and found  this:

    
https://grokbase.com/t/freelists.org/oracle-l/095myarkwd/11g-sqlplus-on-windows-and-ctrl-c

    Is there a solution for Ctrl C only to interrupt and not to exit
    SQL Plus in windows.

-- Thanks,
    Ram.

--
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist
Principal Consultant at Pythian
Pythian Blog http://www.pythian.com/blog/author/still/
Github: https://github.com/jkstill


--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217

Other related posts: