Oracle listener state blocked - oracle

I have a webpp which works fine when under a light load. However, when we run a lot of threads each with their own database connection, then we start getting the error
ORA-12519: TNS:no appropriate service handler found
After looking online I found that running lsnrctl services was a good diagnostic step, so I did that. The result for our service was
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:130 refused:0 state:blocked
LOCAL SERVER
The number of established connections is consistent with the number of threads. However, the state:blocked seems like a cause and/or symptom of this problem.
So what's my next step? The max number of open sessions is 1024, which is more than enough, and there's no limit to the number of sessions per user. I ran this test after a reboot of the machine, and no other programs were connected. I'm really not sure what to try next, so any help will be greatly appreciated.
EDIT: Upping the processes and sessions parameters seemed to do the trick. In addition to finding Matthew's suggestion helpful, this email described my problem perfectly.

Have your checked your alert log it should tell you what is going wrong if oracle is running out of resources? Sounds like you may be out of processes,
Run in sqlplus,
SQL> show parameter processes
it will show you how many processes oracle will allow. You may need to increase this a bit.
If you have a metalink account, then check article 240710.1 for more details.

Related

Concepts to write code to monitor running application on the server

Requirement:-
I have to write code to monitor all the running applications on the server and give their name as output if it's down.
Research:-
During my research I found that:-
There are several tools like azure and monito that themselves monitor all the applications but this does not match our requirements.
We can write code that can check all the running services on the local desktop or the server and from there we can also check the running status of the required applications and if the status is stopped or sleep then we can easily notify.
We can send requests to the deployed URL at some regular interval and if we get a response status rather than 200 then we can notify the user as something is wrong and this particular website is not working.
If anyone can through some light on this and can suggest some more methods or references from their experience, it will be highly appreciated.

Windows 2012 Service Shows as Degraded

I wanted to ask does anyone know what the definition of a degraded service is?
I'm monitoring some systems using nagios and check_wmi_plus, it runs the following WMI query:
select name, displayname, Started, StartMode, State, Status FROM Win32_Service
The State comes back as running, but the Status as degraded for one particular service (an in house application that is known for crashing).
This status only seems to be mentioned in WMI so now I'm in a bit of a battle because from the front end everything seems fine but from the monitoring system we warn of the system being degraded, so any additional information on this problem and how to resolve it (other than just bouncing the service) would be great.
The most I've found is the service didn't close down correctly.
Many thanks.
In the check_wmi_plus change log for 1.62 the following was added:
Added some additional text when services were in a degraded state.
Previously they were listed/counted as being "bad" but the display
message was confusing as it still showed them as "running". Thanks to
Paul Jobb.
According to Mircosoft a service in a "degraded" state is as follows:
"Service is working, but in a reduced state."

How to list Windows Services from within a Service

sc query state= all works as expected from the command line.
From within another Service, sc query state= all doesn't print anything to that sub-process' stdout (captured by the parent, of course).
Is there a permission/privilege that the Service needs in order to list/start/stop the other servies?
A little background: I am making a service that periodically restarts some misbehaving services.
Well, for one don't do that, at least not in a blocking manner. In order for your own service to respond to the SCM (Service Control Manager) in order to return its status, the service has to be able to execute its dispatcher code. This means that if you call this program and wait for it to exit you'll wait indefinitely. One way to mitigate this would be to put this into a separate thread so it's not blocking your dispatching and your service will continue to talk to the SCM.
Alternatively (and probably better) you could use the EnumServicesStatusEx function to talk to the SCM and inquire about the statuses of other services yourself. The function itself doesn't mention anything about being blocking, so you'd have to figure out yourself whether it is and then use a thread again to prevent your service from stopping to talk to the SCM.
One last note: if those misbehaving services are yours, you should more likely fix the respective code. I've had a share of legacy code and had one misbehaving service which got its own helper application as "fault action" (can be configured in service configuration as SERVICE_CONFIG_FAILURE_ACTIONS) that would go about and restart the service whenever it crashed. Once I took that code over, figured out the cause and fixed it, the service was stable again and that application isn't really needed anymore.

windows service doesn't stop

I have a problem concerning a windows service that I have implemented. The service does what it has to and logs various information but when I try to stop it, it doesn't seem to stop and keeps logging.
I am not very familiar with services, so if anyone knows why this is happening please tell me.
Edit: I have tested the service on two servers and the weird thing is that on one server it stops normally, but on the other it doesn't. That is what I don't understand.
IN case you have any threads ensure that you exit those threads in your stop routine. Some threads may still be lingering which is why it does not stop.
One possible reason could be because of some remaining thread (as mentioned by 'ckv').
Have you set proper handler using RegisterServiceCtrlHandler function?
Also make sure that the SERVICE_STATUS structure that you use has its dwControlsAccepted set to accept shutdown or stop (by setting SERVICE_ACCEPT_SHUTDOWN & SERVICE_ACCEPT_STOP). and don't forget to update the service status (using SetServiceStatus function) once the service is up and running.

Meaning/cause of RPC Exception 'No interfaces have been exported.'

We have a fairly standard client/server application built using MS RPC. Both client and server are implemented in C++. The client establishes a session to the server, then makes repeated calls to it over a period of time before finally closing the session.
Periodically, however, especially under heavy load conditions, we are seeing an RPC exception show up with code 1754: RPC_S_NOTHING_TO_EXPORT.
It appears that this happens in the middle of a session. The user is logged on for a while, making successful calls, then one of the calls inexplicably returns this error. As far as we can tell, the server receives no indication that anything went wrong - and it definitely doesn't see the call the client made.
The error code appears to have permanent implications, as well. Having the client retry the connection doesn't work, either. However, if the user has multiple user sessions active simultaneously between the same client and server, the other connections are unaffected.
In essence, I have two questions:
Does anyone know what RPC_S_NOTHING_TO_EXPORT means? The MSDN documentation simply says: "No interfaces have been exported." ... Huh? The session was working fine for numerous instances of the same call up until this point...
Does anyone have any ideas as to how to identify the real problem? Note: Capturing network traffic is something we would rather avoid, if possible, as the problem is sporadic enough that we would likely go through multiple gigabytes of traffic before running into an occurrence.
Capturing network traffic would be one of the best ways to tackle this issue. If you can't do that, could you dump the client process and debug with WinDBG or Visual Studio? Perhaps compare a dump when operating normally versus in the error state?

Resources