Selecting Minutes From Timestamp And Scheduling Email

Nov 10, 2012

I have oracle 11g r2, I have a table emp, where i have three columns emp_no,status and creation_date, creation date is a time stamp like '02/09/2012 17:59:47'.

I have to trigger an email if the status is not updated for 30 minutes.

DECLARE
CUSROR C_GET_DATA IS
/*SELECTING RECORDS*/
SELECT * FROM EMP WHERE  creation_date BETWEEN CREATION_DATE AND CREATION_dATE+30 AND STATUS IS NULL;

[Code]....

in the above code "CREATION_DATE AND CREATION_dATE+30" will give 30 days, how can i select just 30 minutes and schedule it every 30 minutes, so that email is triggered for if status is not updated for more than 30 minutes.

View 2 Replies


ADVERTISEMENT

SQL & PL/SQL :: How To Subtract Minutes From Timestamp

Mar 31, 2010

I need below proc like...

procedure p1
(
i_time_min number -- minutes to be substracted from timestamp
)
is
v_end_timeinstamp timestamp(6);
begin

[code]....

The problem with above procedure is passing parameter is in minutes and i need to substract the same from sys_extract_utc(current_timestamp) and store result in v_end_timeinstamp in timestamp format only... substracting directly will reduce the days and not the minutes.

View 6 Replies View Related

SQL & PL/SQL :: Scheduling Same Job With Different Timing?

May 24, 2013

IS it possible TO schedule same JOB WITH different timings.

I need only one SCHEDULER which should run ON saturday AT 6 pm ,AND monday AT 9 pm.

CREATE TABLE dept1 AS SELECT * FROM dept;
CREATE OR REPLACE
procedure update_record is
BEGIN
insert into dept1 values(10,'xxx','xxx');
END;

[code].....

View 7 Replies View Related

Scheduling Job In Stored Procedure

Dec 21, 2011

PFB code i used to schedule a job as per my requirement. And the procedure is executing fine, but when im about to run it is getting hang.

create or replace procedure scheduler_alert(frq varchar2,intrvl number) is
begin
dbms_scheduler.create_job(
job_name=>'scheduler_alert',
job_type=>'stored_procedure',
job_action=>'alertlog_error',
start_date=>SYSTIMESTAMP,
repeat_interval=>'FREQ='||frq||';INTERVAL='||intrvl,
enabled=>true,
auto_drop=>false);
end;
/

When im trying to run the job it is getting hang.

exec dbms_scheduler.run_job('scheduler_alert');

View 3 Replies View Related

Forms :: Report Scheduling?

Jan 23, 2011

how to do report scheduling.? So that server can auto run those report at specified time. And send output to user.

View 2 Replies View Related

SQL & PL/SQL :: Exclusive Lock On Tables - Run Job By Scheduling

Sep 27, 2011

@ the end of the day means After date changes i need to populate the new row in Some of my tables with the previous date values with the new date.. In that time some other Transaction will Occur on those tables so we need to lock all the tables in that time..Even i tried by doing the Exclusive lock on the tables...

execute immediate 'LOCK TABLE CTR_SALES IN EXCLUSIVE MODE NOWAIT';
execute immediate 'LOCK TABLE CTR_STK_ASSIGN IN EXCLUSIVE MODE NOWAIT';

And how to run this function @ 12:00 in the midnight by scheduling.... And 1 more thing how to pick the recent (Transaction) row on that table. I tried from the rowid it's not working

View 1 Replies View Related

SQL & PL/SQL :: Scheduling A Stored Procedure / Package?

Mar 9, 2010

I need to schedule a stored procedure and a stored package every day @6:30 AM.

I have also a merge statement that I need to execute before stored procedure is executed.

View 3 Replies View Related

Scheduling Automatic Refresh In Materialized View?

Jul 28, 2013

we need to create a materialized view which should do complete refresh at pre determined interval like - 6am,12pm and 4pm every day.

Is it possible to have this option in materialized view?

As of now, I could understand we can do "start with" and "next" option which will schedule refresh with same interval but not with different time interval which I mentioned above.

View 1 Replies View Related

Scheduling Automatic Exp / Imp Jobs With Crontab Using Utility

Feb 26, 2012

i have a production database server with 2 node rac. i now have a separate database server for my report db. Now i want to do an automatic export of the production database or a schema in the production database and then import it automatically to the report db immadiately after the export job finishes at a specific time, say 12 midnight everyday. how do i go about this using crontab or any other better solution. my database is 11gr2 and operating system is rhel 5.7.

View 1 Replies View Related

Enterprise Manager :: Scheduling A Shell Script As Job In OEM 12c

Sep 12, 2012

I have a shell script which triggers a batch in our application (an application which is not integrated with any other scheduler and is trying to integrate with OEM for the first time).

