1
I have a table in Oracle 11g with the following structure:
CREATE TABLE USER.LOG_EXECUCAO
(
ID NUMBER,
DATA DATE,
QTD_REGISTROS_INSERIDOS NUMBER,
TEMPO_EXECUCAO VARCHAR2(50 BYTE)
)
An example of data:
ID DATA QTD_REGISTROS_INSERIDOS TEMPO_EXECUCAO
6356 04/04/2016 09:36:03 1074 00h:00m:58s:769ms
6355 04/04/2016 09:33:00 1074 00h:00m:56s:221ms
6354 04/04/2016 09:30:11 1074 00h:01m:06s:719ms
6353 04/04/2016 09:27:13 1074 00h:01m:08s:977ms
6352 04/04/2016 09:24:13 1074 00h:01m:09s:361ms
6351 04/04/2016 09:21:12 1074 00h:01m:07s:685ms
6350 04/04/2016 09:18:11 1074 00h:01m:06s:657ms
6349 04/04/2016 09:15:01 1074 00h:00m:57s:074ms
This table is powered by a C#executable, which runs every 3 minutes.. But it may happen that the executable stops running due to unavailability of the server... and I need to know when it stopped.. I confess that I could not think of anything to solve this problem... someone has some idea that can return me something like:
Between date X and Y, there was a failure in execution during X minutes. (differs from one date to another)
The idea was to try to solve by SQL.... Suggestions?
Oracle does not have Jobs to do this?
– Marco Souza
I don’t know, buddy.... I can’t tell you how
– Marllon Nasser
See this here
– Marco Souza
I think it’s much better if you keep your logic all in the database if your data came from there. (This table is powered by a C executable#)
– Marco Souza
Ah, yes... the job itself I know, but it’s impossible... the C# executable does things that through PL/SQL I can’t do, like access certain websites, monitor whether a server is out or not - through ping.
– Marllon Nasser
@Marllonnasser you could use?
– Tiedt Tech
@Marlontiedt, I’d like the information to come in real time...?
– Marllon Nasser
@Marllonnasser puts your script with data in http://sqlfiddle.com/ with ok data and not ok data, I will try to help you
– Tiedt Tech
thanks, @Marlontiedt! I got an answer and made it available to anyone who wants to do something similar :)
– Marllon Nasser