DBMS SCHEDULER: Job of type 'Chain' is failing
Hi,
I am using Oracle 10gR2 version. The job created on top of chain is failing for some reason. I couldn't trace the exact error. Please help me in debugging this as I am new to using dbms scheduler.
--Script I have used to create a chain
BEGIN
DBMS_SCHEDULER.create_chain (
chain_name => 'DAILY_JOB_CHAIN',
rule_set_name => NULL,
evaluation_interval => interval '5' minute ,
comments => 'Chain to run the daily jobs');
END;
--Script used to create a job and start it immediately.
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'daily_job_rerun',
job_type => 'CHAIN',
job_action => 'daily_job_chain',
start_date => SYSTIMESTAMP,
auto_drop => true,
enabled => TRUE);
END;
Soon after I ran the create_job procedure, the job has started immediately but is failing immediately without starting the chain. I have checked the USER_SCHEDULER_JOB_LOG table for errors. This is what is stored in the table.
LOG_ID JOB_NAME OPERATION STATUS ADDITIONAL_INFO
144835 DAILY_JOB_RERUN CHAIN_RUN FAILED CHAIN_LOG_ID="144834"
144834 DAILY_JOB_RERUN CHAIN_START RUNNING
Please help.
Edited by: user10626493 on Oct 22, 2009 11:45 PM
Chain rule for one of the chain steps has been changed and hence the job failed. After correcting the chain rule, the job has started fine.
Similar Messages
-
DBMS scheduler jobs running twice
Hi,
I have 4 DBMS scheduler jobs , which checks for a specific job status in DB and sends an email , when i started the schedule for the first week the jobs executed fine from next week I am getting two emails from each job , when i check the logs USER_SCHEDULER_JOB_RUN_DETAILS I see only one run , which seems weird to me so i disabled one job and left the three jobs in schedule , next time i got two emails from 3 jobs and one from disabled job . After checking logs i see that there is no entry of the disabled job execution . I am not sure where is the problem i can't find any log from where the disabled job executing. Please help me
Job schedule is to run every Saturday
Interval setup :
start_date => trunc(SYSDATE)+ 8.5/24,
repeat_interval => 'TRUNC(LEAST(NEXT_DAY(SYSDATE,''SATURDAY'') )) + 8.5/24'
SureshHi,
I tried to schedule the same jobs using DBMS_JOB but i still get the same problem , I created the procedure with all code in and scheduled it using dbms job , first day it run once second day it run twice ( sending two emails) Inow i am not sure if issue is with my code or scheduler
Procedure
Declare
v_count number;
v_Recipient VARCHAR2(400) := '[email protected]';
v_Subject VARCHAR2(80) := 'TEST_Email';
v_Mail_Host VARCHAR2(30) := 'localhost';
v_Mail_Conn utl_smtp.Connection;
crlf VARCHAR2(2) := chr(13)||chr(10);
BEGIN
select count(*) into v_count from TEC_CODERETURN@RPRD where interface like 'FOR002B' and trunc(rundate) =trunc(sysdate);
if v_count = 0
then
v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
utl_smtp.Rcpt(v_Mail_Conn, '[email protected]');
UTL_SMTP.OPEN_DATA(v_Mail_Conn);
utl_smtp.WRITE_RAW_DATA(v_Mail_Conn, UTL_RAW.CAST_TO_RAW(
'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || UTL_TCP.CRLF ||
'From: ' || '[email protected]' || UTL_TCP.CRLF ||
'Subject: '|| v_Subject || UTL_TCP.CRLF ||
'To: ' || v_Recipient || UTL_TCP.CRLF ||
'This is a test Alert'|| UTL_TCP.CRLF
UTL_SMTP.CLOSE_DATA(v_mail_conn);
utl_smtp.Quit(v_mail_conn);
end if;
EXCEPTION
WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
END;
DBMS job creation
DECLARE
jobno NUMBER;
BEGIN
DBMS_JOB.submit
(job => jobno,
what => 'TEST_ALERT;',
next_date => trunc(sysdate)+0.1/24,
interval => 'SYSDATE + 1',
no_parse => TRUE );
DBMS_OUTPUT.put_line ('Created Job - the job number is:' || TO_CHAR (jobno));
COMMIT;
END;
Suresh -
Cancel the scheduled jobs for process chains - urgent
Hi,
How do I cancel the scheduled jobs for process chains which are going to run tonight.
thanks,
RadhaHello,
Go into transaction code RSPC and then select the particular process chain by going into the edit mode and in the menu...
Look for Execution --> Remove from Schedule.
Let me know if that answered your question.
Thanks
Dharma. -
Hi,
I have created a dbms job as shown below for export backup, It was running fine on 10g. Recently I upgraded my database to 11g. since then that job is failing. Below is the error i am receiving while executing the job via toad as it is not getting triggered on time. If any 1 faced such issue kidly suggest.
BEGIN
SYS.DBMS_SCHEDULER.RUN_JOB
(job_name => 'SYS.EXPORT_DATAPUMP_JOB1'
,use_current_session => TRUE);
END;
Error at line 2
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
ORA-06512: at "SYS.DBMS_ISCHED", line 185
ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
ORA-06512: at line 2Hi,
Please find the output
SQL> SELECT additional_info FROM DBA_SCHEDULER_JOB_RUN_DETAILS WHERE job_name='EXPORT
ADDITIONAL_INFO
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ADDITIONAL_INFO
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
ADDITIONAL_INFO
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
ADDITIONAL_INFO
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ADDITIONAL_INFO
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ADDITIONAL_INFO
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
ADDITIONAL_INFO
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
ADDITIONAL_INFO
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ADDITIONAL_INFO
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ADDITIONAL_INFO
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
ADDITIONAL_INFO
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
ADDITIONAL_INFO
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file." -
Enable Oracle dbms scheduled jobs
Hi Gurus,
I need to enable a set of dbms jobs which got transferred as a result of exporting a 9i database and importing to 11g database.
They were running as scheduled jobs in old legacy database.
I can see them in SQL Developer under DBMS jobs but don't know how to enable them
Please help. My current Oracle version is 11g.
Thanks
Amitava.amitavachatterjee1975 wrote:
Hi Gurus,
I need to enable a set of dbms jobs which got transferred as a result of exporting a 9i database and importing to 11g database.
They were running as scheduled jobs in old legacy database.
I can see them in SQL Developer under DBMS jobs but don't know how to enable them
Please help. My current Oracle version is 11g.
Thanks
Amitava.
post SQL & results which show any of the jobs actually got transferred.
post SQL & results that show they are not scheduled or running now. -
Hi Folks,
I used expdp utility to export all Oracle scheduler jobs and chains with below method, after that generate sql script by impdp, later on executing sql script encountered some errors.
Only chain step and chain rule for executing script. Does anyone bright me some light? Thanks!
My env: Oracle 11g + Oracle Linux 5.5
My steps as below:
1. export(expdp) oracle scheduler job(chain)
2. generate sql script by impdp.
3. remove orginal scheduler job(chain)
4. execute sql script
5. job with no chain well but job with chain failed
[oracle@linux1 ~]$ expdp scott/tiger directory=db_dump_dir dumpfile=scott_job.dmp include=procobj:\" in \(select \
> name from sys.obj$ where type\# in \(46,59,66,67,68,69,72,74,79\)\)\" schemas=scott
Export: Release 11.2.0.1.0 - Production on Tue Dec 3 17:42:31 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
Starting "SCOTT"."SYS_EXPORT_SCHEMA_01": scott/******** directory=db_dump_dir dumpfile=scott_job.dmp include=procobj:" in (select name from sys.obj$ where type# in (46,59,66,67,68,69,72,74,79))" schemas=scott
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 0 KB
Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
/u03/database/usbo/BNR/dump/scott_job.dmp
Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at 17:42:54
[oracle@linux1 ~]$ impdp scott/tiger sqlfile=scott_job.sql directory=db_dump_dir dumpfile=scott_job.dmp logfile=imp_scott_job.log
Import: Release 11.2.0.1.0 - Production on Tue Dec 3 17:43:04 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
Master table "SCOTT"."SYS_SQL_FILE_FULL_01" successfully loaded/unloaded
Starting "SCOTT"."SYS_SQL_FILE_FULL_01": scott/******** sqlfile=scott_job.sql directory=db_dump_dir dumpfile=scott_job.dmp logfile=imp_scott_job.log
Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
Job "SCOTT"."SYS_SQL_FILE_FULL_01" successfully completed at 17:43:07
[oracle@linux1 ~]$ more /u03/database/usbo/BNR/dump/scott_job.
scott_job.dmp scott_job.sql
[oracle@linux1 ~]$ more /u03/database/usbo/BNR/dump/scott_job.sql
-- CONNECT SCOTT
ALTER SESSION SET EVENTS '10150 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10904 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '25475 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10407 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10851 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '22830 TRACE NAME CONTEXT FOREVER, LEVEL 192 ';
-- new object type path: SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
BEGIN
BEGIN
dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_1"','1=1',NULL, 'First link in the chain.',0,NULL);
END;
COMMIT;
END;
BEGIN
BEGIN
dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_2"',':"CHAIN_STEP_1".COMPLETED = ''TRUE''',NULL, 'Second link in the chain.',0,NULL);
END;
COMMIT;
END;
BEGIN
BEGIN
dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_3"',':"CHAIN_STEP_2".COMPLETED = ''TRUE''',NULL, 'Third link in the chain.',0,NULL);
END;
COMMIT;
END;
BEGIN
BEGIN
dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_4"',':"CHAIN_STEP_3".COMPLETED = ''TRUE''',NULL, 'End of the chain.',0,NULL);
END;
COMMIT;
END;
BEGIN
BEGIN
dbms_rule_imp_obj.import_rule_set('"SCHED_RULESET$1"','"SCHED_EV_CTX$1"',NULL, 0);
END;
COMMIT;
END;
BEGIN
dbms_scheduler.create_program('"TEST_PROC_1"','PLSQL_BLOCK',
'BEGIN
INSERT INTO tb_schduler (id, descr, cr_date)
VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_1'', SYSDATE);
COMMIT;
END;'
,0, TRUE,
'Program for first link in the chain.'
COMMIT;
END;
BEGIN
dbms_scheduler.create_program('"TEST_PROC_3"','PLSQL_BLOCK',
'BEGIN
INSERT INTO tb_schduler (id, descr, cr_date)
VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_3'', SYSDATE);
COMMIT;
END;'
,0, TRUE,
'Program for last link in the chain.'
COMMIT;
END;
BEGIN
dbms_scheduler.create_program('"TEST_PROC_2"','PLSQL_BLOCK',
'BEGIN
INSERT INTO tb_schduler (id, descr, cr_date)
VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_2'', SYSDATE);
COMMIT;
END;'
,0, TRUE,
'Program for second link in the chain.'
COMMIT;
END;
BEGIN
dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
, rule_set_name=>'"SCHED_RULESET$1" '
dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
COMMIT;
END;
BEGIN
dbms_scheduler.create_job('"TEST_CHAIN_1_JOB"',
job_type=>'CHAIN', job_action=>
'test_chain_1'
, number_of_arguments=>0,
start_date=>TO_TIMESTAMP_TZ('03-DEC-2013 05.38.56.718161000 PM +08:00','DD-MON-RRRR HH.MI.SSXFF AM TZR','NLS_DATE_LANGUAGE=english'), repeat_interval=>
'freq=minutely; interval=2'
, end_date=>TO_TIMESTAMP_TZ('03-DEC-2013 06.08.56.000000000 PM +08:00','DD-MON-RRRR HH.MI.SSXFF AM TZR','NLS_DATE_LANGUAGE=english'),
job_class=>'"DEFAULT_JOB_CLASS"', enabled=>FALSE, auto_drop=>TRUE,comments=>
NULL
COMMIT;
END;
[oracle@linux1 ~]$ export ORACLE_SID=usbo
[oracle@linux1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 3 17:44:43 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
sys@USBO> show parameter db_name
NAME TYPE VALUE
db_name string usbo
sys@USBO> conn scott/tiger;
Connected.
--remove job and chain.
scott@USBO> EXEC DBMS_SCHEDULER.drop_job(job_name => 'test_chain_1_job');
EXEC DBMS_SCHEDULER.drop_chain (chain_name => 'test_chain_1');
EXEC DBMS_SCHEDULER.drop_program (program_name => 'test_proc_1');
EXEC DBMS_SCHEDULER.drop_program (program_name => 'test_proc_2');
EXEC DBMS_SCHEDULER.drop_program (program_name => 'test_proc_3');
PL/SQL procedure successfully completed.
scott@USBO> @/u03/database/usbo/BNR/dump/scott_job.sql
Session altered.
Session altered.
Session altered.
Session altered.
Session altered.
Session altered.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
BEGIN
ERROR at line 1:
ORA-24150: evaluation context SCOTT.SCHED_EV_CTX$1 does not exist
ORA-06512: at "SYS.DBMS_RULEADM_INTERNAL", line 28
ORA-06512: at "SYS.DBMS_RULE_IMP_OBJ", line 40
ORA-06512: at line 3
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
BEGIN
ERROR at line 1:
ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.DBMS_ISCHED", line 1694
ORA-01403: no data found
ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
ORA-06512: at line 5
PL/SQL procedure successfully completed.Thanks all of you!
Hi DK2010,
I took some test that the data dict(dba_rule_sets/dba_evaluation_contexts) no any data returned after I had removed the job.
So I tried to create evaluation context and re-executed script(only exception setion.) the first error has gone. For the second still have some issue.
---->no any returned
scott@USBO> select * from dba_rule_sets where rule_set_owner='SCOTT';
no rows selected
scott@USBO> select * from dba_evaluation_contexts WHERE evaluation_context_owner='SCOTT';
no rows selected
-->add new EVALUATION CONTEXT
scott@USBO> exec DBMS_RULE_ADM.CREATE_EVALUATION_CONTEXT('SCOTT.SCHED_EV_CTX$1');
PL/SQL procedure successfully completed.
--->now it looks fine
scott@USBO> BEGIN
2 BEGIN
3 dbms_rule_imp_obj.import_rule_set('"SCHED_RULESET$1"','"SCHED_EV_CTX$1"',NULL, 0);
4 END;
5
6 COMMIT;
7 END;
8 /
PL/SQL procedure successfully completed.
--->add new rule set, it prompt aleady exists
scott@USBO> exec DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1')
BEGIN DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1'); END;
ERROR at line 1:
ORA-24153: rule set SCOTT.SCHED_RULESET$1 already exists
ORA-06512: at "SYS.DBMS_RULEADM_INTERNAL", line 28
ORA-06512: at "SYS.DBMS_RULE_ADM", line 138
ORA-06512: at line 1
-->chain rule still could not find.
scott@USBO> @job_chain_rules.sql
no rows selected
-->rerun
scott@USBO> BEGIN
2 dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
3 , rule_set_name=>'"SCHED_RULESET$1" '
4 );
5 dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
6 dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
7 dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
8 COMMIT;
9 END;
10 /
BEGIN
ERROR at line 1:
ORA-27477: "SCOTT.TEST_CHAIN_1" already exists
ORA-06512: at "SYS.DBMS_ISCHED", line 1148
ORA-06512: at "SYS.DBMS_SCHEDULER", line 1598
ORA-06512: at line 2
-->drop chain
scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1');
BEGIN dbms_scheduler.drop_chain('TEST_CHAIN_1'); END;
ERROR at line 1:
ORA-27479: Cannot drop "SCOTT.TEST_CHAIN_1" because other objects depend on it
ORA-06512: at "SYS.DBMS_ISCHED", line 1319
ORA-06512: at "SYS.DBMS_ISCHED", line 1222
ORA-06512: at "SYS.DBMS_SCHEDULER", line 1854
ORA-06512: at line 1
scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1',force=>TRUE);
PL/SQL procedure successfully completed.
scott@USBO> BEGIN
2 dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
3 , rule_set_name=>'"SCHED_RULESET$1" '
4 );
5 dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
6 dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
7 dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
8 COMMIT;
9 END;
10 /
BEGIN
ERROR at line 1:
ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist --->still returned no rule set
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.DBMS_ISCHED", line 1694
ORA-01403: no data found
ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
ORA-06512: at line 5
scott@USBO> exec DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1')
PL/SQL procedure successfully completed.
scott@USBO> BEGIN
2 dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
3 , rule_set_name=>'"SCHED_RULESET$1" '
4 );
5 dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
6 dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
7 dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
8 COMMIT;
9 END;
10 /
BEGIN
ERROR at line 1:
ORA-27477: "SCOTT.TEST_CHAIN_1" already exists
ORA-06512: at "SYS.DBMS_ISCHED", line 1148
ORA-06512: at "SYS.DBMS_SCHEDULER", line 1598
ORA-06512: at line 2
scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1',force=>TRUE);
PL/SQL procedure successfully completed.
scott@USBO> BEGIN
2 dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
3 , rule_set_name=>'"SCHED_RULESET$1" '
4 );
5 dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
6 dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
7 dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
8 COMMIT;
9 END;
10 /
BEGIN
ERROR at line 1:
ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.DBMS_ISCHED", line 1694
ORA-01403: no data found
ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
ORA-06512: at line 5
Would you like to give me more clue?
Thanks again. -
ORA-27369: job of type EXECUTABLE failed for scheduler
I help reg dbms scheduler in oracle.
I am getting below error when I call a shell script from procedure. Could you please help me out in this.
Steps Taken:
==========
1) Modified rdbms/admin/externaljob.ora file to add the below info
run_user = oracle
run_group = dba
2) And have changed the bin/extjob file must be permissions to 4750 (-rwsr-x---)
3) The shell script is having full permission(777) and is sending email to db email.
Error:
=====
ORA-27369: job of type EXECUTABLE failed with exit code: 274662
STANDARD_ERROR="Oracle Scheduler error: Config file is not owned by root or is writable by group or other or extjob is not setuid and owned by root"
Code:
=====
DBMS_SCHEDULER.create_job (
job_name => 'gatekeeper3',
job_type => 'EXECUTABLE',
job_action => '/home/cobr_sftp/var/download/test_abh.sh',
number_of_arguments => 0,
enabled => true,
--auto_drop => true,
comments => 'CREATE_PROGRAM test using a schell script'
Edited by: user11942774 on Sep 26, 2012 12:33 AMHi,
I have went through the below link and have maede the changes. But i am still getting the same error.
Could you please help me as to where i am going wrong.
Scheduler link: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
1) I have modified rdbms/admin/externaljob.ora file to add the below info
run_user = oracle
run_group = dba
2) And have changed the bin/extjob file must be permissions to 4750 (-rwsr-x---)
3) The shell script is having full permission(777) and is sending email to db email.
4) - bin/extjobo sfile should have normal 755 (rwxr-xr-x)
5) - bin/jssu should have setuid permissions i.e. with 4750 (-rwsr-x---) -
BO XI 3.1 Re-schedule failed scheduling job
Hi...
I am not sure if I am just unable to find matching resources, but maybe someone can just point in the right direction.
In a custom application, we have a scheduling overview, where we imitate some of the CMC behaviour.
Now I need to add a feature to restart failed scheduling jobs.
Some lines of pseudocode or a hint where I can find samples, documentation or anything will help.
Any help is appreciated.
Regards
JanHi Ryan,
Thanks for your reply. I have followed the same sequence but somehow the code is not functioning as expected.
<%@ page import = "com.crystaldecisions.sdk.occa.infostore.*" %>
<%@ page import = "com.crystaldecisions.sdk.framework.CrystalEnterprise" %>
<%@ page import = "com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import = "com.crystaldecisions.sdk.framework.IEnterpriseSession" %>
<%
// logon information
String boCmsName = "***" ;
String boUsername = "***" ;
String boPassword = "***" ;
String boAuthType = "secEnterprise" ;
// report
String reportName = "SDK_TEST" ;
// logon
IEnterpriseSession ceSession = CrystalEnterprise.getSessionMgr().logon( boUsername, boPassword, boCmsName, boAuthType ) ;
IInfoStore oInfoStore = (IInfoStore)ceSession.getService( "", "InfoStore" ) ;
IInfoObjects oInfoObjects = oInfoStore.query("select top 1 * from ci_infoobjects where SI_NAME='" + reportName + "' " );
IInfoObject oI = (IInfoObject) oInfoObjects.get(0);
IInfoObject oSched = (IInfoObject) oInfoObjects.get(0);
oSched.getSchedulingInfo().setRightNow(true);
oSched.getSchedulingInfo().setType(CeScheduleType.ONCE); oInfoStore.schedule(oInfoObjects);
%>
What is happening here is, report is getting scheduled but it is not sending mail/attachment unlike the original schedule instance.
Below are the details of the rescheduled instance
Quote:
Title: SDK_TEST
Document Type: Web Intelligence Report
Status Success
Destination: Default
Owner: ****
Creation Time: 5/15/2014 1:53 AM
Start Time: 5/15/2014 1:53 AM
End Time: 5/15/2014 1:53 AM
Duration: 3 sec
Server Used: mdwnew.AdaptiveJobServer
PID: 27131966
Parent Object Path: **********
Remote Instance in Federated Cluster: No
Expiry: 5/15/2024 1:53 AM
Formats: Web Intelligence
Now my doubt is can we reschedule the report directly or we need to get all the scheduling info like from/to/events etc and then apply them for the new schedule? I think it will be a tedious job as it could be SMTP or FTP or inbox or anything. -
ORA-27369: job of type EXECUTABLE failed with exit code: Not owner
Hi
I created a backup RAC database job using DBMS_SCHEDULER under RMANTEST schema (a DBA account) and I got the error as subject.
begin
dbms_scheduler.create_job(
job_name => 'scheduler_backup',
job_type => 'EXECUTABLE',
number_of_arguments => 2,
job_action => '/opt/oracle/admin/bin/rman_fullbackup_RAC_TEST_test.sh',
comments => 'backup via scheduler'
dbms_scheduler.SET_JOB_ARGUMENT_VALUE('scheduler_backup', 1, 'TEST');
dbms_scheduler.SET_JOB_ARGUMENT_VALUE('scheduler_backup', 2, 'TEST2');
dbms_scheduler.enable('scheduler_backup');
end;
Thanks,
KevinHi Ravi
Thanks for your input.
"ORA-27369: job of type EXECUTABLE failed with exit code: Not owner" is what I copied from ADDITIONAL_INFO of USER_SCHEDULER_JOB_RUB_DETAILS.
One thing I don't understand of your words is that
"On 10gR1 and 10gR2 you can redirect the stdout/stderr within your script and take a look at those log files."
In my script, I have log files but I cannot see it. I guess the job fails directly without hitting the redirection line in the script. Do you mean I shall write something like this
dbms_scheduler.create_job (
job_action => '/opt/oracle/admin/bin/backup.sh > backup.log'
Another one is
"make sure that the user that external jobs run as must be able to run your script"
But OS user and database user are two different accounts at different level.
I am using 10.2.0.2 RAC. The Unix script runs successfully every night. I just want to take advantage of DBMS_SCHEDULER to avoid host dependency.
Thanks,
Kevin -
ORA-27369: job of type EXECUTABLE failed with exit code: 274662
I am trying to run a shell script through dbms_scheduler. The Shell scripts calls the oracle procedure which insert a record to the Debug table.
Code for generating the script
declare
begin
dbms_scheduler.create_job(
job_name=>'test_call_unix'
,job_type=>'executable'
,job_action=>'/carsd/Input/Current/BAM/calling_proc.sh'
,start_date => SYSDATE
,repeat_interval => 'FREQ=SECONDLY; INTERVAL=1'
,enabled=>TRUE
,auto_drop => TRUE
,comments=> 'Calling unxi sh'
end;
the shell script (calling_proc.sh)
touch called.log
sqlplus $ORA_USER/$ORA_PWD@$ORA_HOST << EOF1
exec p1_sh;
exit;
EOF1
I gave chmod 777 calling_proc.sh
this the error which i got in ALL_SCHEDULER_JOB_RUN_DETAILS table
ORA-27369: job of type EXECUTABLE failed with exit code: 274662
STANDARD_ERROR="Oracle Scheduler error: Config file is not owned by root or is writable by group or other or extjob is not setuid and owned by root"
Thanks in advance
Jeeva.STANDARD_ERROR="Oracle Scheduler error: Config file is not owned by root or is writable by group or other or extjob is not setuid and owned by root"
I gave chmod 777 calling_proc.sh
comply with top line message! -
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function
Hello,
I am calling a windows bat file using dbms_scheduler and getting the following error. I have searched the forum and the internet and tried different switches and options. None of them solved my problem.
Oracle Version: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
OracleJobScheduler is running as a service
Error starting at line 1 in command:
execute GET_RESULTS();
Error report:
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
ORA-06512: at "SYS.DBMS_ISCHED", line 185
ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
ORA-06512: at "PS.GET_RESULTS", line 67
ORA-06512: at line 1
27369. 00000 - "job of type EXECUTABLE failed with exit code: %s"
*Cause: A problem was encountered while running a job of type EXECUTABLE.
The cause of the actual problem is identified by the exit code.
*Action: Correct the cause of the exit code and reschedule the job.
Here is the code for scheduler
dbms_output.put_line(os_commandline || utlPath || fileSeparator || 'get.bat >nul')
dbms_scheduler.create_job
( job_name =>'PS_GET_RESULTS'
, job_action => os_commandline || utlPath || fileSeparator || 'get.bat >nul'
, job_type =>'executable'
, enabled =>false
, auto_drop =>false
, start_date =>systimestamp
dbms_scheduler.run_job(job_name =>'PS_GET_RESULTS');The dbs_output prints a line which shows that the parameters os_commandline, utlPath and fileSeparator are set correctly.
C:\windows\system32\cmd.exe /q /c E:\UTLDir\get.bat >nulThe windows file (get.bat) is:
"C:\Program Files (x86)\WinSCP\Winscp.exe" /script=e:\utldir\get_resultsThis batch file passes a script file to the executable winscp.exe to get files from another server.
The script file (get_results) is:
option batch abort
option confirm off
open sftp://username:password@ipnumber:port -hostkey="ssh-rsa 1024 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
cd /usr/dropbox/
option transfer binary
get *.results E:\UTLDir\Results\
close
exitI tested the batch file directly and works fine and "gets" the files from the server. But, invoking from Oracle dbms_scheduler fails with ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
Appreciate your help and time in suggesting additional guidelines or pointers.
Thanks,
RoseHere is an update, if somebody else is having a similar problem.
The ftp command "cd" to change the directories should be an absolute path. I was given a path "/usr/dropbox/", but on the server it actually corresponds to "/usr/local/apps/dropbox/". After updating the directory path, the scheduler worked fine in invoking the batch file for transferring the files.
Thanks,
Rose -
ORA-27369: job of type EXECUTABLE failed with exit code:Operation notpermit
I am getting this error
ORA-27369: job of type EXECUTABLE failed with exit code: Operation not permitted.
We have been using this for such a long time without any problems.this is the plsql scheduler :
Please help
BEGIN
SYS.DBMS_SCHEDULER.CREATE_JOB
job_name => 'PROD_LOAD_SL_FILES'
,start_date => TO_TIMESTAMP_TZ('2005/12/02 17:05:00.000000 -05:00','yyyy/mm/dd hh24:mi:ss.ff tzh:tzm')
,repeat_interval => NULL
,end_date => NULL
,job_class => 'DEFAULT_JOB_CLASS'
,job_type => 'EXECUTABLE'
,job_action => '/home/oracle/actual/payment_files/slc_prod/load_sl_files.sh'
,comments => 'Loads SL files, uploads logs to database and sends email to Disbursement and DBA teams'
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'RESTARTABLE'
,value => FALSE);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'LOGGING_LEVEL'
,value => SYS.DBMS_SCHEDULER.LOGGING_RUNS);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'MAX_FAILURES');
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'MAX_RUNS');
BEGIN
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'STOP_ON_WINDOW_CLOSE'
,value => FALSE);
EXCEPTION
-- could fail if program is of type EXECUTABLE...
WHEN OTHERS THEN
NULL;
END;
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'JOB_PRIORITY'
,value => 1);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'SCHEDULE_LIMIT');
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'AUTO_DROP'
,value => FALSE);
END;
and this is part of the unix script get executed:
[oracle@USAC-S009 slc_prod]$ cat load_sl_files.sh
#!/bin/sh
# FILEME: /home/oracle/actual/paytment_files/load_sl_files.sh
# PURPOSE: Load SL files, email .log files
# INSTRUCTIONS/COMMENTS/ASSUMPTIONS: Two SL files will be pulled down
# MAINTENANCE LOG
# REV# DATE AUTHOR QA-ed BY CHANGE DESCRIPTION KEY
DATE=`/bin/date +%d%b%y_%H%M`
HOME=/home/oracle
export HOME
ORACLE_HOME=/u01/app/oracle/product/10.2
export ORACLE_HOME
ORACLE_SID=em
export ORACLE_SID
PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/bin:/etc:/usr/local/bin:/u01/app/oracle/product/10.2/bin:/bin:/sbin:/usr/bin:/usr/sbin; export PATH
SL_HOME=/home/oracle/actual/payment_files/slc_prod
FILE_HOME=/opt/u02/home/usair
# Call slc.sh to load files
ssh usac09.usacad.loc > /home/oracle/actual/payment_files/slc_prod/slc.sh.log <<EOT
/u01/app/oracle/slc.sh 2>&1
sleep 120
EOT
# Move logs from usac09 to usac-s009
#ssh usac09.usacad.loc >> /home/oracle/actual/payment_files/slc_prod/slc.sh.log <<EOT
# /u01/app/oracle/move_logs.sh 2>&1
# sleep 15
#EOT
.............Hi!
I have shell scripts with number of mandatory parameters.
How can I write it in sql procedure in order to create exact command line that shuold be executed in Linux?
the procedure looks like :
CREATE OR REPLACE procedure CRM.run_tts (p_tts_name in varchar2 )
is
v_tts_name varchar2(2000);
v_job_name varchar2(2000);
v_source varchar2(200);
v_target varchar2(200);
Begin
v_tts_name := upper(p_tts_name);
--if p_instance_type='P' then
v_source := 'psdwh';
v_target := 'pudwh';
--end if;
if v_tts_name is not null then
v_job_name := 'run_tts_'||v_tts_name;
v_source := '/-ssid/'||v_source;
v_target := '/-tsid/'||v_target;
v_tts_name := '/-tbsname/'||v_tts_name;
DBMS_SCHEDULER.create_job (
job_name => v_job_name,
job_type => 'EXECUTABLE',
job_action => '/tmp/trans_asm',
start_date => SYSTIMESTAMP,
number_of_arguments => 3,
enabled => false,
auto_drop => false);
--dbms_scheduler.set_job_argument_value(job_name=>v_job_name,argument_position=>1,argument_value=>'/software/oracle/dba/scripts/bin/trans_asm.sh'||' '||c_rec.id||' '||'"'||c_rec.view_name||'"'||' '||v_setnum||' '||'"'||V_MACHINE_TYPE||'"'||' '||'"'||p_mode||'"');
dbms_scheduler.set_job_argument_value(job_name=>v_job_name,argument_position=>1,argument_value=>v_source);
dbms_scheduler.set_job_argument_value(job_name=>v_job_name,argument_position=>2,argument_value=>v_target);
dbms_scheduler.set_job_argument_value(job_name=>v_job_name,argument_position=>3,argument_value=>v_tts_name);
-- dbms_scheduler.set_job_argument_value(job_name=>v_job_name,argument_position=>1,argument_value=>'/software/oracle/dba/scripts/bin/trans_asm_ps.sh');
--dbms_scheduler.set_job_argument_value(job_name=>v_job_name,argument_position=>1,argument_value=>'/tmp/test.sh');
-- trans_asm -ssid tsdwh -tsid tudwh -tbsname DW_BILLING_TTS
dbms_scheduler.enable(name=>v_job_name);
end if;
end;
the command looks like :
trans_asm -ssid psdwh -tsid pudwh -tbsname YOAV_TTS
Thank you !
Valerie -
ORA-27369: job of type EXECUTABLE failed with exit code
am getting this error
ORA-27369: job of type EXECUTABLE failed with exit code: Operation not permitted.
We have been using this for such a long time without any problems.this is the plsql scheduler :
Please help
BEGIN
SYS.DBMS_SCHEDULER.CREATE_JOB
job_name => 'PROD_LOAD_SL_FILES'
,start_date => TO_TIMESTAMP_TZ('2005/12/02 17:05:00.000000 -05:00','yyyy/mm/dd hh24:mi:ss.ff tzh:tzm')
,repeat_interval => NULL
,end_date => NULL
,job_class => 'DEFAULT_JOB_CLASS'
,job_type => 'EXECUTABLE'
,job_action => '/home/oracle/actual/payment_files/slc_prod/load_sl_files.sh'
,comments => 'Loads SL files, uploads logs to database and sends email to Disbursement and DBA teams'
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'RESTARTABLE'
,value => FALSE);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'LOGGING_LEVEL'
,value => SYS.DBMS_SCHEDULER.LOGGING_RUNS);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'MAX_FAILURES');
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'MAX_RUNS');
BEGIN
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'STOP_ON_WINDOW_CLOSE'
,value => FALSE);
EXCEPTION
-- could fail if program is of type EXECUTABLE...
WHEN OTHERS THEN
NULL;
END;
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'JOB_PRIORITY'
,value => 1);
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'SCHEDULE_LIMIT');
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'PROD_LOAD_SL_FILES'
,attribute => 'AUTO_DROP'
,value => FALSE);
END;
and this is part of the unix script get executed:
[oracle@USAC-S009 slc_prod]$ cat load_sl_files.sh
#!/bin/sh
# FILEME: /home/oracle/actual/paytment_files/load_sl_files.sh
# PURPOSE: Load SL files, email .log files
# INSTRUCTIONS/COMMENTS/ASSUMPTIONS: Two SL files will be pulled down
# MAINTENANCE LOG
# REV# DATE AUTHOR QA-ed BY CHANGE DESCRIPTION KEY
DATE=`/bin/date +%d%b%y_%H%M`
HOME=/home/oracle
export HOME
ORACLE_HOME=/u01/app/oracle/product/10.2
export ORACLE_HOME
ORACLE_SID=em
export ORACLE_SID
PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/bin:/etc:/usr/local/bin:/u01/app/oracle/product/10.2/bin:/bin:/sbin:/usr/bin:/usr/sbin; export PATH
SL_HOME=/home/oracle/actual/payment_files/slc_prod
FILE_HOME=/opt/u02/home/usair
# Call slc.sh to load files
ssh usac09.usacad.loc > /home/oracle/actual/payment_files/slc_prod/slc.sh.log <<EOT
/u01/app/oracle/slc.sh 2>&1
sleep 120
EOT
.............Hi,
The user oracle who owns the scheduler already has permissions for the mailx and the same script is able to send notifications when run manully. Do I need to set additional permissions for scheduler ?
Also the db version is 10.2.0.5.
Thanks -
ORA-27369: job of type EXECUTABLE failed with exit code: Unknown error
Hello DBAs,
I am trying to schedule a shell script through dbms_scheduler.CREATE_JOB
My database version is 10.2.0.3.0.
I can successfully schedule the job, but while running, it throwing ORA-27369 with out exit code.
Given below are the actions performed -
-- Created shel scripts-
$ cat shell01.sh
./test.sh >> test.log
$
$ cat test.sh
sqlplus -s "/ as sysdba" <<EOF
SELECT SUBSTR(host_name,0,10) host_name, instance_name, status,TO_CHAR(startup_time,'dd-mm-yy hh24:mi:ss') startup_time
FROM v\$instance;
disconnect;
exit;
EOF
-- Granting privileges - (eventhough I have tried from 'SYS' schema)
GRANT create Job, create external job, execute any class, execute any program , manage scheduler to sys;
-- Drop job with name RUN_SHELL01
BEGIN
dbms_scheduler.drop_job('RUN_SHELL01');
END;
-- Schedule job with name RUN_SHELL01
BEGIN
dbms_scheduler.CREATE_JOB
(job_name => 'RUN_SHELL01',
job_type => 'EXECUTABLE',
job_action => '/home/ora1023/shell01.sh',
start_date => '18-AUG-09 05:37:00 AM',
end_date => NULL,
repeat_interval => 'FREQ=MINUTELY',
enabled => false,
comments => 'Run shell-script');
END;
--Enable job
BEGIN
dbms_scheduler.enable('RUN_SHELL01');
END;
-- Checking status
SELECT owner, job_name, enabled FROM dba_scheduler_jobs;
select JOB_NAME,STATUS,ERROR# from dba_scheduler_job_run_details where job_name='RUN_SHELL01';
-- Executing the job
SQL> exec dbms_scheduler.run_job('RUN_SHELL01');
BEGIN dbms_scheduler.run_job('RUN_SHELL01'); END;
ERROR at line 1:
ORA-27369: job of type EXECUTABLE failed with exit code: Unknown error
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 1
Anybody please suggest a solutions for this -My shell script will work as below -
user01@test01:/home/user01 : cat shell01.sh
./test.sh >> test.log
user01@test01:/home/user01 :
user01@test01:/home/user01 :
user01@test01:/home/user01 : cat test.sh
sqlplus -s "/ as sysdba" <<EOF
SELECT SUBSTR(host_name,0,10) host_name, instance_name, status,TO_CHAR(startup_time,'dd-mm-yy hh24:mi:ss') startup_time
FROM v\$instance;
disconnect;
exit;
EOF
user01@test01:/home/user01 : ./shell01.sh
user01@test01:/home/user01 : ls -ltr
-rw-r--r-- 1 ora1023 dba 155 Aug 26 05:28 test.log
user01@test01:/home/user01 : cat test.log
HOST_NAME INSTANCE_NAME STATUS STARTUP_TIME
test01 oft1 OPEN 18-08-09 08:22:45
user01@test01:/home/user01 :
** I think this shell script is working fine! ..its only for testing..
and while we are querying dba_scheduler_job_run_details for additional info-
SQL> select s.STATUS ,s.ADDITIONAL_INFO from dba_scheduler_job_run_details s where s.job_name='RUN_SHELL01';
STATUS
ADDITIONAL_INFO
STANDARD_ERROR="execve: Exec format error"
FAILED
ORA-27369: job of type EXECUTABLE failed with exit code: Unknown error
STANDARD_ERROR="execve: Exec format error"
I think Metalink Doc ID: 555160.1 (Schedular Job of Type 'EXECUTABLE' Fails with ORA-27369 "exit code: 255" STANDARD_ERROR="execve: Exec format error"). Will help me to solve this issue Since i am using ksh -
# echo $SHELL
/bin/ksh
Edited by: Rajesh Menon on Aug 25, 2009 9:21 PM -
ORA-27369: job of type EXECUTABLE failed with exit code: Is a name file
I am getting this error when I try to execute a file using /bin/sh , I create the file, do a chmod on the file and remove the file but I am have trouble executing it even though I can execute it form the command line.
ORA-27369: job of type EXECUTABLE failed with exit code: Is a name file
STANDARD_ERROR="Segmentation Fault"
139
EXTERNAL_LOG_ID="job_77927_1275",
ORA-27369: job of type EXECUTABLE failed with exit code: Transport endpoint is n
ot connected
STANDARD_ERROR="Abort - core dumped
here is the code
DBMS_SCHEDULER.CREATE_JOB(job_name=>'CHMOD_ON_CCL',
job_type=>'EXECUTABLE',
job_action=>'/bin/chmod',
number_of_arguments=>2,
enabled=>false,
auto_drop=>true);
DBMS_SCHEDULER.set_attribute('CHMOD_ON_CCL', 'credential_name', 'SCHED_USER');
DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(job_name=>'CHMOD_ON_CCL',
argument_position=>1,
argument_value=>'777');
DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(job_name=>'CHMOD_ON_CCL',
argument_position=>2,
argument_value=>l_directory || '/' || loc_file_name);
DBMS_SCHEDULER.ENABLE('CHMOD_ON_CCL');
--execute the CCL file, this will run the scheduler
DBMS_SCHEDULER.CREATE_JOB(job_name=>'EXECUTE_CCL',
job_type=>'EXECUTABLE',
job_action=>'/bin/sh',
number_of_arguments=>1,
enabled=>false,
auto_drop=>true);
DBMS_SCHEDULER.set_attribute('EXECUTE_CCL', 'credential_name', 'SCHED_USER');
DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(job_name=>'EXECUTE_CCL',
argument_position=>1,
argument_value=>l_directory || '/' || loc_file_name);
DBMS_SCHEDULER.ENABLE('EXECUTE_CCL');
--remove CCL file after scheudler runs
DBMS_SCHEDULER.CREATE_JOB(job_name=>'REMOVE_CCL',
job_type=>'EXECUTABLE',
job_action=>'/bin/rm',
number_of_arguments=>1,
enabled=>false,
auto_drop=>true);
DBMS_SCHEDULER.set_attribute('REMOVE_CCL', 'credential_name', 'SCHED_USER');
DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(job_name=>'REMOVE_CCL',
argument_position=>1,
argument_value=>l_directory || '/' || loc_file_name);
DBMS_SCHEDULER.ENABLE('REMOVE_CCL');
"No problem at all, you can do the same by getting the output from env and unset the variables that are defined there manually. Start with
unset PATH
unset ORACLE_HOME
unset LD_LIBRATY_PATH
ad start your script again from this environment. The scheduler launches the jobs in an environment where hardly any variable is defined.
R.
Maybe you are looking for
-
I go to download and everything seems fine, even in the destination folder. Then once complete it disappears and is not on computer. I have done all the suggestions and reset configurations.
-
We receive the following message when we try to install fix packs 4.1 and 4.2. The fix pack will correct issues identified with the installation of service pack 4. The error message states: "Some installation files are corrupt. Please download a fre
-
Post Processing: Not Really Working
Ok now that I've spent 2 hours trying to set up an automation that would save me time Im throwing up my hands... Im trying to add a sharpening Action (to happen after resizing) to my export routine in LR. (Which should be built in to LR) I have creat
-
For reasons that are unclear to me I sometimes close Firefox and later re-open it. In some cases ALL the tabs and tab groups are gone. Today it opened in MSN.com and ALL tabs were gone. I put a lot of pages on these and have NO WAY to find them all a
-
My old PC has taken a fall and I am transferring to a new PC with Windows 7. What do I have to do to install my Adobe Pro Subscription on the new PC?