Is it possible to schedule a job to run this shell script in OEM ?

View 1 Replies View Related

Enterprise Manager :: Scheduling Export Database

Jul 25, 2012

I would like to export my whole database every evening. How can I do this using enterprise manager.

View 4 Replies View Related

PL/SQL :: Scheduling Jobs - Without Commit Records Are Getting Inserted

Nov 12, 2013

Oracle DB Version - 11g XE I scheduled a job using dbms_scheduler which will insert a record into table T for each minute. I didnt mention COMMIT inside my procedure but records are being commited after each successful execution. How come it is possible. Here is my code.

SQL> create table t ( empno number, creation_date date);
Table created
SQL> create or replace procedure test_proc  2  is  3    4  begin  5    6    insert into t values (1,sysdate);  7    8  end;  9  /
Procedure created

[Code]....

PL/SQL procedure successfully completed

SQL> select * from t;
     EMPNO CREATION_DATE---------- -------------         1 11/12/2013 11         1 11/12/2013 11         1 11/12/2013 11         1 11/12/2013 11         1 11/12/2013 12         1 11/12/2013 12         1 11/12/2013 12         1 11/12/2013 12         1 11/12/2013 12

9 rows selected

View 21 Replies View Related

PL/SQL :: Scheduling - Create Oracle Job That Will Execute Shell Script?

Jul 2, 2012

I need to create an oracle job that will execute a shell script. i need to run it only when I call it(so not to be scheduled).

View 5 Replies View Related

PL/SQL :: Load Data From Flat File To Target Table With Scheduling In Loader

Sep 7, 2013

I have requirement as follows.  I need to load the data to the target table on every Saturday. My source file consists of data of several sates. For every week i have to load one particular state data to target table.  If first week I loaded AP data, then second week on Saturday karnatak, etc.

Provide code also how can i schedule the data load with every Saturday  with different state column values automatically.

View 2 Replies View Related

SQL & PL/SQL :: How To Get Minutes Between Two Times

Oct 19, 2012

i want one query which return minute between two times which is in this format: 12:00:00 and 06:00:00

so in this it should return 360 minutes.

View 5 Replies View Related

How To Round Time Up Or Down By 5 Minutes

Nov 29, 2006

is there a prebuilt function that will round say the time of a sysdate up or down 5 mins? so i entered 5:32pm i would want it to round it down to 5:30pm

View 1 Replies View Related

How To Display Time In Minutes

Oct 15, 2012

I have two columns which I need to add together then devide by 60 in order to display that time in minutes. the problem I am facing is that at times I get numbers above 60 and my client doesn't want to see numbers above 60.

i.e (col1 + col 2)/60 = 34.87

what I need to do is make sure that when the number reaches 60 it moves on to 35.

View 2 Replies View Related

SQL & PL/SQL :: Count Records Per Every 10 Minutes

Jun 6, 2011

How to count records per every 3 minutes ? we don't want SPs to get answer. Instead of we want single query to get this output.

The sample data has been enclosed with it.

View 13 Replies View Related

SQL & PL/SQL :: Difference Of Dates And Get Minutes

Oct 25, 2012

I have a date in_sdate as In parameter defaulted to sysdate. Basing on this in_Sdate I calculate my start and end dates as:

v_sdate TRUNC (in_sdate, 'MI') - 15 / 1440 ;
v_edate := TRUNC (in_sdate, 'MI');

My procedure is run for every 15 minutes. Now suppose if I am running for old dat, then I should get the difference of dates by taking

v_old_Date := v_edate - in_Sdate;

Divide this by 15 , round that value and loop to run the procedure for that n times. My doubt is when I am saying

v_old_date := v_edate - in_sdate ; I am getting expression is of wrong type. How can I take the difference of the dates and get the minutes from that ?

View 2 Replies View Related

Archive Log Generated Each 4 Minutes?

Jul 2, 2012

in our database 10.0.2.4 with RAC archive log generated each 4 min , did this increase the performance of database and how i can fix it

View 14 Replies View Related

PL/SQL :: Date Subtraction Of Minutes?

Jun 14, 2012

how to get correct result for the time subtraction of minutes for the following query

select (to_date('14-06-2012 11:10:00','dd-mm-yyyy hh24:mi:ss') - to_date('14-06-2012 11:00:00','dd-mm-yyyy hh24:mi:ss'))*60*60 as
result from dual

RESULT
----------
25

i want the output as 10 minutes.

View 4 Replies View Related

Application Net Connection Is Taking 30 To 40 Minutes

Jul 20, 2012

In one of my application oracle net connection is taking 30 to 40 ms(tnsping servicename),but in actual connection is always taking more than 45 ms, and my application requirement is below than 10 to 20 ms.

