Creating Generic Job..??
Hi,
Can we create a job which will be used as Generic (LIKE FUNCTIONS IN PROGRAMMING LANGUAGE)..?? Means i will create a job (ex. Taking Backup) and will use the same job (after storing in Job Library) to schedule many instances, with passing Database Instance Name as a parameter.
Many thanks.
The bare minimum for creating a job is Job Name, Agent/Adapter and a command. With REST API, I don't know if creating the job would allow you to inherit the Agent/Adapter from the parent or if you have to explicitly define it.
Michelle
Similar Messages
-
Hi Guru's
how to create a job in hyperion workspace . i have created one folder in which i want to create job .but i couldnt find the option to create job . in one of the environment consultant have made couple of job but in new environment i couldnt have to figure out how to create a job. Generic job to run shell script from workspace.
thanksHi,
Have a look here: http://codingwithhyperion.blogspot.com/2011/02/run-maxl-scripts-in-workspace.html
Regards,
Robb Salzmann -
I have create a Generic Job Application in Hyperion Workspace. The command template is $PROGRAM $PARAMS.
It works fine in simple circumstances ( eg. when I run a .cmd file with the content of ECHO 'Hello World', the output reflects the command).
But when I call another .exe or .cmd file within the .cmd file, it bombs out. In the example error below, I tried to run a file called PSInfo.
The system cannot find the path specified.
'PSInfo' is not recognized as an internal or external command,
operable program or batch file
Your assistance is greatly appreciated.
CheersTurns out the Reporting and Analysis agent was on a different server. Problem solved.
-
Error While creating a Job using JOB_OPEN
Hello,
I am trying to create a job in the output type of a standard transaction.
But the job creation is failing. While debugging the transaction in update mode, I found out that the JOB_OPEN is coming out in the 'COMMIT WORK'.
Is there any other way to create a job so that the program executes properly.
Thanis/Regards,
Abhijit Anandgaonkar.Hi,
create a RFC function module....and inside the function module...create the batch job..
in the output type processing program...call the RFC function module in background task..
Thanks
Naren -
How to create a job card and how to add waranty card in sales order
I have one scenario for CS.the scenario is realted to automotive industry. Basically its a trading industry of HCV,MCV,LCV apart from that they will do servicing also. First the customer comes for a service.he is having free services. he will have waranty for spare parts of the vehicle. once he comes for servicing first the executive will take complains from the customer after that a Job card will be issued to the customer. there his chasis no ,engine no and registration no will be there. once enter the chasis no entire customer details has to come. how many free services he is having for how many kilo meters.then job card will go to the spare parts dept.that dept will issue the spare parts.then they will invoice the customer. he will pay the payment.and finally the gate pass will be given to the customer to deliver the vehicle.
painful area is how to create a job card and how to add waranty in sales order.
Regards,
VenkatHi,
Have u resolved it then Please let me know !!! It is a very interesting problem and owuld like to know the solution...
Regards
Krishna -
Create Background Job after data saved in module
Hello,
I have a program that has a start selection screen with material group, you enter your data, execute. When it has finished you get a ALV of sales order with items where you can make changes to dates and other details and save. I would like to add a save in background option. Is this possible? I assume it would be difficult because of the container.. it uses a bapi to save sale orders...
The employees run this job which takes a little while.. at the end of the day.. they go home and of course SAP has timed out. If they can run it in the background then no problem....
Thanks,
AJwell, you can pass the data from the same to an other program and submit it in background.
Just create a job.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = gv_jobname
IMPORTING
jobcount = gv_jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc <> 0.
* no error required
ENDIF.
submit your program with job name and job count.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = gv_jobcount
jobname = gv_jobname
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
IF sy-subrc <> 0. -
hi
I have package with a procedure naming do_job which have to create a job using
dbms_job.submit the owner of this package is a user named "HOL" , but when I try to run this package (I create a public synonym for the package and I gave execute grant to "DES") with another user like "DES" does not create the job.
Can any body help me
ThanksHi,
For job scheduling tips and samples, you cannot beat Dr. Tim Hall:
http://www.oracle-base.com
He also has a book "Oracle Job Scheduling" with lots of working job scheduling examples, very nice:
http://www.rampant-books.com/book_2005_1_scheduling.htm
HTH . . .
Don Burleson
"root hog or die" -
Creating a Job to execute a .sh file
Hi,
I have an important issue creating a Job to execute a .sh file,
the .sh (start_execution.sh) contains a lot of random calls like this:
#!/bin/bash
. /home/crm/.bash_profile
. /home/crm/argentina/crm/crmdw/clusters/mt/mt_pull_push/start.sh
. /home/crm/argentina/crm/crmdw/clusters/ota/ota/start.sh
sqlplus dware/argu01@crmarg @/home/crm/crmdw/AR/exec_dw.sql "MT"
sqlplus dware/argu01@crmarg @/home/crm/crmdw/AR/exec_dw.sql "OTA"
sqlplus dware/argu01@crmarg @/home/crm/crmdw/AR/exec_dm.sql "DAILY_DOWNLOADS"then creating the next job
Begin
dbms_scheduler.create_job
(job_name=>'job_AR',
job_action=>'/home/crm/crmdw/AR/start_execution.sh',
number_of_arguments=>1,
job_type=>'executable',
start_date => SYSDATE,
repeat_interval => 'FREQ=MINUTELY; INTERVAL=20',
enabled=>false,
auto_drop => TRUE,
comments=> 'Run shell-script test_dbms_scheduler.sh');
dbms_scheduler.set_job_argument_value(job_name =>'job_AR', argument_position => 1, argument_value => 'Parameter passed from Oracle to Unix');
dbms_scheduler.enable('job_AR');
end;
/the system executes all process at the same time instead of one to one,
Is necessary the system executes one to one becouse is a Hierarchy of process with
corresponding dependencies.
what could I do to resolve the issue??
any ideas??
Thanks in advanced...the problem is the content of the .sh file(start_execution.sh) is generated ramdomly and automatically and the code is :
FUNCTION F_GET_EXECUTION_PLAN
CONN_STRING_TRG VARCHAR2--'dwa/arg@arg'
, EXEC_TEMP_DIR VARCHAR2--'/home/crm/crmdw/AR/'
) RETURN CLOB AS
BEGIN
DECLARE
v_conn_string_trg VARCHAR2(255);
v_exec_temp_dir VARCHAR2(255);
v_select_aux VARCHAR2(32767);
v_select CLOB := ' ';
v_process_type VARCHAR2(5);
v_process_name VARCHAR2(50);
v_location VARCHAR2(255);
v_result NUMBER := 0;
TYPE t_array IS TABLE OF VARCHAR2(255);
TYPE t_cursor IS REF CURSOR;
v_array t_array := t_array();
c1 t_cursor;
BEGIN
v_conn_string_trg := CONN_STRING_TRG;
v_exec_temp_dir := EXEC_TEMP_DIR;
DBMS_LOB.TRIM(v_select, 0);
DBMS_LOB.APPEND(v_select, '#!/bin/bash' || chr(13) || chr(10));
DBMS_LOB.APPEND(v_select, BASH_PROFILE || chr(13) || chr(10));
DBMS_LOB.APPEND(v_select, chr(13) || chr(10));
v_select_aux := '
SELECT A.process_type, b.process_name, b.LOCATION
FROM
SELECT process_type, process_id, LEVEL level2
FROM
SELECT process_type, process_id, dep_process_type, dep_process_id
FROM crmdw_master_dependencies
WHERE dependency_type <> ''PREVIOUS_DATE''
UNION ALL
SELECT process_type, process_id, NULL, NULL
FROM
SELECT ''STG'' process_type, ID process_id
FROM crmdw_master_stg
UNION ALL
SELECT ''DW'', ID
FROM crmdw_master_dw
UNION ALL
SELECT ''DM'', ID
FROM crmdw_master_dm
MINUS
SELECT d.process_type, d.process_id
FROM crmdw_master_dependencies d
START WITH dep_process_type IS NULL
CONNECT BY PRIOR process_type = dep_process_type
AND PRIOR process_id = dep_process_id
) a
INNER JOIN
SELECT 1 ordinal, ''STG'' process_type, s.ID process_id, s.process process_name, c.location, s.active
FROM crmdw_master_stg s
INNER JOIN crmdw_master_clusters c ON (c.id = s.id_cluster)
UNION ALL
SELECT 2, ''DW'', ID, process, ''' || v_exec_temp_dir || ''', active
FROM crmdw_master_dw
UNION ALL
SELECT 3, ''DM'', ID, process, ''' || v_exec_temp_dir || ''', active
FROM crmdw_master_dm
) b ON (A.process_type = b.process_type AND A.process_id = b.process_id)
WHERE b.active = 1
ORDER BY b.ordinal, a.level2
BEGIN
OPEN c1 FOR v_select_aux;
LOOP
FETCH c1 INTO v_process_type, v_process_name, v_location;
EXIT WHEN c1%NOTFOUND;
v_result := F_CHECK_NEED_TO_EXECUTE (
v_process_type
, v_process_name
IF (v_result = 1) THEN
IF (v_process_type = 'STG') THEN
v_select_aux := '. ' || nvl(v_location, '/') || lower(v_process_name) || '/start.sh';
ELSIF (v_process_type = 'DW') THEN
v_select_aux := 'sqlplus ' || v_conn_string_trg || ' @' || v_location || 'exec_dw.sql "' || v_process_name || '"';
ELSIF (v_process_type = 'DM') THEN
v_select_aux := 'sqlplus ' || v_conn_string_trg || ' @' || v_location || 'exec_dm.sql "' || v_process_name || '"';
ELSE
v_select_aux := '';
END IF;
IF (v_array.COUNT > 0) THEN
FOR i IN v_array.FIRST .. v_array.LAST LOOP
IF ((v_array.EXISTS(i)) AND (v_array(i) = v_select_aux)) THEN
v_array.DELETE(i);
EXIT;
END IF;
END LOOP;
END IF;
v_array.EXTEND;
v_array(v_array.LAST) := v_select_aux;
END IF;
END LOOP;
CLOSE c1;
FOR i IN v_array.FIRST .. v_array.LAST LOOP
IF (v_array.EXISTS(i)) THEN
DBMS_LOB.APPEND(v_select, v_array(i) || chr(13) || chr(10));
END IF;
END LOOP;
EXCEPTION
WHEN OTHERS THEN
DBMS_LOB.APPEND(v_select, chr(13) || chr(10));
END;
RETURN v_select;
END;
END F_GET_EXECUTION_PLAN; -
Creating a job and scheduling a job error in OEM
Hi, Everyone,
I am trying to create and schedule a job thru OEM. In the the pl/sql block provide i have given my code like this
begin
SET SERVEROUTPUT ON;
SPOOL C:\RFV_PROFILE_REPORT.LOG APPEND;
SELECT TO_CHAR(SYSDATE, 'DD/MM/YY HH24:MI:SS') FROM DUAL;
EXEC PAC_RFV_PROFILE_REPORT.CALL_ALL (200910);
SELECT TO_CHAR(SYSDATE, 'DD/MM/YY HH24:MI:SS') FROM DUAL;
SPOOL OFF;
end;
i have created the job and scheduled it but i am getting this error:
Error # 6550
Details ORA-06550: line 2, column 5: PL/SQL: ORA-00922: missing or invalid option ORA-06550: line 2, column 1: PL/SQL: SQL Statement ignored ORA-06550: line 3, column 7: PLS-00103: Encountered the symbol "C" when expecting one of the following: := . ( @ % ;
could anyone pls help as this is very urgent.
Thanks in advanceAh, the problem is you are confusing SQLPlus commands with PL/SQL.
SET SERVEROUTPUT ON; -- This is a SQLPlus command, not necessary here.
SPOOL C:\RFV_PROFILE_REPORT.LOG APPEND; -- This is a SQLPlus command, in PL/SQL to write out to a file you will need to call the UTL_FILE package to open a file for writing to. Except that the file you write to will appear on the database server, not your workstation, when the scheduled job runs.
SELECT TO_CHAR(SYSDATE, 'DD/MM/YY HH24:MI:SS') FROM DUAL; -- In PL/SQL you need to SELECT columns INTO variables FROM tables. But in fact I guess you want to write the time to file using UTL_FILE again. However, you don't really need to do this, since scheduler will log the start time and run duration itself.
EXEC PAC_RFV_PROFILE_REPORT.CALL_ALL (200910); -- This is the SQLPlus equivalent of the PL/SQL command:
BEGIN
PAC_RFV_PROFILE_REPORT.CALL_ALL (200910);
END;
SPOOL OFF; -- This is a SQLPlus command, not necessary here.
So to summarise, all you really need is:
BEGIN
PAC_RFV_PROFILE_REPORT.CALL_ALL (200910);
END;
And the scheduled job will log the start time and duration in the database, which you can find here:
SELECT * FROM USER_SCHEDULER_JOB_RUN_DETAILS -
Creating a job in schema when can't login in that schema
there is a requirement that I've to create a job in a schema, but i don't have that schema's password,but I've that server's SYSDBA's password,means I can login into SYS account as SYSDBA,
but I've to create a job in that schema.
how is it possible,
EXECUTE IMMEDIATE ' DECLARE '||
' X NUMBER; '||
' BEGIN '||
' SYS.Dbms_Job.SUBMIT '||
' ( job => X '||
' ,what =>'||''''||what ||''''||
' ,next_date => TO_DATE('||''''||next_date||''''||','||''''||'dd/mm/yyyy hh24:mi:ss'||''''||') '||
' ,INTERVAL => '||''''||intervl||''''||
',no_parse => TRUE '||
' );'||
'SYS.Dbms_Output.PUT_LINE('||''''||'Job Number is: '||''''||' || TO_CHAR(x)); '||
'END; ';
help requiredA desc on DBA_JOBS reveials the first three:
LOG_USER VARCHAR2(30) USER who was logged in when the job was submitted
PRIV_USER VARCHAR2(30) USER whose default privileges apply to this job
SCHEMA_USER VARCHAR2(30) select * from bar means select * from schema_user.bar Perhaps you could try chang_env:
Use the correct NLSENV, below is just an example:
begin
sys.dbms_ijob.change_env( JOB => 3
,LUSER => '<NEW USER>'
,PUSER => '<NEW USER>'
,CUSER => '<NEW USER>'
,NLSENV => 'NLS_LANGUAGE=''AMERICAN''
NLS_TERRITORY=''AMERICA''
NLS_CURRENCY=''$''
NLS_ISO_CURRENCY=''AMERICA''
NLS_NUMERIC_CHARACTERS=''.,''
NLS_DATE_FORMAT=''DD-MON-RR''
NLS_DATE_LANGUAGE=''AMERICAN''
NLS_SORT=''BINARY''');
end; -
Creating a job for a procedure with an input parameter
Hi,
I want to create a job for a procedure ( sp_proc ) with a input parameter.
The input parameter is a date value.
As per the syntax for dbms_job.submit procedure;
dbms_job.submit (
job IN BINARY_INTEGER,
what IN VARCHAR2,
next_date IN DATE,
interval IN VARCHAR2 DEFAULT 'NULL',
no_parse IN BOOLEAN DEFAULT FALSE);
How should the procedure be declared in the 'what' parameter of the dbms_job.submit procedure ?
Please guide.
Thanks.Hi,
You are wright, I have found this thread [DBMS_JOB -- how to pass parameters to the job|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:351033761220].
Regards, -
Creating backup Job with DBMS_SCHEDULER
Hello,
Can someone please help me out here:
I'm using Oracle10g release 1 on windowsXP
I'm trying to create a backup job with dbms_scheduler and it's not working.
This is what I did:
I created a job as follows:
BEGIN
dbms_scheduler.create_job (
job_name => 'RMAN_FULL',
job_type => 'EXCUTABLE',
job_action => 'E:\wkdir\rman_bkp',
enabled => TRUE,
start_date => '24-NOV-2007 2:10:00 PM',
repeat_interval => 'FREQ=WEEKLY',
comments => 'Full Database Backup');
END;
While rman_bkp is an RMAN command but it wasn't working.
Please where do I get it wrong?
Kindly put me through the EXECUTABLE or should I use PL/SQL_BLOCK and how?
Thanks.
Regards,
CherishHi,
There is a guide to running external jobs using the Scheduler here
Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
You need to use the full path to a real Windows executable and the arguments to it e.g. for a batch script you would have to do something like
c:\windows\cmd.exe /q /c c:\myscript.bat
There is a forum dedicated to the Scheduler here
Scheduler
Hope this helps,
Ravi. -
Creating a Job through scheduler
Hi.....
I need to create a job in oracle through scheduler.
Whether any job is there in bolt which will run every day from Monday to Friday for Every 1 Hour and Run From Morning 6.00 AM to 9.00 P.M.
Job should run
1) Daily ( Monday to Friday )
2) Every Hour
3) From 6.00 AM to 6.00 P.M.
Regards
YashavanthHi,
Try using
repeat_interval=>
'freq=daily;byday=MON,TUE,WED,THU,FRI;byhour=6,7,8,9,10,11,12,13,14,15,16,17,18;byminute=0; bysecond=0'
This should run Monday-Friday 6am to 6pm
Hope this helps,
Ravi. -
Hi,
This might sound really remedial, but can someone explain to me how I go about creating a job with arguments with programs. It errors out when I try to use DEFINE_PROGRAM_ARGUMENTS and when I try to use SET_JOB_ARGUMENTS_VALUE. Maybe it's the order I do it in. Any directions would be much appreciated. Thanks!
TonyHi Tony,
Almost any internal error is an Oracle bug and you should report this to support.
This is definitely not supposed to happen and I haven't seen this error before, do you have a test case throwing the error ?
Using program arguments should be fairly straightforward. Here's a simple example with two varchar2 arguments
-- create a stored procedure with two arguments
create or replace procedure myproc (arg1 in varchar2, arg2 in varchar2)
is BEGIN null; END;
-- create a program with two arguments and define both
begin
dbms_scheduler.create_program
program_name=>'myprog',
program_action=>'myproc',
program_type=>'STORED_PROCEDURE',
number_of_arguments=>2, enabled=>FALSE
dbms_scheduler.DEFINE_PROGRAM_ARGUMENT(
program_name=>'myprog',
argument_position=>1,
argument_type=>'VARCHAR2',
DEFAULT_VALUE=>'13');
dbms_scheduler.DEFINE_PROGRAM_ARGUMENT(
program_name=>'myprog',
argument_position=>2,
argument_type=>'VARCHAR2');
dbms_scheduler.enable('myprog');
end;
-- create a job pointing to a program and set both argument values
begin
dbms_scheduler.create_job('myjob',program_name=>'myprog');
dbms_scheduler.set_job_argument_value('myjob',1,'first arg');
dbms_scheduler.set_job_argument_value('myjob',2,'second arg');
dbms_scheduler.enable('myjob');
end;
Hope this helps,
Ravi.
-Ravi -
Creating a job that runs a Tcl script
Hi,
We currently have a scheduled job running a Tcl script on a 8.1.7 DB. My question is, can I still use the same setup in 10g DB (i.e. creating a job that runs Tcl script)? If I can, how am I gonna do it?
Thanks,
howieIt depends on how you scheduled the job in 8.1.7 DB.
By Cronjob? Yes you can do the same to connect to 10g
By DBMS_JOB?. Yes you can do it in 10g and in addition, can improve it with DBMS_SCHEDULER
Via OEM? Yes in can use Enterprise Manager to create a Job that runs the Script.
Maybe you are looking for
-
Firefox is not closing when I click on the X to close it, it seems to stay running in the background. So when I try to open it later I get a mesdsage that says FF is running, but is not showing up on my list of open programs. Windows XP. The only way
-
Start routine code for deleting records in different language
Hello, can someone please specify the exact code to be used in start routine, and whre exactly it needs to be pasted? this code is needed for master data notifaction type which is loaded for both languages German and English. german records are to be
-
Compare Hiredate with Current date in PCR
As per the requirement I have, a certain type of accrual needs to occur on the employee's anniversary date, this accrual should only happen on the first anniversary. How can I compare hire date with current date ignoring the year, and then ignoring t
-
Will 20D battery charger work with new "BP511A 2200 mAH batery?
Is my charger not working? Can I use 2200 mAh batteries with EOS 20D camera? If it wlll work, where should I get a new charger?
-
Mapping Items in XML string to multiple IDOC segments
I would like to map an XML tag <Text>Line1Line2Line3Line4</Text> to an IDOC segment E1ED1TEXT . Defined as occurring 0 to 999999. I would like to map each item separated by a tilde into a separate occurence of the IDOC text segment. Is ther anyway t