Creating backup Job with DBMS_SCHEDULER

Hello,
Can someone please help me out here:
I'm using Oracle10g release 1 on windowsXP
I'm trying to create a backup job with dbms_scheduler and it's not working.
This is what I did:
I created a job as follows:
BEGIN
dbms_scheduler.create_job (
job_name => 'RMAN_FULL',
job_type => 'EXCUTABLE',
job_action => 'E:\wkdir\rman_bkp',
enabled => TRUE,
start_date => '24-NOV-2007 2:10:00 PM',
repeat_interval => 'FREQ=WEEKLY',
comments => 'Full Database Backup');
END;
While rman_bkp is an RMAN command but it wasn't working.
Please where do I get it wrong?
Kindly put me through the EXECUTABLE or should I use PL/SQL_BLOCK and how?
Thanks.
Regards,
Cherish

Hi,
There is a guide to running external jobs using the Scheduler here
Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
You need to use the full path to a real Windows executable and the arguments to it e.g. for a batch script you would have to do something like
c:\windows\cmd.exe /q /c c:\myscript.bat
There is a forum dedicated to the Scheduler here
Scheduler
Hope this helps,
Ravi.

Similar Messages

  • Creating a job with DBMS_SCHEDULE  from Forms?

    I'm new to DBMS_SCHEDULER. I'd like to run a stored procedure from an Oracle Forms application passing some parameters from the Form to the procedure, then immediately running the procedure and after the procedure has finished dropping it from the job list. The procedure may take some time to run and the user doesn't want to wait before exiting the form. Can this be done?

    Sure, no problem. The job will be dropped after termination by default (autodrop). If privileges are ok it should work. Things to think about are error reporting and retries.
    regards,
    Ronald
    http://ronr.nl/unix-dba

  • Creating a job with arguments

    Hi,
    This might sound really remedial, but can someone explain to me how I go about creating a job with arguments with programs. It errors out when I try to use DEFINE_PROGRAM_ARGUMENTS and when I try to use SET_JOB_ARGUMENTS_VALUE. Maybe it's the order I do it in. Any directions would be much appreciated. Thanks!
    Tony

    Hi Tony,
    Almost any internal error is an Oracle bug and you should report this to support.
    This is definitely not supposed to happen and I haven't seen this error before, do you have a test case throwing the error ?
    Using program arguments should be fairly straightforward. Here's a simple example with two varchar2 arguments
    -- create a stored procedure with two arguments
    create or replace procedure myproc (arg1 in varchar2, arg2 in varchar2)
    is BEGIN null; END;
    -- create a program with two arguments and define both
    begin
    dbms_scheduler.create_program
    program_name=>'myprog',
    program_action=>'myproc',
    program_type=>'STORED_PROCEDURE',
    number_of_arguments=>2, enabled=>FALSE
    dbms_scheduler.DEFINE_PROGRAM_ARGUMENT(
    program_name=>'myprog',
    argument_position=>1,
    argument_type=>'VARCHAR2',
    DEFAULT_VALUE=>'13');
    dbms_scheduler.DEFINE_PROGRAM_ARGUMENT(
    program_name=>'myprog',
    argument_position=>2,
    argument_type=>'VARCHAR2');
    dbms_scheduler.enable('myprog');
    end;
    -- create a job pointing to a program and set both argument values
    begin
    dbms_scheduler.create_job('myjob',program_name=>'myprog');
    dbms_scheduler.set_job_argument_value('myjob',1,'first arg');
    dbms_scheduler.set_job_argument_value('myjob',2,'second arg');
    dbms_scheduler.enable('myjob');
    end;
    Hope this helps,
    Ravi.
    -Ravi

  • Create SQL Job with Invoke-Sqlcmd

    I'm trying to run a set of .sql files, i didn't know how to pass a common variable to all, so i've started running the statements directly in ps.  One of these creates a job but i'm running into all of the errors due to the special characters and the
    variables, can someone help?
    $Client = "C0212"
    $Instance = "SQL03\"+$Client
    $sqlscript3 = "
    --NEED TO CHANGE THE LOG LOCATION BELOW
    USE [msdb]
    GO
    /****** Object:  Job [DatabaseBackup - USER_DATABASES - FULL]    Script Date: 11/15/2013 8:40:20 AM ******/
    BEGIN TRANSACTION
    DECLARE @ReturnCode INT
    SELECT @ReturnCode = 0
    /****** Object:  JobCategory [Database Maintenance]    Script Date: 11/15/2013 8:40:20 AM ******/
    IF NOT EXISTS (SELECT name FROM msdb.dbo.syscategories WHERE name=N''Database Maintenance'' AND category_class=1)
    BEGIN
    EXEC @ReturnCode = msdb.dbo.sp_add_category @class=N''JOB'', @type=N''LOCAL'', @name=N''Database Maintenance''
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    END
    DECLARE @jobId BINARY(16)
    EXEC @ReturnCode =  msdb.dbo.sp_add_job @job_name=N''DatabaseBackup - USER_DATABASES - FULL'', 
    @enabled=1, 
    @notify_level_eventlog=2, 
    @notify_level_email=0, 
    @notify_level_netsend=0, 
    @notify_level_page=0, 
    @delete_level=0, 
    @description=N''Source: http://ola.hallengren.com'', 
    @category_name=N''Database Maintenance'', 
    @owner_login_name=N''sa'', @job_id = @jobId OUTPUT
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    /****** Object:  Step [DatabaseBackup - USER_DATABASES - FULL]    Script Date: 11/15/2013 8:40:20 AM ******/
    EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N''DatabaseBackup - USER_DATABASES - FULL'', 
    @step_id=1, 
    @cmdexec_success_code=0, 
    @on_success_action=1, 
    @on_success_step_id=0, 
    @on_fail_action=2, 
    @on_fail_step_id=0, 
    @retry_attempts=0, 
    @retry_interval=0, 
    @os_run_priority=0, @subsystem=N''CmdExec'', 
    @command=N''sqlcmd -E -S `$(ESCAPE_SQUOTE(SRVR)) -d DBA -Q `"EXECUTE [dbo].[DatabaseBackup] @Databases = ''''USER_DATABASES'''', @Directory = N''''T:\SQLsafe Backups\SQL Native Backup'''', @BackupType = ''''FULL'''',
    @Verify = ''''Y'''', @CleanupTime = 170, @CheckSum = ''''Y'''', @LogToTable = ''''Y''''`" -b'', 
    --NEED TO CHANGE THE LOG LOCATION BELOW
    @output_file_name=N''C:\Program Files\Microsoft SQL Server\MSSQL11.$Client\MSSQL\LOG\DatabaseBackup_`$(ESCAPE_SQUOTE(JOBID))_`$(ESCAPE_SQUOTE(STEPID))_`$(ESCAPE_SQUOTE(STRTDT))_`$(ESCAPE_SQUOTE(STRTTM)).txt'', 
    @flags=0
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    EXEC @ReturnCode = msdb.dbo.sp_update_job @job_id = @jobId, @start_step_id = 1
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    EXEC @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id=@jobId, @name=N''Saturday 4am'', 
    @enabled=1, 
    @freq_type=8, 
    @freq_interval=64, 
    @freq_subday_type=1, 
    @freq_subday_interval=0, 
    @freq_relative_interval=0, 
    @freq_recurrence_factor=1, 
    @active_start_date=20131109, 
    @active_end_date=99991231, 
    @active_start_time=40000, 
    @active_end_time=235959, 
    @schedule_uid=N''5b3c3fcf-28dc-4f4c-95ce-a624667ee378''
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    EXEC @ReturnCode = msdb.dbo.sp_add_jobserver @job_id = @jobId, @server_name = N''(local)''
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    COMMIT TRANSACTION
    GOTO EndSave
    QuitWithRollback:
        IF (@@TRANCOUNT > 0) ROLLBACK TRANSACTION
    EndSave:
    GO"
    Invoke-Sqlcmd –ServerInstance $Instance –Database msdb –Query $sqlscript3 -QueryTimeout 300

    So, if I try this:
    $Client = "C0212"
    Invoke-Sqlcmd -InputFile "C:\NewInstanceScripts\PSNI -3 - Create Full Backup job for ALL User Databases.sql" -Variable $Client
    and in my .sql file that line that contains the variable looks like this:
    @output_file_name=N'C:\Program Files\Microsoft SQL Server\MSSQL11.`$(Client)\MSSQL\LOG\DatabaseBackup_$(ESCAPE_SQUOTE(JOBID))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(STRTDT))_$(ESCAPE_SQUOTE(STRTTM)).txt',
    I get the error: 
    Invoke-Sqlcmd : The format used to define the new variable for Invoke-Sqlcmd cmdlet is invalid. Please use the 'var=value' format for defining a new variable.
    If i try like this:
    Set @Client = "C0212"
    Invoke-Sqlcmd -InputFile "C:\NewInstanceScripts\PSNI -3 - Create Full Backup job for ALL User Databases.sql" -Variable @Client
    Line in .sql file like this:
    @output_file_name=N'C:\Program Files\Microsoft SQL Server\MSSQL11.@Client\MSSQL\LOG\DatabaseBackup_$(ESCAPE_SQUOTE(JOBID))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(STRTDT))_$(ESCAPE_SQUOTE(STRTTM)).txt',
    I get the error: Set-Variable : A positional parameter cannot be found that accepts argument '2'.

  • 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

  • Create a job using dbms_schedule.create_job

    Hi, can someone assist me in coming up with an automated job to run the this code on Oracle 11g. Thanks In advance.
    CREATE OR REPLACE PROCEDURE PR_SEND_EMAIL
      ( p_from_email_address   VARCHAR2
      , p_to_email_address     VARCHAR2
      , p_smtp_host            VARCHAR2
      , p_subject              VARCHAR2
      , p_message              VARCHAR2
    IS
      /*Your query as cursor */
      CURSOR emp_cur IS
        SELECT * FROM a_tre_alert;
      /*UTL_SMTP related varriavles. */
      v_connection_handle  UTL_SMTP.CONNECTION;
      /* This send_header procedure is written in the documentation */
      PROCEDURE send_header(pi_name IN VARCHAR2, pi_header IN VARCHAR2) AS
      BEGIN
        UTL_SMTP.WRITE_DATA(v_connection_handle, pi_name || ': ' || pi_header || UTL_TCP.CRLF);
      END;
    BEGIN
      /*UTL_SMTP related coding. */
      v_connection_handle := UTL_SMTP.OPEN_CONNECTION(host => p_smtp_host);
      UTL_SMTP.HELO(v_connection_handle, p_smtp_host);
      UTL_SMTP.MAIL(v_connection_handle, p_from_email_address);
      UTL_SMTP.RCPT(v_connection_handle, p_to_email_address);
      UTL_SMTP.OPEN_DATA(v_connection_handle);
      send_header('From', '"Sender" <' || p_from_email_address || '>');
      send_header('To', '"Recipient" <' || p_to_email_address || '>');
      send_header('Subject', p_subject);
      --MIME header.
      UTL_SMTP.WRITE_DATA(v_connection_handle, 'MIME-Version: 1.0' || UTL_TCP.CRLF);
      UTL_SMTP.WRITE_DATA(v_connection_handle, 'Content-Type: multipart/mixed; ' || UTL_TCP.CRLF);
      UTL_SMTP.WRITE_DATA(v_connection_handle, ' boundary= "' || 'SAUBHIK.SECBOUND' || '"' || UTL_TCP.CRLF);
      UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
      -- Mail Body
      UTL_SMTP.WRITE_DATA(v_connection_handle, '--' || 'SAUBHIK.SECBOUND' || UTL_TCP.CRLF);
      UTL_SMTP.WRITE_DATA(v_connection_handle, 'Content-Type: text/plain;' || UTL_TCP.CRLF);
      UTL_SMTP.WRITE_DATA(v_connection_handle, ' charset=US-ASCII' || UTL_TCP.CRLF);
      UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
      UTL_SMTP.WRITE_DATA(v_connection_handle, p_message || UTL_TCP.CRLF);
      UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
        UTL_SMTP.WRITE_DATA(v_connection_handle,'Due Date--Amount--State--ChkSerial--APSerial--AccountCode--FloatAccount'|| UTL_TCP.CRLF);
      FOR i IN emp_cur
      LOOP
        UTL_SMTP.WRITE_DATA(v_connection_handle,  i.chequedate || '--' || i.rialamount || '--' || i.state || '--' || i.check_serial || '--' || i.ap_serial || '--' || i.acc_code || '--' || i.facc_code || UTL_TCP.CRLF);
      END LOOP;
      UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
      -- Close Email
      UTL_SMTP.WRITE_DATA(v_connection_handle, '--' || 'SAUBHIK.SECBOUND' || '--' || UTL_TCP.CRLF);
      UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF || '.' || UTL_TCP.CRLF);
      UTL_SMTP.CLOSE_DATA(v_connection_handle);
      UTL_SMTP.QUIT(v_connection_handle);
    EXCEPTION
      WHEN OTHERS THEN
        UTL_SMTP.QUIT(v_connection_handle);
        RAISE;
    END;
    CREATE OR REPLACE PUBLIC SYNONYM PR_SEND_EMAIL1 FOR PR_SEND_EMAIL;
    BEGIN
      PR_SEND_EMAIL ( p_from_email_address => '[email protected]'
                        , p_to_email_address   => [email protected]'
                        , p_smtp_host          => 'xxx.xxx.xxx.xx'
                        , p_subject            => 'FNC_TR_1 Daily Checks Due'
                        , p_message            => 'The following is the list of checks that are due in the next 7 days'
    EXCEPTION WHEN OTHERS
       THEN DBMS_OUTPUT.PUT_LINE('ERROR in Procedure PR_SEND_EMAIL - ' || SQLERRM);
            RAISE;
    END;

    What help do you need? There are tons of documentation and examples. Is this not helpful?
    Examples of Using the Scheduler
    ORACLE-BASE - Scheduler (DBMS_SCHEDULER) Enhancements in Oracle Database 11g Release 1
    DBMS_SCHEDULER

  • Creating batch job with 5 classes

    Hi All,
    I have a requirement in which I have to do five different operations at different time instances.
    1.Generate a report at morning 11.00 AM.
    2.update a table with more than 6000 rows at night 12.30 AM
    3.Generate a second report querying from the database at 10.00 AM Everyday.
    4.Generate an automail at 11.30 Am Everyday
    All these are plain Java classes and not web components. How could I effectively design the batch job so that it doesnot take nmuch memory and design classes so that they must be reusable like DB connection,Getting a db field value frequently etc.
    Can any one help me on this.

    http://www.google.com/search?q=job+schedule+in+java&client=netscape-pp&rls=com.netscape:en-US

  • Creating Oracle Job with Task Scheduler

    Hi,
    Platform: Oracle10g R2, Windows 2003 Server
    I have the below script on my Linux server that backups up the database. It's run via crontab.
    --------------- script ---------------------
    -- Environment variables goes here
    cd $ORACLE_HOME/bin
    ./rman target / <<EOF
    startup mount;
    backup database plus archivelog delete input;
    delete noprompt obsolete;
    alter database open;
    I want something similar I can do on windows like .bat file that I can schedule to run via Task Scheduler.
    Any help please?
    Thnaks and regards,
    Creems

    Hi AG,
    I tried to do that but it's not working.
    But I did something similar for auto-delete of flashback logs and it works but the backup thing aint working.
    What can I do?
    Here is what I did for the auto-flashback delete
    =======
    RunSQL.bat
    =======
    -- content of RunSQL.bat
    @ECHO OFF
    TITLE Resetting Flashback Logs
    CLS
    ECHO Please be patient. This will take some time.
    ECHO.
    ECHO.
    SET ORACLE_SID=PROD
    sqlplus.exe /nolog @del_flashback.sql
    ECHO.
    ECHO.
    ECHO FLASHBACKs reset. Please continue with your other procedures.
    ECHO.
    ==========
    del_flashback.sql
    ==========
    -- content of del_flashback.sql
    connect /nolog
    conn sys/oracle as sysdba
    SHOW USER
    shutdown immediate
    startup mount
    alter database flashback off;
    alter database flashback on;
    alter database open;
    SHOW USER
    exit
    This works, but when I did the same with RMAN backup it doesn't.
    Any more help please?
    Thanks and regards,
    Creems

  • Event job with dbms_scheduler after dml on table

    is is possible to start an event job using dbms_schduler every time a record is inserted or updated in a table?
    After a dml statement that job has to start an external command (a shell script).
    In few words, a dml statment can be the event?

    It would scale badly, but yes, when you are looking for methods to develop a disaster application, this is one of the ways to do it. It is definitely possible. But it has BAD IDEA inscribed all over it.
    When you insist on misusing Oracle for things it was not designed for you may want to consider calling O/S commands using Java. Examples on http://asktom.oracle.com
    Sybrand Bakker
    Senior Oracle DBA

  • Create backup router with licenses.encrpty on both R1 and R2

    What is the best way to copy a router config from one router to another router. The second will be our back-up router ready for any outage. We have SSL and IPSec VPN with licensing on both devices. I want R2 to be very much alike R1. If I just transfer the configuration, my licenses become corrupted. Any advice is greatly appreciated. We have two 891k9 routers with advanced services.
    JP

    You say you have licensing on both routers, is that also the SSL-license ore only the security-license? If you don't have the SSL-llicense on the secondary router, then you have to contact cisco as Leo said.
    But if both routers are fully licensed, then you should be able to transfer the config from one router to the other. If that doesn't work, please show us *exactly* what you did. Best with a copy/paste of the terminal session.

  • Job with multiple event schedules

    Is it possible to create a job with multiple schedules? Can you have multiple schedule names?
    DBMS_SCHEDULER.CREATE_JOB (
    job_name => 'my_new_job2',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN SALES_PKG.UPDATE_SALES_SUMMARY; END;',
    schedule_name => 'my_saved_schedule, my_saved_schedule2'); <------------------ like this?
    END;
    thanks.

    I am using oracle 10g and have installed the file arrival package. I want my job to run when multiple files arrive. I have created the file arrival event schedules. I know i can create chain event steps to respond, but my chain has to be running for the steps to respond to the events. I want the chain (or rather the job that starts the chain) to kick off when 2 or more files arrive.
    thanks.

  • ORA-01422: while trying to create a job

    Hi all,
    WE need a help from you, group of experts
    we are getting the following error
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "SYS.DBMS_ISCHED", while trying to create a job using the following code
    BEGIN
    DBMS_SCHEDULER.create_program
    (program_name => 'FAILURE_MONITOR_PRG',
    program_action => 'JOB_MGR.SPR_FAILURE_MONITOR',
    program_type => 'STORED_PROCEDURE',
    number_of_arguments => 1,
    enabled => FALSE
    DBMS_SCHEDULER.define_metadata_argument
    (program_name => 'FAILURE_MONITOR_PRG',
    argument_position => 1,
    metadata_attribute => 'EVENT_MESSAGE'
    DBMS_SCHEDULER.create_job
    (job_name => 'FAILURE_MONITOR_JOB',
    program_name => 'FAILURE_MONITOR_PRG',
    enabled => TRUE,
    auto_drop => FALSE,
    start_date => SYSDATE,
    event_condition => 'tab.user_data.event = ''FAILED''',
    queue_spec => 'event_queue'
    END;
    Oracle allows us to create the job if the parameter values for enabled is "false" in the DBMS_SCHEDULER.create_job call. But we got the same error
    when tried to enable the job using exec DBMS_SCHEDULER.ENABLE ('FAILURE_MONITOR_JOB');
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "SYS.DBMS_ISCHED", line 2751
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1794
    ORA-06512: at line 1
    Please help us to solve this issue
    Thanks,
    Reghu
    null

    Hi Ravi,
    Thank you for your kind support
    That issue has been solved. Problem was with the event queue and only for that particular job i mentioned in the first post (I was able to create other jobs with different Events using the same queue) . After recreating the event queue i am able to create the same job. I got the same error when I tired to drop the queue, and then I dropped the queue table itself. Do you have any idea about what might had caused the issue?
    Thanks
    Reghu

  • Jobs with a startevent and starttime

    hello,
    I'd like to plan a job in an abap program which is started when an event is raised or a certain timespan
    has passed.
    When planing the job by using the functionmodules job_open, job_submit and and job_close I can supply an event and a startdate but the implementation of the functionmodules ignores the event when the startdate parameter is supplied.
    Is there a workaround to enable event triggered jobs with a startdate which is used if the event is not raised within a certain timespan or do I really hav to use 2 jobs?
    thanks
    Roman

    Hello Roman
    I think you have to use 2 jobs, but if you use 2 jobs with the same program the program may run twice.
    You could create 1 job with your program that is started by event and 1 job with a startdate/time that runs a program that raise the event.
    best regards
    Thomas Madsen Nielsen

  • How to create a JOb

    Hi Experts,
    Previously i waw using bdc and was creating session.
    Now in place of BDC i am using BAPI .
    Now i cannot create  a session  so i am creating a job.
    Problem is that when i use bapi the record is created at same time.
    So before execting Job  using transaction SM37
    the records gets created.
    Can any  body please explain me how to solve this issue.
    Thanks & regards,
    Chetan

    Hi chetan,
    To create a new batch job you can go to transaction Sm36,wherein you can define the job name,job class and target server..then you can go to start condition and select whether it is a periodic job,or immediate job and accordingly you can schedule the job..Also the very important thing is in the Step funtion you should have valid ABAP program or any external program which should be used at the background...
    If you know the program then you can go to SE38 and create a variant for that program which can be later used in the newly created job.You can also copy an existing job and modify it according to the requirement by checking the job details in SM37.
    Just to summarise the Key transactions are : SM36 and SE38.
    JOB_OPEN: Create a Background Processing Job
    Use JOB_OPEN to create a background job. The function module returns the unique ID number which, together with the job name, is required for identifying the job.
    Once you have "opened" a job, you can add job steps to it with JOB_SUBMIT and submit the job for processing with JOB_CLOSE.
    For more information, please see the online documentation in the function module facility (transaction SE37)
    Sample Program: Creating a Job with JOB_OPEN
    Create your job with JOB_OPEN. The module returns a unique job
    number. Together with the jobname, this number identifies the
    job. Other parameters are available, but are not required.
    JOBNAME = 'Freely selectable name for the job(s) you create'.
    CALL FUNCTION 'JOB_OPEN'
    EXPORTING
    JOBNAME = JOBNAME
    IMPORTING
    JOBCOUNT = JOBNUMBER
    EXCEPTIONS
    CANT_CREATE_JOB = 01
    INVALID_JOB_DATA = 02
    JOBNAME_MISSING = 03
    OTHERS = 99.
    IF SY-SUBRC > 0.
    <Error processing>
    ENDIF.
    thanks
    katrhik

  • Backup jobs and password changing problem

    Hi
    I have created few rman job in my db (11.2) to backup database.
    I my company i have to change all system passwords (os - oracle, system, syman, etc...) every 90 days.
    When i changing password for user who created backup jobs, this jobs stop working.
    I,ve got "Invalid username and/or passworderror writing input to command" error.
    Of course after changing passords i always setup "Preferred Credentials" but that dosn't help.
    What am i doing wrog? What am i missing ?
    Please advice.

    If you use Preferred Credentials to authorize a Job, it will use the current credentials on the moment it is dispatched for execution.
    This means that in case passwords changes, you just need to modify you preferred credentials
    This is something you can do using EMCLI (command line interface) in a script for instance (or just use the GUI to modify)
    checkout:
    Oracle® Enterprise Manager Command Line Interface
    11g Release 1 (11.1)
    http://download.oracle.com/docs/cd/E11857_01/em.111/e16185/toc.htm
    regards
    Rob
    http://oemgc.wordpress.com

Maybe you are looking for

  • Sybase Unwired Platform - Error in creating a Blackberry Application

    Hi Experts, I am working in the development of Blackberry application using Sybase Unwired Platform and SAP as the backend data source. As a part of this I had created a Remote enabled function module in SAP which returns an internal table as the out

  • A HUGE problem with my ZEN x

    ok so a little while ago i was in class and dropped my zen jukebox zen xtra (40 gig), now usually when i drop my mp3 player (which i assure you is few and far between) nothing happens, but this time when i startedit up i got to the rescue screen. kee

  • Java.lang.IllegalStateException: cannot resize buffer

              I am running Bea Weblogic 7.0.0 on Sun Solaris 2.8. I see the following error           message appearing in the weblogic server logfile:           java.lang.IllegalStateException: cannot resize buffer: 60 bytes have already been           

  • Concerned with the cost of being a Mac user

    At first glance, you might perceive this post as inflammatory torwards Apple, or as being from someone who is anti-Mac. I assure you, it is neither. Also, there is a point to the post, and I do desire some feedback. If you want to skip the majority o

  • SD Output issue

    Dear Gurus,        My clients business requires the output for Sd invoice in a bunch and not one at a time.Is there any option like due list for output where the required documents can be selected and executed in one go.      Any other alternative ki