Procedure from Oracle Job

Hi I am having an Oracle procedure which is executing fine when It's called from sql.
But the same procedure gets stuck and doesn't complete when called from Job. what could be the reason? How to debug dbms job?
Thanks

user625850 wrote:
Hi I am having an Oracle procedure which is executing fine when It's called from sql.
But the same procedure gets stuck and doesn't complete when called from Job. what could be the reason? How to debug dbms job?
ThanksThere could be many problems.
1. You can check if there are any Blocking sessions that are preventing the execution of Job. You can check for it in V$SESSION_WAIT.
2. Check if the Interval of Jobs is adequately spaced so that the Jobs do not overlap. This may also result in the problem stated in point 1.
3. See if the Jobs have Failure report. you can use USER_SCHEDULER_JOBS.FAILURE_COUNT to verify. FAILURE_COUNT other than 0 indicates failure in execution.
4. To debug the Job, You can create a Logging Procedure that is executed in Autonomous Transaction mode, and Logs the JOB_ID and some unique text that allows you to Trace the execution of Job.
These would be the points I would check first, had I been in a similar situation.
If you can provide the Procedure that is getting stuck, maybe volunteers here could help you (Provided the procedure space only a few lines :) ).
Moreover, If you can provide the Information in the Link mentioned by SB92075 above, it would be helpful for you as well as us.