And can i use any other connection method like hostname, ezconnect etc.

View 7 Replies View Related

Query On V$session_longops Taking Over 5 Minutes

Jan 18, 2013

I am working with a new client and am still waiting on access to systems so I'm a bit hampered in looking at details of the database and environment. The database is OLTP and typical response time for returning result sets is under 2 seconds, often less than 1 second.

A simple SELECT on a few columns of v$session_longops (no subqueries, group by, having, etc) ran for more than 5 minutes.

View 3 Replies View Related

Can Create Range Partition Of Like 10 Minutes?

Oct 18, 2012

I want to ask whether I can create range partition of like 10 minutes? Like I have data of 1 hour and I want to make 10 partition?

View 12 Replies View Related

DB 11g On Min2K3 Take 100% Of One Core 2 To 4 Minutes After Startup

Feb 23, 2013

I have a Windows 2003 VirtualBox instance, to which I assigned 3 out of 4 cores my laptop has. This is a demonstration environment for an Oracle vertical product. I got it from my colleagues. The OS boots without starting the DB services - I did this deliberatley while trying to figure out what is happening.

About 2 and half to 3 and a half minutes after the service is started the oracle.exe "latches onto a core and does not let go" (as best as I can describe what I see). With 3 cores I see 33%-34% cprocessor use in the task manager with oracle.exe doing all the using. Nothing else is started. There is no process of which I am aware which actually uses the DB. I only start the TNS listener and the database service.

Once I start it, the demonstration software uses the database extensively for complex queries. With one of the 3 cores 100% used by the oracle.exe I am running short on CPU at times, which makes the demonstratin seem slaggish, and queries take longer than is really acceptable (not surprising seeing oracle.exe is very busy doing I know not what).

View 2 Replies View Related

PL/SQL :: How To Convert Minutes To Hour And Minute

Oct 4, 2012

i want to convert minutes that is 90 want to convert it in hours and minute that format should come in 01:30 format.

can i get in this format?

View 12 Replies View Related

LGWR Switch In Database Alert Log Every 3-4 Minutes

Jul 6, 2012

i am seeing (LGWR switch) happening in my databsae alert log every 3-4 minutes. is that appropriate? if not, what measure can i take to reduce this?

View 1 Replies View Related

SQL & PL/SQL :: To Calculate Minutes From Difference Of To Number Fields

Apr 9, 2013

I need the query to calculate minutes from difference of to number fields. Test case is as below.

DROP TABLE tmp;

CREATE TABLE tmp
(
code NUMBER(4),
stime NUMBER(4,2),
otime NUMBER(4,2)
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
NOMONITORING;
[code]......

CODE STIME OTIME
---------- ---------- ----------
1065 20 19.49
1082 20 18.57
1279 19.3 18.59
2075 19.3 15.32

Required output is

CODE STIME OTIME HR_MIN MINUTES
---------- ---------- ---------- ------------- --------
1065 20 19.49 00 HR 21 MIN 21
1082 20 18.57 01 HR 03 MIN 63
1279 19.3 18.59 00 HR 31 MIN 31
2075 19.3 15.32 03 HR 58 MIN 238

View 8 Replies View Related

Forms :: Adding Hours And Minutes To Time

Feb 11, 2011

I currently have a problem where I have two date fields with time stamps. The only bit i am currently interested in in these fields is the time factor. When i display them in their field they have a format of HH24:MI .

I have a start time and end time as well as a duration and duration type. What I am trying to do is the following: when the user inputs the start time, along with the duration say 1 for example and the duration type of say HRS for example I would like to have the end_datetime default to 1 HR from the current start time. This is the code I use on a when validate item trigger to acheive this:

case :blk.duration_type
when 'HRS' then
:blk.end_datetime := :blk.start_datetime + ((1/24)* :blk.duration);
when 'MINS' then
:blk.end_datetime := :blk.start_datetime + ((1/24/60)* :blk.duration);

However, every time it triggers the value put into end_datetime is 0:00 is it something to do with the datatypes im using .

View 1 Replies View Related

SQL & PL/SQL :: How To Get Hours / Minutes And Second From Date Datatype Field

Jan 14, 2012

I have a field " Tran_date " with datatype Date . It contains date as well as time . How can I get the time . I tried with it as below :

SELECT TO_CHAR(TRAN_DATE,'DD-MON-YYYY HH24:MI:SS') FROM ABC
WHERE COMP=1 AND
BRANCH=1 AND
LOC_CODE='12' AND
TRAN_DATE='12-JAN-2012' ;

VALUE IS COMING LIKE THIS :
12-JAN-2012 00:00:00

ALTHOUGH THERE IS TIME . Its not zero .

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved