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 advance

Ah, 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

Similar Messages

  • To create a script and schedule which purge 30 days old files

    Hi Friends,
    Very new in Unix and i got a requirement like writing a script and schedule it, so that it removes 30 days old files from all the log locations of a unix box.
    Suppose i have a unix server ltbamdev1 and in this server i have a mount point opt/bam. In this mount point i have 3 different folders like
    /ltbamdev1/oracle/install/product/10.1.3.1/OracleAS_1/opmn/logs
    /ltbamdev1/oracle/install/product/10.1.3.1/OracleAS_1/bpel/domains/default/logs
    /ltbamdev1/oracle/install/product/10.1.3.1/OracleAS_1/bpel/domains/support/logs
    Please help me in writing a script which runs once a week and removes all 30 days old files from these three folder locations.
    Thanks in advance
    Duos

    Moderator Action:
    The discussion is in the duplicate cross-post:
    To create a script and schedule which purge 30 days old files
    @O.P.
    For the future, only make one post.
    If it is in the wrong forum, it will likely get relocated by moderators.
    This duplicate is now locked to prevent responses getting fragmented all over the place.

  • What do I do when I create a pdf and it says fatal error, there is a problem with the background task

    What do I do when I create a pdf and it says fatal error, there is a problem with the background task

    see Adobe Community: File Crashing on Output - printing/PDF/other

  • User Create/Update Jobs Error

    Hi,
    We find that the User Create/Update recon Jobs error out with the below error. Both FULL and Incremental recon jobs error out with the below error. Could you please help in understanding why this error occurs and how to rectify it.
    "Orch[4266074:CREATE]oracle.iam.platform.kernel.EventFailedException: IAM-3051103:The create operation on user entity failed in action stage.:
        at oracle.iam.identity.usermgmt.utils.UserManagerUtils.createEventFailedException(UserManagerUtils.java:660)
        at oracle.iam.identity.usermgmt.utils.UserManagerUtils.createEventFailedException(UserManagerUtils.java:685)
        at oracle.iam.identity.usermgmt.impl.handlers.create.CreateUserActionHandler.execute(CreateUserActionHandler.java:201)
        at oracle.iam.identity.usermgmt.impl.handlers.create.CreateUserActionHandler.execute(CreateUserActionHandler.java:62)
        at sun.reflect.GeneratedMethodAccessor932.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at oracle.iam.platform.kernel.impl.EventHandlerDynamicProxy.invoke(EventHandlerDynamicProxy.java:30)
        at $Proxy250.execute(Unknown Source)
        at oracle.iam.platform.kernel.impl.OrchProcessData.runActionEvents(OrchProcessData.java:1043)
        at oracle.iam.platform.kernel.impl.OrchProcessData.runEvents(OrchProcessData.java:647)
        at oracle.iam.platform.kernel.impl.OrchProcessData.executeEvents(OrchProcessData.java:230)
        at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.resumeProcess(OrchestrationEngineImpl.java:738)
        at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.process(OrchestrationEngineImpl.java:498)
        at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.orchestrate(OrchestrationEngineImpl.java:444)
        at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.orchestrate(OrchestrationEngineImpl.java:388)
        at oracle.iam.reconciliation.impl.UserHandler.orchestrate(UserHandler.java:210)
        at oracle.iam.reconciliation.impl.UserHandler.create(UserHandler.java:153)
        at oracle.iam.reconciliation.impl.UserHandler.applyRule(UserHandler.java:91)
        at oracle.iam.reconciliation.impl.UserHandler.process(UserHandler.java:66)
        at oracle.iam.reconciliation.impl.ActionE"

    Hi ricky,
    For saving any changes you need to have a Z-table.
    In programs we can't store the user selection. In your case you can create a z-table and store the status there and delete the last status. The process would be faster as you will always have one record in the table.
    . One more advantage is you can even track the changes through the Z-table(User who is changing it.)
    Hope this solution will surely help you.
    Cheers
    Suvi

  • Auto execution job error

    Hi Experts,
    I am working on Database version: 10.2.0.5.0 (10G).
    Currently I got stuck with one error:
    ORA-12012: error on auto execute of job 163~ORA-06550: line 1, column 96:~PLS-00201: identifier 'PROC_REF_MV_AMENDMENT' must be declared~ORA-06550: line 1, column 96:~PL/SQL: Statement ignored
    I have one materialized view MV_AMENDMENT_DASHBOARD.
    To refresh MView I have created procedure PROC_REF_MV_AMENDMENT as below:
    Create procedure PROC_REF_MV_AMENDMENT
    IS
    BEGIN
    --have removed codes like dropping index and recreating it.
    dbms_mview.refresh('MV_AMENDMENT_DASHBOARD','C');
    DBMS_STATS.GATHER_TABLE_STATS (
       ownname          => 'schemaname',
       tabname          => 'MV_AMENDMENT_DASHBOARD',
       estimate_percent => 30);
    ENDHave created job like:
    dbms_job.submit(
    job_no,
    'PROC_REF_MV_AMENDMENT;',
    trunc(SYSDATE),
    'trunc(SYSDATE+1)+(10/24)');But I am getting above mentioned error, at the time of its auto-execution.
    Manually I am able to execute this job using DBMS_JOB.RUN(job_no).
    I have checked procedure status as valid.
    Will really appreciate your help.
    Many Thanks

    Hi,
    What i can understand out of what you have stated is you need to create a procedure and schedule it in oracle so it will execute on a particuler time.
    If above is your requirement then you have procedure created and as you said its valid as well then why dont you create a job to execute it on a paritculer time like
    begin
    DBMS_SCHEDULER.CREATE_JOB(
    JOB_NAME           =>      'JOB_FOR_TEST',
    JOB_TYPE           =>      'PLSQL_BLOCK',
    JOB_ACTION         =>      'begin YOUR_PROC_NAME; end;',
    START_DATE         =>      SYSTIMESTAMP,
    END_DATE           =>      NULL,
    COMMENTS           =>      'JOB IS CREATED FOR TEST PURPOSE.',
    ENABLED            =>      TRUE,
    REPEAT_INTERVAL    =>      'freq=daily; byhour=20; byminute=0; bysecond=0;');
    end;Add the frequency as your requirement.

  • Materialized View - creation and schedule (To automate Refresh)

    Hi All,
    I have one table based on SQL Query (multiple tables) and loading data every day through procedure.
    When I execute the procedure is taking lot of time to load data. That’s why I am planning to create Materialized view to refresh the data in a table every day at some point of time (ex:-9.00 am).
    Exclude procedure and materialized view are there any ways to refresh the data?
    Can you and all please help me to create materialized view and schedule (Automate refresh).
    begin
    insert into CLAIMS_PRODUCT_TAB
    select
    substr(at.ATN_VOUCHER_NUMBER,1,6) as BRANCH,
    t.MONTH_NAME as MONTH,t.FISCAL_YEAR as YEAR,
    bb.ACC_ACCOUNT_TYPE as TYPE,
    aa.ACC_DEPARTMENT_CODE as DEPT,
    pr.PRODUCT_NAME as PRODUCT,
    case bb.ACC_ACCOUNT_TYPE when '1301' then 'Claims Paid' when '5383' then 'Claims OS' end as HEAD,
    case aa.ACC_DEPARTMENT_CODE when '31' then 'OD' when '32' then 'TP' when '39' then 'TP Pool' end as DEPT_NAME,
    count(distinct at.CLAIM_ID) as CLAIMS,
    --count( distinct at.POLICY_ID) as POLICIES,  
    sum(atd.ATD_CREDIT_AMOUNT - atd.ATD_DEBIT_AMOUNT) as totals
    from
    ACCOUNTING_TRN_DETAIL atd,time t,
    ACCOUNT bb,
    ACCOUNT aa,claim c, policy p,product pr,
    accounting_transaction at
    where bb.ACC_ACCOUNT_ID = aa.ACC_ACC_ACCOUNT_ID
    and at.CLAIM_ID = c.CLAIM_ID
    and c.POLICY_ID = p.POLICY_ID
    and p.PRODUCT_ID = pr.PRODUCT_ID
    and aa.ACC_ACCOUNT_ID = atd.ACC_ACCOUNT_ID
    and atd.ATN_ACCOUNTING_TRANSACTION_ID = at.ATN_ACCOUNTING_TRANSACTION_ID
    and trunc(at.ATN_TRANSACTION_DATE) = t.CAL_DATE
    and (bb.ACC_ACCOUNT_TYPE in ('1301','5383'))
    group by substr(at.ATN_VOUCHER_NUMBER,1,6)
    ,t.MONTH_NAME
    ,t.FISCAL_YEAR,bb.ACC_ACCOUNT_TYPE
    ,aa.ACC_DEPARTMENT_CODE
    ,pr.PRODUCT_NAME
    , case bb.ACC_ACCOUNT_TYPE when '1301' then 'Claims Paid' when '5383' then 'Claims OS' end
    ,case aa.ACC_DEPARTMENT_CODE when '31' then 'OD' when '32' then 'TP' when '39' then 'TP Pool' end );
    end;
    Thanks and Regards
    Venkat

    Is the MV and the source tables on the same database? If this is a remote MV, then check the source site if there are any issues (TEMP, UNDO space issues).

  • How to create a job in OEM and schedul it ?

    Hi,
    in 10g 2, I'm looking in the following documents :
    Enterprise Manager Concepts and Oracle Database 2 Day DBA
    http://download.oracle.com/docs/cd/B19306_01/em.102/b31949.pdf
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14196.pdf
    but I can not find any explanation to know how to create a job and schedul it.
    Where can I find ?
    Thanks.

    From Enterprise Manager, click on Administraion Tab, Click on the Jobs link under Database Scheduler. Click the Create button and follow the screens and prompts as required.
    <br>
    Enterprise Manager Documentation
    </br>
    <br>
    Oracle Database FAQs
    </br>

  • Creating a job and schedule

    Hi,
    working in oracle database 9i. I need to know how to create a job that runs a stored pl sql procedure and schedule it.
    I have created a job via toad but it doesn't run by itself. .
    what am i missing?

    http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_job.htm

  • Scheduling Job Error in NWM 7.11

    Hi ,
    When i schedule job for a DO in SDOE_BG_JOB_MONITOR always it is getting cancelled.
    In job log it is showing the following error: "Control Framework : Fatel Error - GUI cannot be reached".
    Error text in ST22  "Exception Contion "CNTL_ERROR" raised"
    what could be the reason ?
    Server Details:
    SAP NW Mobile 7.11 EHP1 Level 002.
    Note : Same DO job is working in NWM 7.10 SP09.
    Regards,
    Kanagaraj .

    Hi,
    After the DOs are transported, is RFC destination created in 7.11 system to connect to Backend?
    RFC destination will not be transported as part of DO. After transporting, we have to create a RFC and set it to the Backend Adapter.
    The Error clearly says it is unable to connect.
    Please check this.
    Thanks and Regards,
    Suma

  • Error "Internal error occurred checking the external " while creating a job

    Hi All,
            I am getting an error while trying to schedule a job, Im not very shure abt what the job does, the user tried it and she got an error and asked me to do it.
            A similer kind of job has been created in an other system and it works fine there. This job should run monthly and belowis the job step
            The job runs on an external command and following are the paramerters
             Name           SAA_TP_CHECK                                          
             Parameters     /usr/sap/transTCluster/bin/TP_DOMAIN_TD1.PFL          
             Operating sys. UNIX                                                  
             Target server  saptp1
            This gives an error "Internal error occurred checking the external "
    A similer kind of job that runs in a different system has the parameters as follows
            Name           SAA_TP_CHECK
            Parameters     /usr/sap/trans/bin/TP_DOMAIN_YD4.PFL
            Operating sys. UNIX
            Target server  sapyp4
    What might be causing the error, and how can this be solved. Please help!!!!

    Hi,
    I think the issue is with the server .
    Please check whether the Server name you are giving has the all the RFC connections.
    I mean Remote Connection with the Server is establised or not.
    Regards
    Arbind

  • 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
    Yashavanth

    Hi,
    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.

  • Error while creating basic job request

    Dear Experts,
    I am getting below error when I submit a basic job request from solman 7.1. please suggest.
    Thanks
    Sajin

    Hello Sajin,
    Run Ib52 tcode and check TR6 system also review notes 1935934 - Various problems when creating IBase components and objects 1933019 - Create Ibase Consistency Report (support only) 1858788 - CRM UI: Sort order in Actions not respected
    BR,
    K.

  • Error faced while creating Oracle Job

    Hi,
    I have the following script to create a job.
    It executed successfully on my database. When we tried to execute the same at our clients place we got some error,
    ===========================================
    SQL> DECLARE
    2 job NUMBER;
    3 m_sleeptimegap NUMBER;
    4 job_interval VARCHAR2(100);
    5
    6
    7 BEGIN
    8 SELECT to_number(tdvalue)
    9 INTO m_sleeptimegap
    10 FROM tabledetails
    11 WHERE tdidcode = 'LICENSE_PULSE'
    12 AND tdkey = 'STATUS_DELAY';
    13
    14 job_interval := 'SYSDATE +'|| m_sleeptimegap / 86400;
    15
    16 DBMS_JOB.SUBMIT(job, 'License_Pulse_Check;', SYSDATE, job_interval, 'FALSE');
    17 UPDATE tabledetails
    18 SET tdvalue = LTRIM( RTRIM( TO_CHAR(job) ) )
    19 WHERE tdidcode = 'LICENSE_PULSE'
    20 AND tdkey = 'ORACLE-JOB-ID';
    21 COMMIT;
    22 END;
    23 /
    DECLARE
    ERROR at line 1:
    ORA-23319: parameter value "SYSDATE
    +,000347222222222222222222222222222222222222" is not appropriate
    ORA-06512: at "SYS.DBMS_JOB", line 60
    ORA-06512: at "SYS.DBMS_JOB", line 138
    ORA-06512: at line 16
    ===========================================
    'm_sleeptimegap' is = 30 , which we have configured in a table called "tabledetails".
    This is present at the client's place.
    What could be the reason of this script failure ?
    Could it be grants issue or something else ?
    Thanks.

    Hi,
    But that parameter in the dbms_job.submit procedure is of VARCHAR2 type,
    dbms_job.submit(
    JOB OUT BINARY_INTEGER,
    WHAT IN VARCHAR2,
    NEXT_DATE IN DATE DEFAULT SYSDATE,
    INTERVAL IN VARCHAR2 DEFAULT 'NULL',
    NO_PARSE IN BOOLEAN DEFAULT FALSE,
    INSTANCE IN BINARY_INTEGER DEFAULT 0,
    FORCE IN BOOLEAN DEFAULT FALSE);
    [http://www.psoug.org/reference/dbms_job.html?PHPSESSID=5a94d055d8b65bd4b4661d1d24dedbf8]
    Thanks.

  • Could not create a Job with BI Scheduler

    Hi all, we are attempting to create a job but when it runs we receive the following error:
    +++ ThreadID: 564 : 2007-06-11 10:10:08.000
    Global Error: [nQSError: 77006] Oracle BI Presentation Server Error: Authentication failed.
    Error Codes: WKY9UVRD:
    Authentication Failure.
    Error Codes: IHVF6OM7:OPR4ONWY:U9IM8TAC
    Odbc driver returned an error (SQLDriverConnectW).
    State: 08004. Code: 10018. [NQODBC] [SQL_STATE: 08004] [nQSError: 10018] Access for the requested connection is refused.
    [nQSError: 43001] Authentication failed for Administrator in repository Star: invalid user/password. (08004)
    +++ ThreadID: 564 : 2007-06-11 10:10:08.000
    ...Trying main loop again.
    +++ ThreadID: 564 : 2007-06-11 10:10:08.000
    ... Sleeping for 9 seconds.
    +++ ThreadID: 564 : 2007-06-11 10:10:17.000
    Global Error: [nQSError: 77006] Oracle BI Presentation Server Error: Authentication failed.
    Error Codes: WKY9UVRD:
    Authentication Failure.
    Error Codes: IHVF6OM7:OPR4ONWY:U9IM8TAC
    Odbc driver returned an error (SQLDriverConnectW).
    State: 08004. Code: 10018. [NQODBC] [SQL_STATE: 08004] [nQSError: 10018] Access for the requested connection is refused.
    [nQSError: 43001] Authentication failed for Administrator in repository Star: invalid user/password. (08004)
    +++ ThreadID: 564 : 2007-06-11 10:10:17.000
    Terminal Error: Exceeded number of retries.
    +++ ThreadID: 564 : 2007-06-11 10:10:08.000
    Global Error: [nQSError: 77006] Oracle BI Presentation Server Error: Authentication failed.
    Error Codes: WKY9UVRD:
    Authentication Failure.
    Error Codes: IHVF6OM7:OPR4ONWY:U9IM8TAC
    Odbc driver returned an error (SQLDriverConnectW).
    State: 08004. Code: 10018. [NQODBC] [SQL_STATE: 08004] [nQSError: 10018] Access for the requested connection is refused.
    [nQSError: 43001] Authentication failed for Administrator in repository Star: invalid user/password. (08004)
    +++ ThreadID: 564 : 2007-06-11 10:10:08.000
    ...Trying main loop again.
    +++ ThreadID: 564 : 2007-06-11 10:10:08.000
    ... Sleeping for 9 seconds.
    +++ ThreadID: 564 : 2007-06-11 10:10:17.000
    Global Error: [nQSError: 77006] Oracle BI Presentation Server Error: Authentication failed.
    Error Codes: WKY9UVRD:
    Authentication Failure.
    Error Codes: IHVF6OM7:OPR4ONWY:U9IM8TAC
    Odbc driver returned an error (SQLDriverConnectW).
    State: 08004. Code: 10018. [NQODBC] [SQL_STATE: 08004] [nQSError: 10018] Access for the requested connection is refused.
    [nQSError: 43001] Authentication failed for Administrator in repository Star: invalid user/password. (08004)
    +++ ThreadID: 564 : 2007-06-11 10:10:17.000
    Terminal Error: Exceeded number of retries.
    Any help?
    Thank you.,
    Regards.

    I have the same Problem :-(
    In adittion I have an authentivication with LDAP.
    If I create the user in the Repository I can connect to it but I receive the following Problem:
    +++ ThreadID: 82c : 2007-10-10 12:17:40.000
    [nQSError: 77006] Oracle BI Presentation Server Error: A fatal error occurred while processing the request. The server responded with: Odbc driver returned an error (SQLDriverConnectW).
    Error Codes: OPR4ONWY:U9IM8TAC
    State: 08004. Code: 10018. [NQODBC] [SQL_STATE: 08004] [nQSError: 10018] Access for the requested connection is refused.
    [nQSError: 13024] Successful completion of init block 'IB_LDAP' is required. (08004)
    If drop the User the Repository and use an LDAP User, I receive the following:
    +++ ThreadID: 38c : 2007-10-10 13:13:21.000
    [nQSError: 77006] Oracle BI Presentation Server Error: A fatal error occurred while processing the request. The server responded with: Authentication Failure.
    Error Codes: IHVF6OM7:OPR4ONWY:U9IM8TAC
    Odbc driver returned an error (SQLDriverConnectW).
    State: 08004. Code: 10018. [NQODBC] [SQL_STATE: 08004] [nQSError: 10018] Access for the requested connection is refused.
    [nQSError: 43001] Authentication failed for ExtOV01 in repository Star: invalid user/password. (08004)
    Regards,
    Stefan Hess

  • Oracle Scheduling Sending Email Notifications of Job Errors

    Hi,
    We are Oracle E-Business Suite - 12.1.3 & DB 11gr1
    I want to send to configure - Oracle Scheduling Sending Email Notifications of Job Errors.
    I already created job.. how i can configure Email Notifications of Job Errors.
    Thanks
    KSV.DBA

    Duplicate posts?
    Email Notofication - scheduled job fails
    Email Notification - Oracle Scheduled job failed
    Scheduler - 11g
    Re: Create Job scheduler

Maybe you are looking for

  • How to display Calender Please help

    Hello i am new to Java Programming not much experienced. Actually i wanna display a calender on screen. The basic idea is to find what day of the week the first of the month is and print blank columns for the days of the week before the month begins.

  • Electronic invoice for customers

    Hello experts I look for the function which is sent Electronic invoice for customers. Right now we are using 4.6C and our customer use SAP also. Our industory is consumer product and chemical product. Our requirements are follows. - Electronic invoic

  • Best way to pass values btwn servlets?

    i have to pass multiple values from one servlet to the next, when the user submits a form. i don't know how many, or even the names of the parameters until the user submits the form. right now, i send them as hidden fields when the form is submitted.

  • Updating progress bar sent from sub vi

    Hi, I have been trying to update a progress bar, but have had no luck.  The progress bar is active when a sub vi is called.  It works fine in the sub vi, but I can't seem to create any kind of reference, output, or anything to get it to update in rea

  • IWeb will not publish after 1.0.1 update

    Just chiming in that I am having the same problem. I add a page to my site and it logs in to .Mac but crashes during the upload with the message "Publish Error: An unknown error occurred." And I just spent 30 minutes talking to the applecare people a