Similar Messages

  • How to call a sql server stored procedure from oracle

    Hi all,
    Please anybody tell me how to call a sql server stored procedure from oracle.
    I've made an hsodbc connection and i can do insert, update, fetch data in sql server from oracle. But calling SP gives error. when I tried an SP at oracle that has line like
    "dbo"."CreateReceipt"@hsa
    where CreateReceipt is the SP of sql server and hsa is the DSN, it gives the error that "dbo"."CreateReceipt" should be declared.
    my database version is 10g
    Please help me how can i call it... I need to pass some parameters too to the SP
    thanking you

    hi,
    thank you for the response.
    when i call the sp using DBMS_HS_PASSTHROUGH, without parameters it works successfully, but with parameters it gives the following error
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC][Microsoft][ODBC SQL Server Driver]Invalid parameter number[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index (SQL State: S1093; SQL Code: 0)
    my code is,
    declare
    c INTEGER;
    nr INTEGER;
    begin
    c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@hsa;
    DBMS_HS_PASSTHROUGH.PARSE@hsa(c, 'Create_Receipt(?,?)');
    DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,1,'abc');
    DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,2,'xyz');
    nr:=DBMS_HS_PASSTHROUGH.EXECUTE_NON_QUERY@hsa(c);
    DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@hsa(c);
    end;
    Create_Receipt is the sp which requires two parameters.
    please give me a solution
    thanking you
    sreejith

  • How to create java stored procedure from oracle(Dastageer)

    how to create java stored procedure from oracle-please help me to create the procedure.

    Hi,
    This forum is exclusively for discussions related to Sun Java Studio Creator. Please post your question in the appropriate forum.
    Thanks,
    RK.

  • Calling a procedure from Oracle Forms with OUT parameter

    HI,
    Can anyone tell me in detail how to call a procedure with OUT parameters from Oracle Forms 6i ?
    Thanks in advance.

    Hello,
    Just provide the out parameter in the call:
    Declare
      amount   number; -- OUT number argument populated by the procedure
    Begin
      -- call the X procedure --
      x( amount ) ;
    End;Francois

  • Calling Stored Procedure from Oracle DataBase using Sender JDBC (JDBC-JMS)

    Hi All,
    We have requirement to move the data from Database to Queue (Interface Flow: JDBC -> JMS).
    Database is Oracle.
    *Based on Event, data will be triggered into two tables: XX & YY. This event occurs twice daily.
    Take one field: 'aa' in XX and compare it with the field: 'pp' in YY.
    If both are equal, then
         if the field: 'qq' in YY table equals to "Add" then take the data from the view table: 'Add_View'.
         else  if the field: 'qq' in YY table equals to "Modify"  then take the data from the view table: 'Modify_View'.
    Finally, We need to archive the selected data from the respective view table.*
    From each table, data will come differently, means with different field names.
    I thought of call Stored Procedure from Sender JDBC Adapter for the above requirement.
    But I heard that, we cannot call stored procedure in Oracle through Sender JDBC as it returns Cursor instead of ResultSet.
    Is there any way other than Stored Procedure?
    How to handle Data Types as data is coming from two different tables?
    Can we create one data type for two tables?
    Is BPM required for this to collect data from two different tables?
    Can somebody guide me on how to handle this?
    Waiting eagerly for help which will be rewarded.
    Thanks and Regards,
    Jyothirmayi.

    Hi Gopal,
    Thank you for your reply.
    >Is there any way other than Stored Procedure?
    Can you try configuring sender adapter to poll the data in intervals. You can configure Automatic TIme planning (ATP) in the sender jdbc channel.
    I need to select the data from different tables based on some conditions. Let me simplify that.
    Suppose Table1 contains 'n' no of rows. For each row, I need to test two conditions where only one condition will be satisfied. If 1st condition is satisfied, then data needs to be taken from Table2 else data needs to be taken from Table3.
    How can we meet this by configuring sender adapter with ATP?
    ================================================================================================
    >How to handle Data Types as data is coming from two different tables?
    If you use join query in the select statement field of the channel then whatever you need select fields will be returned. This might be fields of two tables. your datatype fields are combination of two diff table.
    we need to take data only from one table at a time. It is not join of two tables.
    ================================================================================================
    Thanks,
    Jyothirmayi.

  • Calling stored procedure From Oracle BAM 11g Reports ???

    Is it possible to pass user prompt value from oracle bam11g report  to the stored procedure  as parameter and get data from database and display report on that? 
    Reagrds,
    Ravi yadav

    Hi Gopal,
    Thank you for your reply.
    >Is there any way other than Stored Procedure?
    Can you try configuring sender adapter to poll the data in intervals. You can configure Automatic TIme planning (ATP) in the sender jdbc channel.
    I need to select the data from different tables based on some conditions. Let me simplify that.
    Suppose Table1 contains 'n' no of rows. For each row, I need to test two conditions where only one condition will be satisfied. If 1st condition is satisfied, then data needs to be taken from Table2 else data needs to be taken from Table3.
    How can we meet this by configuring sender adapter with ATP?
    ================================================================================================
    >How to handle Data Types as data is coming from two different tables?
    If you use join query in the select statement field of the channel then whatever you need select fields will be returned. This might be fields of two tables. your datatype fields are combination of two diff table.
    we need to take data only from one table at a time. It is not join of two tables.
    ================================================================================================
    Thanks,
    Jyothirmayi.

  • How to call MSSQL stored procedure from oracle database

    MSSQL and Oracle databases are linked thru ODBC link using Oracle HSODBC.
    I can query MSSQL table or view from Oracle Database using standard notation for acessing remote objects schema.object@dblink_name...
    Can anybody give me syntax for calling MSSQL stored procedure thru ODBC database link?
    I tried syntax exec schema.stored_procedure@dblink_name but it doesn't work...i'm getting schema.stored_procedure must be declared error...
    Tnx,in advance!
    Dejan Botica

    Oracle database 10gR2.
    MSSQL2000 database.
    For example query:
    select * from dbo.Tbl_Test@kron@dw_jamnica; works fine...
    ...while for example exec dbo.Test@kron@dw_jamnica;
    reports error:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'DBO.TEST@KRON@DW_JAMNICA' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Table Tbl_Test and procedure Test exists in MSSQL instance.
    Regards,
    Dejan

  • Migrating Stored procedure from Oracle to Mysql

    Dear All,
    Please suggest, is ther any tool of stored procedure migration from oracle to mysql.
    I tried some tool like
    1. Intelligent Converter.
    2. Sql way
    3. Mysql Migration Toolkit.
    But procedure cannot migrate properly.
    hb venki

    Venki,
    I think you are in the wrong place, try finding a MySQL forum ;0)

  • Running SQL Server Function and Procedures from Oracle

    I am trying to run SQL Server 2005 functions and/or procedures from a SQL statement in Oracle. I have gone throught the hetergeneous services and have connected to the SQL Server database successfully. I can also do a query to a table in SQL Server successfully; but I have not been able to execute a procedure or a function.

    Have you tried Oracle syntax? It seems to me that you have only tried T-SQL syntax, e.g. execute proc.
    Wrap it in a begin..end tag like you would a normal PL/SQL function or proc call. Assumption is that as Oracle makes the remote database (via the dblink) look like an Oracle database, you should also play along and pretend it is one and treat it as such.
    E.g.declare
      r integer;
    begin
      -- execute remote proc
      procFoo@dblink( 'ABC' );
      -- call a remote function
      r := funcFoo@dblink( 123 );
    end;

  • PLS-00306,problem while executing procedure from oracle e_comerce

    Hi
    I have writen a procedure in oracle.Tere i have a parameter with type varchar2.
    While i registered it in e_comerce i choosed the value set as 15characters.
    When i am runing the program from my ecomerce application it gives an error as below:
    ORACLE error 6550 in FDPSTP
    Cause: FDPSTP failed due to ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'PO_OUTPUT'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    there is no error when i am executing my procedure in toad/sql+ but this error comes only in e_comerce application.
    PLease tell what is the reason and what can be the solution?

    Hi,
    <p>
    The function has the following parameters:<br>
    function insertj(jnum j.j#%type, jname j.jname%type, city j.city%type)<br>
    where j# is varchar2(5), jname is varchar2(35) and city is varchar2(35)<br>.
    I was trying to insert the following values:<br>
    j#:='J11', jname:='JobName' and city:='Paris'.<br>
    </p>
    <p>
    The procedure just calls this function with the same parameters. It is very strange because it is hard to see what the problem is. The line 10 is return 0 in the function where I believe the error comes from. It starts in the procedure and then goes in the function body, if I am interpreting this right.
    </p>
    <p>
    Any idea?
    </p>
    Thanks!

  • Calling MSSQL SERVER STORED PROCEDURE FROM ORACLE STORED PROCEDURE

    Hi Guys,
    I want to call a stored procedure from mssql server 2005 as part of a stored procedure in PL/SQL. How do I go about this? I've already set up the linked servers.

    http://en.allexperts.com/q/Oracle-1451/2008/6/Calling-SQL-Stored-procedure-1.htm
    Does this help?

  • Calling stored procedures from oracle ADF

    hi all ,
    is there any way to call stored procedures form oracle ADF...... kindly help me....

    Thanks Dear ! i also got it from JDeveloper Help with topic About Using Stored Procedures
    and it is very brief with code and example...... and the link you forward to me is very valuable for me ... Thanks again.....

  • How to call a procedure from a job

    I have Oracle StorProc called Regular_jobs. I have existing job code where we have already 3 steps running and 4th step should be ours.
    4 - CustPayMetod table archiving
    Can anybody help me incorporate code to call storproc in this job.
    #!/usr/bin/sh
    # Job Name: Regular_jobs
    # Application Name:CSP
    # Job description: Clean up of tables
    # Schedule: nightly on business days
    # Parameter description:
    # CSP_Regular_jobs.sh lv_stepstartnum lv_stependnum
    # lv_stepstartnum - Step start number --- Always use step start number as 1st parameter
    # lv_stependnum - step end number --- Always use step end number as 2nd parameter
    # Step description:
    # number of steps: 2
    # step start and end number - indicates step number to start process from
    # any step and to end process to any step
    # greater or equal to start number
    # Steps:
    # 1 - calls the cleanup.sh script
    # 2 - Recreate all SEQ sequences to reset them to 1
    # 3 - Purge Response Image
    # ((4 - CustPayMetod table archiving --- is our step))
    # Execute to setup global variables
    . ${APPS}/db_batch/common/.batchenv
    . ${APPS}/app_batch/common/.P_env
    . ${APPS}/app_batch/common/.P_env
    ORAENV_ASK=NO
    . oraenv
    # Initialization of local variables
    # Initialize maximum number of steps
    lv_maxstep_num=3
    # Initialize number of parameters need to specify to execute
    lv_maxpara_num=1
    # Initialize return code
    lv_retcode=0
    # Setup parameter variables
    lv_stepstartnum=$1
    lv_stependnum=$2
    # keep the following lines if there are more parameters to specify
    # Initialize job name
    lv_job_name="Regular_jobs"
    # Initialize local job variables for directory path
    lv_job_path="${APPBATCH}/SP"
    lv_patrol_log_path="${APPPATROL_LOG}"
    lv_common_path="${DBBATCH}/common"
    lv_shell_path="${lv_job_path}/shell"
    lv_sql_path="${lv_job_path}/sql"
    lv_log_path="${lv_job_path}/log"
    # Initialize local job variables for log files
    lv_job_log_file="${lv_log_path}/${lv_job_name}_`date +%y%m%d`.log"
    lv_patrol_log_file="${lv_patrol_log_path}/${lv_job_name}_patrol.log"
    lv_err_ctl_file="${lv_common_path}/ERR.ctl"
    # Addtional email address list to send
    lv_mail_recipient_list="${EMAIL_LIST} ${SUPPORT_EMAIL_LIST}"
    lv_hot_email_id="${HOT_EMAIL_ID}"
    # Additional local variables to be added here --- REMOVE THIS COMMENT LINE IF THERE IS NO ADDITIAL LOCAL VARIABLE ---
    # Environment !!!
    lv_env=CSP
    # Function - Display parameter usage messages and terminate the job
    display_usage()
    echo "================================================="
    echo "${lv_job_name}"
    echo "${lv_job_name}.sh stepstartnum stependnum"
    echo "lv_stepstartnum - Step start number, must provided"
    echo "lv_stependnum - step end number, must provided"
    echo "step start and end number - indicates step number to start process from"
    echo " any step and end process to any step greater"
    echo " or equal to start number and less than or"
    echo " equal to ${lv_maxstep_num}"
    echo "Steps:"
    echo " 1 - calls the cleanup_printmgrDI.sh script"
    echo " 2 - Recreate all SEQ sequences to reset them to 1"
    echo "=================================================="
    exit 1
    # Function - Check script file existence
    check_file_exist()
    test -f ${lv_shell_script}
    lv_retcode=$?
    if [ ${lv_retcode} != 0 ]
    then
    echo "FAILURE - File ${lv_shell_script} does not exist, the job has been terminated." >> ${lv_step_eml_file}
    echo "FAILURE - File ${lv_shell_script} does not exist, the job has been terminated." >> ${lv_job_log_file}
    echo "FAILURE - File ${lv_shell_script} does not exist, the job has been terminated." >> ${lv_patrol_log_file}
    ${NOTIFY_SCRIPT} ${lv_step_eml_file} "${lv_mail_recipient_list}" "${ENV}${lv_job_name}" ${lv_retcode}
    exit 1
    fi
    # Function - Check log file for error messages
    check_log()
    ${VERIFY_SCRIPT} ${lv_step_log_file} ${lv_err_ctl_file}
    lv_retcode=$?
    ${STATUS_SCRIPT} -s ${lv_retcode} -l ${lv_step_log_file} >> ${lv_job_log_file}
    ${STATUS_SCRIPT} -s ${lv_retcode} -l ${lv_step_log_file} >> ${lv_patrol_log_file}
    if [ ${lv_retcode} != 0 ]
    then
    ${NOTIFY_SCRIPT} ${lv_step_eml_file} "${lv_mail_recipient_list}" "${ENV}${lv_job_name}" ${lv_retcode}
    exit 1
    fi
    # Validate input parameter values
    if [ $# -ge ${lv_maxpara_num} ]
    then
    if [ ${lv_stepstartnum} -lt 1 ] || [ ${lv_stepstartnum} -gt ${lv_maxstep_num} ]
    then
    echo "Invalid step start number: must be between 1 - ${lv_maxstep_num}"
    echo ""
    display_usage
    fi
    if [ ${lv_stependnum} -lt ${lv_stepstartnum} ] || [ ${lv_stependnum} -gt ${lv_maxstep_num} ]
    then
    echo "Invalid step end number: must be between ${lv_stepstartnum} - ${lv_maxstep_num}"
    echo ""
    display_usage
    fi
    else
    echo "All ${lv_maxpara_num} parameters must be specified"
    echo ""
    display_usage
    fi
    # Initiate job and patrol log files if job starts from beginning - step 1
    if [ ${lv_stepstartnum} -eq 1 ]
    then
    echo "${lv_job_name} on ${SERVERNAME} started at `date`" > ${lv_job_log_file}
    echo "${lv_job_name} on ${SERVERNAME} started at `date`" > ${lv_patrol_log_file}
    # update permission on patrol log file otherwise Patrol agent won't be able to monitor
    chmod o+r ${lv_patrol_log_file}
    fi
    # Step 1: calls the cleanup.sh script
    if [ ${lv_stepstartnum} -le 1 ] && [ ${lv_stependnum} -ge 1 ]
    then
    # Setup local step variables
    lv_step_name=cleanup_printmgrDI
    lv_step_log_file=${lv_log_path}/${lv_step_name}.log
    lv_step_eml_file=${lv_log_path}/${lv_step_name}.eml
    lv_shell_script="${lv_shell_path}/${lv_step_name}.sh"
    # Verify script file existence
    check_file_exist
    # Execute command
    ${lv_shell_script}
    # Append step log output to job log file
    cat ${lv_step_log_file} >> ${lv_job_log_file}
    # Execute varification function
    check_log
    fi
    # Step 2: Recreate all SEQ sequences to reset them to 1
    if [ ${lv_stepstartnum} -le 2 ] && [ ${lv_stependnum} -ge 2 ]
    then
    # Setup local step variables
    lv_step_name=reset_SEQ_LRO_ALTERNATIVE
    lv_step_log_file=${lv_log_path}/${lv_step_name}.log
    lv_step_eml_file=${lv_log_path}/${lv_step_name}.eml
    lv_shell_script="${lv_shell_path}/${lv_step_name}.sh"
    # Verify script file existence
    echo "@${lv_sql_path}/gen_SEQ_per_LRO.sql ${lv_env} ${lv_log_path}"
    sqlplus -S /nolog << EOF > ${lv_step_log_file} 2>&1
    connect / as sysdba
    @${lv_sql_path}/gen_SEQ_per_LRO.sql ${lv_env} ${lv_log_path}
    set echo on termout on feedback on
    @${lv_log_path}/drop_SEQ_LRO_ALTERNATIVE.sql
    @${lv_log_path}/cre_SEQ_LRO_ALTERNATIVE.sql
    EOF
    # Append step log output to job log file
    cat ${lv_step_log_file} >> ${lv_job_log_file}
    # Execute varification function
    check_log
    fi
    # Step 3: Purge Response Image
    if [ ${lv_stepstartnum} -le 3 ] && [ ${lv_stependnum} -ge 3 ]
    then
    # Setup local step variables
    lv_step_name="purge_response_image"
    lv_step_log_file=${lv_log_path}/${lv_step_name}.log
    lv_step_eml_file=${lv_log_path}/${lv_step_name}.eml
    lv_shell_script="${lv_shell_path}/${lv_step_name}.ksh"
    # Verify script file existence
    check_file_exist
    # Execute command
    ${lv_shell_script} 30 10000
    # Append step log output to job log file
    cat ${lv_step_log_file} >> ${lv_job_log_file}
    # Execute varification function
    check_log
    fi
    # Final: Following are executed only all the previous steps are executed successfully
    # to update successful status in log files and notify recipient through email.
    echo "${lv_job_name} on ${SERVERNAME} finished at `date`" >> ${lv_job_log_file}
    echo "${lv_job_name} on ${SERVERNAME} finished at `date`" >> ${lv_patrol_log_file}
    ${STATUS_SCRIPT} -s ${lv_retcode} -l ${lv_job_log_file} >> ${lv_job_log_file}
    ${STATUS_SCRIPT} -s ${lv_retcode} -l ${lv_job_log_file} >> ${lv_patrol_log_file}
    ${NOTIFY_SCRIPT} ${lv_patrol_log_file} "${lv_mail_recipient_list}" "${ENV}${lv_job_name}" ${lv_retcode}
    exit 0
    # ********************************** COMPLETED ************************************

    Perhaps the following will get you started:
    # Step 4: calls the regular_jobs.sh script
    iif [ ${lv_stepstartnum} -le 4 ] && [ ${lv_stependnum} -ge 4 ]; then
        # Setup local step variables
        lv_step_name="regular_jobs"
        lv_step_log_file=${lv_log_path}/${lv_step_name}.log
        lv_step_eml_file=${lv_log_path}/${lv_step_name}.eml
        lv_shell_script="${lv_shell_path}/${lv_step_name}.sh"
        # Verify script file existence
        check_file_exist
        # Execute command
        ${lv_shell_script} "${lv_step_log_file}"
       # Append step log output to job log file
       cat ${lv_step_log_file} >> ${lv_job_log_file}
       # Execute varification function
       check_log
    fi
    The shell script could look like:
    #!/bin/bash
    sqlplus -s /nolog > "$1" 2>&1 <<EOT
    set pages 0 feed off
    whenever sqlerror exit failure;
    connect username/password
    exec Regular_jobs;
    commit;
    exit;
    EOTYou might want to check other scripts to see if you need to set any environment variables like ORACLE_SID.

  • Executing sql server procedure  from oracle via db link with out parameters

    HI
    we have successfully created the link between oracle and sql server via DB LINK also able to access table from the
    sqlserver via dblink
    Can any one tell me how to execute procedure with 1 input and 4 out parameters from pl\sql
    is it possible using
    dbms_hs_passthrough

    You should be able to call it like you would any other procedure:
    dbo.procedure_name@dblink(parameter_list);

  • PLS HELP - Column value missing when calling procedure from Oracle OLEDB provider

    When calling procedure 'sp_a(?,?,?)' from SQL_PLUS and using
    DBMS.OUTPUT to print the result
    It returns a result set as
    C0, C1, C2
    But When I call the same procedure 'sp_a(?,?,?)' with same
    parameter value from MS VB6,
    It returns the a result set as
    C0, Null,C2
    The 2nd value became Null.
    Any ideas?
    Please Help.

    See http://oracle.ittoolbox.com/groups/technical-functional/oracle-apps-l/forms-personalization-execute-a-procedure-1778674

Maybe you are looking for

  • Bug: Playback plug-in still stops when the Next Marker command is used

    Fixed! That's what Apple said with 2.1.2 but the problem still remains. Has anyone figured out a workaround or reason? Well demonstrated here: http://www.youtube.com/watch?v=ewSZSwUfcyo This would be a HUGELY powerful feature for backing tracks if it

  • Custom Form - Anchoring issue

    Hello folks, i were designed a simple form, and the anchoring goin' wrong... on designer it's OK, but while running not, i even tried following link example, replacing panel with inheritance version one, but it also didn't worked... http://support.mi

  • Standard Business Content - Loan Management & Term Deposit

    Hi ALL, I would like to does anyone has used Business Content Cubes on Loan Management & Term Deposit and its report, please advise me which cube appropriate Thanks BR Nathan

  • Urgent: Error in registering HFM with Shared Services while configuration.

    Hi, I am installing HFM 11.1.2 on a 64-bit Server 2008 platform with my Foundation Services server is on different Machine. I have installed installed HFM client, Web Application and Services on both the server. But i have configured "Deploy to Appli

  • Not enough power mi

    so i bought a new Forton Blue 500watt a good psu.... everything should be powered sufficiently now... my micro still won't recognize.... anyone else have "power" issues?