Newbie: help on creating a scheduled job
Hello,
I want to do the following :
I have a query for example
select col1, col2, col3 from table1 where col1 is not null
I want to tabulate the result in a flat file putting the data in csv style.
I know how to do this using JDBC, but I want to learn how to make this happen just using oracle console. Is there any way I can write some kind of scheduled job that will make this happen. Runs the query, creates the flat file?
Thanks and Regards,
Rumpa Giri
Rumpa,
You can do the following to get the data in a HTML pages directly provided your DB version is 9.2.0 onwards as you didn't mention that.
login to sqlplus
set markup html on;
spool c:\a.html;
select * from <table name> or your desired query.
spool off
set markup html off;
Regards,
Indraneel
Similar Messages
-
Error while creating a Scheduled job in OIM 11g
While creating a scheduled job, if i click on the Task and search to select the value, i get the following error.
<Nov 14, 2011 5:10:24 PM IST> <Error> <oracle.adfinternal.view.faces.config.rich
.RegistrationConfigurator> <BEA-000000> <ADF_FACES-60096:Server Exception during
PPR, #1
javax.servlet.ServletException: java.lang.AssertionError
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:341)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.help.web.rich.OHWFilter.doFilter(Unknown Source)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.j
ava:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter
(RegistrationFilter.java:106)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterL
istChain.doFilter(TrinidadFilterImpl.java:447)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter
.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterL
istChain.doFilter(TrinidadFilterImpl.java:447)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilt
erImpl(TrinidadFilterImpl.java:271)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilte
r(TrinidadFilterImpl.java:177)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFi
lter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.iam.platform.auth.web.PwdMgmtNavigationFilter.doFilter(PwdMgmt
NavigationFilter.java:122)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.iam.platform.auth.web.OIMAuthContextFilter.doFilter(OIMAuthCon
textFilter.java:108)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:1
76)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:31
3)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUt
il.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.jav
a:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:1
61)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:13
6)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsF
ilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
ervletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
ontext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
ava:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused By: java.lang.AssertionError
at org.apache.myfaces.trinidad.component.ChildArrayList.__removeFromPare
nt(ChildArrayList.java:191)
at org.apache.myfaces.trinidad.component.ChildArrayList.add(ChildArrayLi
st.java:53)
at org.apache.myfaces.trinidad.component.ChildArrayList.add(ChildArrayLi
st.java:69)
at org.apache.myfaces.trinidad.component.ChildArrayList.add(ChildArrayLi
st.java:33)
at oracle.iam.consoles.faces.render.canonic.UIValue$UIEntitySelector.sea
rch(UIValue.java:1670)
at oracle.iam.consoles.faces.render.canonic.UIValue$UIEntitySelector.acc
ess$2400(UIValue.java:1467)
at oracle.iam.consoles.faces.render.canonic.UIValue$EntitySelectorQueryL
istener.processQuery(UIValue.java:1787)
at oracle.adf.view.rich.event.QueryEvent.processListener(QueryEvent.java
:67)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcast(UIXC
omponentBase.java:675)
at oracle.adf.view.rich.component.UIXQuery.broadcast(UIXQuery.java:108)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.r
un(ContextSwitchingComponent.java:92)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._pr
ocessPhase(ContextSwitchingComponent.java:361)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.bro
adcast(ContextSwitchingComponent.java:96)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclu
de.java:102)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.r
un(ContextSwitchingComponent.java:93)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._pr
ocessPhase(ContextSwitchingComponent.java:361)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.bro
adcast(ContextSwitchingComponent.java:96)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclu
de.java:96)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents
(LifecycleImpl.java:902)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(L
ifecycleImpl.java:313)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(Lifecyc
leImpl.java:186)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
tyHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.help.web.rich.OHWFilter.doFilter(Unknown Source)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.j
ava:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter
(RegistrationFilter.java:106)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterL
istChain.doFilter(TrinidadFilterImpl.java:447)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter
.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterL
istChain.doFilter(TrinidadFilterImpl.java:447)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilt
erImpl(TrinidadFilterImpl.java:271)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilte
r(TrinidadFilterImpl.java:177)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFi
lter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.iam.platform.auth.web.PwdMgmtNavigationFilter.doFilter(PwdMgmt
NavigationFilter.java:122)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.iam.platform.auth.web.OIMAuthContextFilter.doFilter(OIMAuthCon
textFilter.java:108)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:1
76)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:31
3)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUt
il.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.jav
a:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:1
61)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:13
6)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsF
ilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
va:57)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
ervletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
ontext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
ava:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
>
This behavior is seen in most of the lookups when we try to search for value.
Please let me know for any configuration steps for the same issue.Have you tried restarting the db and the server? I have seen this on user search and a db restart along with server restart solved it for me. Also note that this error in my case was due to wrong mds file. so for you also check ur tasks and any custom xml which might have some errors into it.
HTH,
BB -
Can not create Azure Scheduler Job Colloection correctly via rest API
Hi Folks,
I am trying to create a Azure Scheduler job collection via the rest API using Azure Ruby SDK
I created the request following the API reference. Request body is as follow:
<Resource xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure">
<IntrinsicSettings>
<Plan>Standard</Plan>
<Quota>
<MaxJobCount>10</MaxJobCount>
<MaxRecurrence>
<Frequency>Second</Frequency>
<Interval>1</Interval>
</MaxRecurrence>
</Quota>
</IntrinsicSettings>
</Resource>
After sending the request, I can see the job collection created in the management portal, but the status of that job collection is "Unknown". I can not add add/update jobs under that job collection.
Below is the log entry I got:
RuntimeError (ESC[31mESC[1mInternalError: The server encountered an internal error. Please retry the request.ESC[0mESC[0m):
Can someone shed me some lights on this?
Thank you very in advance!
RoyHi Roy,
I am not good at Ruby. But I didn't find any maintenance information from azure dashboard. The issue is very weird,I will test it on my side and come back.
Thanks & Regards,
Will
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Howto change NLS_ENV variables when creating Oracle Scheduler jobs
Hello,
i have installed EMGrid 10.2.0.3 x86_64 and 10.2.0.3 agent on other computer. With standard NLS_LANGUAGE='AMERICAN' NLS_TERRITORY='AMERICA' settings.
When I create DB job with EMGrid Oracle Sheduler interface, NLS_xx parameters are set as NLS_LANGUAGE='AMERICAN' NLS_TERRITORY='AMERICA'.
How can I change the default settings to NLS_LANGUAGE='CZECH', NLS_TERRITORY='CZECH REPUBLIC' when creating DB jobs with EMGrid?
Thanks for reply.
Regards,
Stanislav StudenyHi,
You need to call the create_job (or submit) procedure from a session which has the appropriate NLS settings set. I can think of two ways of doing this from EMGrid
- create a stored procedure which takes in job parameters, does appropriate "alter session" statements and then calls create_job/subit with the passed in parameters. You can then call that stored procedure from EMGrid
- create a job from EMGrid which as the action does the alter session statements and then creates the real job
Hope this helps,
Ravi. -
Please help me in creating and scheduling jobs. Its very urgent.
RDBMS: Oracle 9.2.0.4
OS: win2k
OWB Client: 9.2.0.2.8
OWB Repository: 9.2.0.2.0
Hi,
I have created a "process workflow" using OWB and deployed it successfully. Now, I would like to schedule this process. I have installed management server and tried to schedule it but all in vain. I am not able to understand anything. I have read "oracle administrator pdf" and couldnt understand anything. Please dont advise me to read any notes or pdf's because I have tried a lot and was not able to figure out the configuration.
I have a target database named "TARGET". I would like to schedule the workflow process I have created. I am not able to understand preferred credentials and how to execute the XML script generated by the "process workflow". Please help me coz its very urgent.
-AdityaWhy dont you try this? I found it after few tries,
In the create job dialog box
under General
for Override Node Preferred Credentials for entire job
username and password should be the NT or Unix
login where your Runtime database Server reside.
under Parameter
for Override preferred credentials
username and password should be of your runtime
repository user
Regards,
Shree -
Create and Schedule Job - Problem
hi everyone,
I'm trying to write an Job which I would like to schedule. Function of this Job is to delete all entries older than 1 Month in the table "tabelle1". As I understand, you can put in job_action the procedure statement.
BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'delete_all_entries',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN DELETE FROM tabelle1 WHERE last_date < (SYSDATE - INTERVAL '1' MONTH) AND (status = 'processed'); END;',
start_date => SYSTIMESTAMP,
repeat_interval => 'FREQ=WEEKLY;BYDAY=SAT;BYHOUR=10;BYMINUTE=00',
end_date => NULL,
enabled => TRUE,
comments => 'Job defined entirely by the CREATE JOB procedure.');
END;
I get the following error message:
ORA-06550: Zeile 5, Spalte 118:
PLS-00103: Encountered the symbol "1" when expecting one of the following:
) , * & = - + < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
like4 likec between || multiset member submultiset
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
What am I doing wrong?.
Thx in advance!Hi,
If you want to include a single-quote in a string literal, then use 2 single-qutoes in a row, like this:
'BEGIN DELETE FROM tabelle1 WHERE last_date < (SYSDATE - INTERVAL ''1'' MONTH) AND (status = ''processed''); END;',or use Q-notation:
Q'{BEGIN DELETE FROM tabelle1 WHERE last_date < (SYSDATE - INTERVAL '1' MONTH) AND (status = 'processed'); END;}',As you posted it, the single-quote right before the 1 indicated that the string literal ended there, and that 1 was outside of the qutoes.
By the way,
SYSDATE - INTERVAL '1' MONTH isn't always a valid date (when SYSDATE is October 31, for example).
Use
ADD_MONTHS (SYSDATE, -1)instead.
Edited by: Frank Kulash on Sep 18, 2012 9:41 AM -
How to create oracle scheduled job
DECLARE
jobno NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
( job => jobno
,what => 'DEL_HIST_TABLE;'
,next_date => to_date('09/04/2009 18:23:00','dd/mm/yyyy hh24:mi:ss')
,interval => 'null'
,no_parse => TRUE
SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(jobno));
END;
commit;
i wrote the above job to run on specific time and date
but i want to convert the same to run on
every day @ 1:00 am using oracle 10g
Edited by: [email protected] on May 17, 2009 11:39 PMHi,
You need to set the interval then:
MHO%xe> select trunc(sysdate) + 1/24 + 1 from dual;
TRUNC(SYSDATE)+1/24
19-05-2009 01:00:00
1 rij is geselecteerd.
MHO%xe> DECLARE
2 jobno NUMBER;
3 BEGIN
4 SYS.DBMS_JOB.SUBMIT
5 ( job => jobno
6 ,what => 'begin null; end;'
7 ,next_date => to_date('09/04/2009 18:23:00','dd/mm/yyyy hh24:mi:ss')
8 ,interval => 'trunc(sysdate) + 1/24 + 1'
9 ,no_parse => TRUE
10 );
11 SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(jobno));
12 END;
13 /
Job Number is: 21
PL/SQL-procedure is geslaagd.
Verstreken: 00:00:11.39
MHO%xe> commit;
Commit is voltooid.
MHO%xe> select interval from user_jobs where job = 21;
INTERVAL
trunc(sysdate) + 1/24 + 1
1 rij is geselecteerd.Edited by: hoek on May 18, 2009 8:49 AM added to example -
Newb help on creating photo slideshow with different music tracks
I am interested in ultimately creating a DVD for a friend with pictures of their family. I would like to have different soundtracks play with fading in and out if possible; different effects on the transitions too (if possible). With iLife I know you could just use iDVD and play 1 track in the background. I would like to try iMovie.
I couldn't find any support tutorials or information in Apple Support.
Can anyone tell me or direct me to a place that would give the steps for a slide show, adding music, and exporting to DVD?
Thanks.Can you enlighten me on this? and what program would you recommend for this?
While this can be done totally in iMovie '08, my preference would be to add the audio using GarageBand.
1) iMovie '08 strategy: In iMovie '08, simply create your video slideshow track first. Once satisfied with the video, titles, transitions, start adding your audio. Simply drag an audio file from the media browser or "drop import" a file from the Finder and "pin" it a your video clip. Once pinned to a video clip, adjust the "in" and "out" handles to select the exact portion of the music you want and adjust the fade in/out if necessary. When you have finished with this, slide the music to align it with the video track as desired. Now repeat theses steps to add the rest of your music.
NOTE: I prefer pinning all of the music to video clips so I can control the overlap. (I.e., have one file fade out as another is fading in.) However, there is a problem if you want the music to start during a "title" segment which does not overlap the actual slideshow video. In this case you may wish to place the first music file in the background and use the "Trim Music" option to select the actual portion to play in the background since you cannot slide background music for alignment to the video.
2) If you plan to use GarageBand, share/export your iMovie '08 video only project to your hard drive and then import it to a GarageBand Podcast project. In this case, each music file can be placed in a single audio track after appropriate trimming, or occupy its own audio track/alternate between two audio tracks to allow overlapping of files if desired. I prefer GarageBand since you can control the volume of individual tracks continuously, create custom fade contours, adjust track/master volumes as a whole independently, adjust the emphasis of frequency response ranges, "pan" the music, etc. as you mix and match your "musical collage" of sounds. -
Error while running scheduled job fromEnterprise Manager--Please help ASAP
BEGIN
Hi,
I have created a scheduled job using the below code.
BEGIN
sys.dbms_scheduler.create_job(
job_name => '"M2RT6"."INCR_REFRESH_M2RT6"',
job_type => 'PLSQL_BLOCK',
job_action => 'begin
REFRESH_REPORTS_POETIC(''M2PT6'',''INCR'');
end;',
start_date => systimestamp at time zone 'US/Eastern',
job_class => 'DEFAULT_JOB_CLASS',
auto_drop => FALSE,
enabled => TRUE);
END;
And I tried to execute this job from Enterprise Manager.
I got the below error:
java.sql.SQLException:
ORA-02800: Requests timed out
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 2
Help needed urgently. Thanks for the resolution inadvance.
Thanks,
Sudheer.VempaliHi,
This is the bug in Oracle. Most of the times, restarting Oracle database may fix the issue.
Basically, an existing bug needs the oracle database restarts in a regular basis.
Restarting oracle database will flushes the database buffer cache.
Thanks,
Sudheer.Vempali -
Problem in Date info at scheduling jobs....
Hi...
I have defined a materialized view ..
create materialized view mv_ekkrem_vlavon
build immediate
refresh on demand
as
select distinct seq_code_eidos .....I want to create a scheduled job using the DBMS_SCHEDULER which will refresh this materialized view ... doing a full refresh of its contents....
so....i following the following steps...-connected as sys:
begin
dbms_scheduler.drop_job('mv_ekkrem_vlavon_job');
end;
begin
dbms_scheduler.drop_schedule('mv_ekkrem_vlavon');
end;
begin
dbms_scheduler.create_schedule
('mv_ekkrem_vlavon','15/08/2007 17:20:00','FREQ=DAILY;INTERVAL=1');
end;
exec dbms_scheduler.create_job(job_name=>'mv_ekkrem_vlavon_job',schedule_name=>'mv_ekkrem_vlavon',job_type=>'PLSQL_BLOCK',job_action=> 'BEGIN dbms_mview.refresh(''mv_ekkrem_vlavon''); END;');
exec dbms_scheduler.enable('mv_ekkrem_vlavon_job');However , after 17:20:00 local time (db time) the mv refresh did not take place....
Trying to find out what may be the reason... i issued the following command:
SQL> select job_name,schedule_name,start_date,repeat_interval,last_start_date,next_run_date from dba_scheduler_jobs
2 where job_name='MV_EKKREM_VLAVON_JOB';
JOB_NAME SCHEDULE_NAME START_DATE REPEAT_INTERVAL LAST_START_DATE NEXT_RUN_DATE
MV_EKKREM_VLAVON_JOB MV_EKKREM_VLAVON 15/08/20 07:17:20,000000 +03:00 15/08/20 07:17:20,000000 +03:00and issuing the command:
SQL> select to_char(NEXT_RUN_DATE,'dd/mm/rrrr hh24:mi') from dba_scheduler_jobs where job_name='MV_EKKREM_VLAVON_JOB';
TO_CHAR(NEXT_RUN_DATE,'DD/MM/R
15/08/2020 07:17
SQL> Select to_char(START_DATE,'dd/mm/rrrr hh24:mi') from dba_scheduler_jobs where job_name='MV_EKKREM_VLAVON_JOB'
2 /
TO_CHAR(START_DATE,'DD/MM/RRRR
15/08/2020 07:17
Can you find out which is the error in the job definition...????
Needless to write that i use Oracle Db10g.
Many thanks,
SimonHi,
The repeat_interval gets its timezone from the start_date parameter so if you want the job to run every 9am in a particular timezone XXX you would need to do something like
START_DATE => SYSTIMESTAMP at time zone 'XXX',
REPEAT_INTERVAL => 'FREQ=DAILY; BYHOUR=9;byminute=0;bysecond=0',
XXX can be something like -2:00 or a named time zone.
There is a dedicated dbms_scheduler forum at
Scheduler
Hope this helps,
Ravi. -
Edit cycles in Scheduled Jobs for Hyperion 11
I have created a scheduled job that has several cycles. The job is not running correctly and I can't find where to edit the cycles that I have already built, nor can I find documentation. I am running Oracle EMP with Hyperion 11.1.1.2
The following instructions assume that you saved your cycle definitions as a set of named parameters, otherwise you'll have to start again.
So right mouse over your job and choose Manage Job Schedules. Right mouse over the relevant schedule and choose Show Parameters. Right mouse over the parameters and choose Modify. Then you can modify the existing cycle(s) and add more if you so wish.
Hope that helps. -
How to schedule job under dbms_job??
Hello,
How would i go about scheduling a dbms job ?? All i have is the schema name and a procedure that i need to schedule. It need to run every night at midnight...i was said everything is ready in the procedure(some partitioning) of tables...i just need to put on dbms scheduler...how would i go about doing that?? schema name is syk2ws and the procedure name is maint....how can i put this on the dbms job ?? Do i need to tweak or do anything with the procedure ??Hi,
You need to create a scheduler job which runs every night at midnight.
You need to use the dbms_scheduler.create_job call.
You can search online for examples or find Oracle's examples here
http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/scheduse002.htm#i1006395
There is a forum dedicated to dbms_scheduler here
Scheduler
-Ravi -
Problem with variable in scheduled job
I'm trying to get the following scheduled job to run:
switch(config)# scheduler job name backup_job
switch(config-job)# cli var name timestamp $(TIMESTAMP) ; copy running-config bootflash:/$(SWITCHNAME)-cfg.$(timestamp) ; copy bootflash:/$(SWITCHNAME)-cfg.$(timestamp) tftp://1.2.3.4/
switch(config-job)# exit
switch(config)# scheduler schedule name backup_timetable
switch(config-schedule)# job name backup_job
switch(config-schedule)# time daily 1:23
switch(config-schedule)# exit
switch(config)# exit
This job is taken directly from multiple Cisco MDS and Nexus documents. From what I can tell, the purpose of this job is to save the running configuration to a file on bootflash with date & time in the file name and then to copy the file from bootflash to tftp server.
I can create the job and schedule successfully:
switch(config)#show scheduler job name backup_job
Job Name: backup_job
cli var name timestamp $(TIMESTAMP)
copy running-config bootflash:/$(SWITCHNAME)-cfg.$(timestamp)
copy bootflash:/$(SWITCHNAME)-cfg.$(timestamp) tftp://1.2.3.4
==============================================================================
switch(config)#show scheduler schedule name backup_timetable
Schedule Name : backup_timetable
User Name : admin
Schedule Type : Run every day at 10 Hrs 48 Mins
Last Execution Time : Tue Mar 6 10:48:00 2012
Last Completion Time: Tue Mar 6 10:48:00 2012
Execution count : 1
Job Name Last Execution Status
backup_job Success (0)
==============================================================================
The scheduled job runs successfully but the files that are created have the variable $(TIMESTAMP) in the file name instead of the actual date and time e.g. switch-cfg.$(TIMESTAMP)
The logfile contains the following:
Schedule Name : backup_timetable User Name : admin
Completion time: Tue Mar 6 10:59:26 2012
--------------------------------- Job Output ---------------------------------
`cli var name timestamp $(TIMESTAMP)`
`copy running-config bootflash:/PEN-9509-2-cfg.$(TIMESTAMP) `
Copy complete, now saving to disk (please wait)...
`copy bootflash:/PEN-9509-2-cfg.$(TIMESTAMP) tftp://1.2.3.4 `
Trying to connect to tftp server......
Connection to server Established. Copying Started.....
It looks to me that the $(timestamp) variable is being created successfully and is being replaced with the $(TIMESTAMP) variable but this is not being replaced with the actual date and time.
The thing I don't get is that this looks to me that we're trying to nest variables and the same Cisco documents from which I get this configuration also state that nested variables are not allowed.
I have tried this on different hardware - MDS9500, MDS9100, Nexus 5000, Nexus 7000 and different software - SAN-OS 3.3, NX-OS 4.1, NX-OS 5.2 but cannot get it to work. I have also tried to put the commands in a script and run with the run-script command but it still does not work.
There is probably another method to achieve what this configuration is trying to achieve (and I would like to know if there is) but I want to know if this particular configuration will work.
Can anyone tell me if they have got this working or can see what I'm doing wrong or can try running this in a lab please?I managed to get this resolved with a bit of a workaround. If I put the copy commands in a script and pass the variable to the run-script command as part of the scheduled job then it works ok. Trying to create the variable within the script (or as a separate scheduled job command) still doesn’t work.
So, creating a script file (script) as follows:
copy running-config bootflash:/$(SWITCHNAME)-cfg.$(timestamp)
copy bootflash:/$(SWITCHNAME)-cfg.$(timestamp) tftp://1.2.3.4
and creating a scheduled job with the following command:
run-script bootflash:script timestamp=”$(TIMESTAMP)”
achieves the desired result. -
Bat file for running scheduled jobs
Hi
I am not entirely sure whether this is the correct forum to post this question, so apologies if I have posted this question in the wrong place.
Anyhow, I would like to know how to create two automated bat file scripts that will execute a PL/SQL package that will tell my Oracle 10g R2 database to run a scheduled job. Equally, I need another bat file to tell it to drop the scheduled job.
I already have a PL/SQL package that creates a schedule job using dbms_scheduler, and I can execute the scheduled job by going into SQL Plus running the execute command against the package. It is this latter bit, the execute part that I want to automate into bat file.
Can someone show me how to do this?I'm in complete agreement with Hans. Oracle has two facilities DBMS_JOB and DBMS_SCHEDULER neither of which benefits in any way be being called by a batch file.
What is your version number (all of it) and why are you considering this idea? -
Custom Schedule Job Issue - OIM 11g R2
Hi All,
I deployed a custom schedule task to assign a role to a user and created a schedule job for the same.
The problem is my job is executing twice even though I ran it for one time and getting exception saying Role already assigned..
please tell me how to make execute job only once on one execution
Thanks in advance
Praveen...sorry, for late reply...
I tried restarting servers... no luck....
1)java code
public class TerminateAbscondUsers extends TaskSupport
ODLLogger logger = ODLLogger.getODLLogger("OIMCP.SAPH");
UserManager usrMgr = Platform.getService(UserManager.class);
public HashMap getAttributes()
return null;
public void setAttributes()
public void execute(HashMap hashMap)
logger.info("Entered TerminateAbscondUsers:execute() method");
Long abscondDays = (Long)hashMap.get("AbscondDays");
logger.info("Abscond Days = "+ abscondDays);
List<User> resultUserList = getUserList();
disableUsers(resultUserList,abscondDays);
logger.info("Left TerminateAbscondUsers:execute() method");
public List<User> getUserList()
logger.info("Entered TerminateAbscondUsers:getUserList() method");
HashSet<String> reqAttr = new HashSet<String>();
reqAttr.add("User Login");
reqAttr.add("Status");
//reqAttr.add("EventDate");
reqAttr.add("DateOfAbsconding");
List<User> usrList = new ArrayList<User>();
SearchCriteria usrIDSearchCriteria = new SearchCriteria("Action","AB",SearchCriteria.Operator.EQUAL);
try
usrList = usrMgr.search(usrIDSearchCriteria,reqAttr,null);
logger.info("Absconded userList size ="+ usrList.size());
catch(UserSearchException use)
logger.info("UserSearchExecption = " + use.getMessage());
catch(Exception e)
logger.info("Exception TerminateAbscondUsers:getUserList() = " +Arrays.toString(e.getStackTrace()));
logger.info("Absconded usrList = " + usrList.toString());
logger.info("Left TerminateAbscondUsers:getUserList() method");
return usrList;
public void disableUsers(List<User> resultUserList, Long abscondDays)
logger.info("Entered TerminateAbscondUsers:disableUsers() method");
UserManagerResult localUserManagerResult1;
UserManagerResult localUserManagerResult2;
try
for(int i=0;i<resultUserList.size();i++)
String userLogin = resultUserList.get(i).getLogin();
logger.info("User Login = " + userLogin);
Long userKey = (Long)resultUserList.get(i).getAttribute("usr_key");
String strUsrKey = userKey.toString();
logger.info("User key = " + strUsrKey);
//Date abscondDate = (Date)resultUserList.get(i).getAttribute("EventDate");
Date abscondDate = (Date)resultUserList.get(i).getAttribute("DateOfAbsconding");
Date currentDate = new Date();
Long diffDate = (Long)((currentDate.getTime() - abscondDate.getTime())/(1000*60*60*24));
if( diffDate > abscondDays)
logger.info("diff date = " + diffDate);
User localUser = new User(strUsrKey);
localUser.setAttribute("End Date",(Object)currentDate);
localUser.setAttribute("Action","TE");
localUserManagerResult1 = usrMgr.modify(localUser);
logger.info("Set End Date operation status = " + localUserManagerResult1.getStatus());
localUserManagerResult2 = usrMgr.disable(userLogin,true);
logger.info("Terminate operation status = " + localUserManagerResult2.getStatus());
catch(ValidationFailedException vfe)
logger.info("ValidationFailedException = " + vfe.getMessage());
catch(UserDisableException ude)
logger.info("UserDisableException = " + ude.getMessage());
catch(NoSuchUserException nsue)
logger.info("NoSuchUserException = " + nsue.getMessage());
catch(UserModifyException ume)
logger.info("UserModifyException = " + ume.getMessage());
catch(Exception e)
logger.info("Exception TerminateAbscondUsers:getUserList() = " +Arrays.toString(e.getStackTrace()));
logger.info("Left TerminateAbscondUsers:disableUsers() method");
2) METADATA XML
<scheduledTasks xmlns="http://xmlns.oracle.com/oim/scheduler">
<task>
<name>Terminate Abscond Users</name>
<class>com.hdfclife.oracle.iam.customScheduler.user.TerminateAbscondUsers</class>
<description>Terminate Abscond Users</description>
<retry>5</retry>
<parameters>
<number-param required="true" helpText="No. of days since Absconded">AbscondDays</number-param>
</parameters>
</task>
</scheduledTasks>
Thanks in Advance...
Maybe you are looking for
-
Can I share my iCloud storage with family
I purchased 50 Gig of storage on iCloud for my daughter going off to college. I'm now wondering if other family members can all use that allotted space.
-
Cannot open old pdfs -- can anyone help?
Hi, I have a CD with some PDFs that were created in 2004 and cannot get them to open. I get the dreaded "...is either not a supported file type or because the file has been damaged..." message, which seems to result from a number of causes, none of w
-
Problem while using Comparison Operator 'CA' in select queries
Hi , I have written select query like this. SELECT * FROM rsdodso INTO TABLE gt_rsdodso WHERE odsobject CA s_obj-low. then I am getting error 'CA is not a valid comparison operator'. Would you please suggest me
-
Hello there, I am converting our not-transaction based application to use transactions. As I want to reduce the performance impact I am configuring some transactions to some lesser isolation levels. As far as I understand from the docs, the general w
-
The created pdf cannot be mapped by Informatica's Conversion Agent...
Hello Everybody, While adobe interactive pdf is being opened the following warning appear: Warning: This form is not supported with the current version of Acrobat or Adobe Reader. Upgrade to the latest version for full support. The adobe livecycle ve