Schedule plan - Stored procedure

Hi Experts,
I have a requirement like below....Any ideas to achieve the same will be highly appreciated...
PLAN
Stored Procedure to run on 3rd, 9th, 16th & 23rd every month
On 3rd : delete data from [ControlReports] tbl for previous month and insert whole month's data.
On 9th : delete data for current month and insert data from 1st until 7th (2 days before)
On 16th : delete data for current month and insert data from 1st  until 14th (2 days before)
On 23rd : delete data for current month and insert data from 1st  until 21st (2 days before)
INSERT INTO [Control_Reports]
EXEC @return_value = [dbo].[rpt_spFeeManagement]
  @Products = NULL,
  @TransactionTypesOptionsFees = 'Refunds',
  @StartDate = 'mm/dd/yy',
  @EndDate = 'mm/dd/yy'
How do I make the process as generic as possible please.
Many thanks.

You can schedule the job to run daily and it will check for the date before calling the stored procedure
IF (cast(DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)+2 as DATE) = CAST(getdate() as DATE))
BEGIN
INSERT INTO [Control_Reports]
EXEC @return_value = [dbo].[rpt_spFeeManagement]
@Products = NULL,
@TransactionTypesOptionsFees = 'Refunds',
@StartDate = 'mm/dd/yy',
@EndDate = 'mm/dd/yy'
END
IF(cast(DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)+8 as DATE)=CAST(getdate() as DATE))
BEGIN
INSERT INTO [Control_Reports]
EXEC @return_value = [dbo].[rpt_spFeeManagement]
@Products = NULL,
@TransactionTypesOptionsFees = 'Refunds',
@StartDate = 'mm/dd/yy',
@EndDate = 'mm/dd/yy'
END
IF(cast(DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)+15 as DATE)=CAST(getdate() as DATE))
BEGIN
INSERT INTO [Control_Reports]
EXEC @return_value = [dbo].[rpt_spFeeManagement]
@Products = NULL,
@TransactionTypesOptionsFees = 'Refunds',
@StartDate = 'mm/dd/yy',
@EndDate = 'mm/dd/yy'
END
IF(cast(DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)+22 as DATE)=CAST(getdate() as DATE))
BEGIN
INSERT INTO [Control_Reports]
EXEC @return_value = [dbo].[rpt_spFeeManagement]
@Products = NULL,
@TransactionTypesOptionsFees = 'Refunds',
@StartDate = 'mm/dd/yy',
@EndDate = 'mm/dd/yy'
END
--Prashanth

Similar Messages

  • How to schedule a Stored procedure to run every hour in SQL server express

    Hi,
    I am using SQL server express and I want to schedule a Stored procedure to run every hour.
    The Stored Procedure name is UpdateData.
    Can someone please give an example of how i can schedule this to run every hour, given that I do not have SQL Server agent on my express edition.

    Hello,
    You will find more options on the following thread.
    http://stackoverflow.com/questions/1675206/how-to-run-a-stored-procedure-every-day-in-sql-server-express-edition
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Explain plan/autotrace for stored procedure

    Hello,
    I have an stored procedure executing a select statement. I would like to use autotrace or explain plan or something to check how my select statement is executed.
    So far I've only accomplished to use autotrace on statements i write in sql*plus. The problem here is that my select statement uses some user defined types (lists of numbers and dates). Also if possible I would like my application to call the procedure providing the parameters. I feel kind of lost here.
    My query is something like this:
    int_list list_of_numbers;
    int_list2 list_of_numbers;
    date_list list_of_dates;
    select * from table1, table(int_list) i1, table(int_list2) i2, table(date_list) d1 where ....

    No, i do not have a "close cursor" procedure, but I just leave the tracing on for now. When in production I will turn it off.
    This is just a test system so I have full control over everything.
    Yes, I granted execute on dbms_session and alter session to my user, because I received an error when trying to execute the stored procedure. But with dbms_support and monitor I can't even compile my stored procedure.
    I granted execute on dbms_monitor to my user and the procedure compiled fine! When trying to grant execute on dbms_support sql*plus complained on not even finding that package/procedure/whatever.
    Thank you for all your help!

  • Can JDBC adapter be scheduled to call stored procedures

    Can JDBC adapter be scheduled to call stored procedure in other database passing previous date as input parameter

    Hi Gurus,
    actually our scenario is jdbc->XI( <-RFC->)->File
      Here our payload is around 5000 records
    can it be advisable to use rfc synchronous communication.
    The scenario will be exected only in night times.so can we schedule the adapter as we are using sp9.
    If not what must be the good design approach.
    And also after scheduling to a perticular period ,if there is any down time of XI server,will the process start immediately after the sever up or it will again watch for that perticular time.

  • Scheduled Stored Procedures...

    Hey All,
    11gR2 Enterprise -
    Oracle Linux
    All the bells and whistles
    So the question is about running stored procedures via the scheduler.
    In the scheduler you can set all sorts of limits repeat time etc.  You can even have the scheduler stop the procedure it runs more than n minutes.
    My question is this:
    Is there any way anyone has discovered for the SP to be aware that it is being terminated for some reason?
    For example in the *nix environment most all programs written have access to the POSIX signals and thereby provide a method of gracefully shutting  down, saving a status etc.  by catching SIGINT, SIGTERM, SIGHUP etc. and if they fail to heed those signals you can of course unconditionally terminate them with a kill -9 [pid].
    My reason for this is that I want to schedule a run of a stored procedure every 15 minutes, but if it takes more then 5 minutes to complete I want it to shutdown.
    Thanks in advance.

    Hmmm perhaps you did not notice the question:
    Yes - I noticed the question. But then you said only that 'if it takes more then 5 minutes to complete I want it to shutdown.'. And since it will be shutdown that reason seemed to conflict with the question you ask.
    Not trying to argue - just trying to get things clarified. If you reread your original thread and then reread what you just said it is pretty clear that your last response provided actual reasons for wanting to 'intercept' the shutdown.
    Unfortunately there is no such messaging between procedures and Oracle processes unless the procedure initiates it. That is, the proc would need to check how long it has been running and do something to clean up and terminate itself. The problem there, of course, is that even a single query could run longer than 5 minutes and Oracle isn't going to return control to the procedure if the query exceeds some resource limit.
    So for the code to be effectively pro-active it would need to contain multiple 'batch' steps and perform a check between each step to see if it should continue or gracefully exit.
    We do that sort of 'proactive' check all the time in nightly or weekend batch processing when it is important that processes not run beyond a certain time window.
    But as just mentioned earlier it can never be exact because only the user's code can/will do the check.

  • Stored procedure runs OK from SSMS but fails from job scheduler

    I have a stored procedure that queries the sysmanagement_shared_registered_servers_internal table in MSDB and performs various other queries from the servers listed in that table via linked servers.  I have created a login called SQLInfo_user. When
    I run the stored procedure from SSMS with the connection as SQLInfo_user, everything works as designed. However, when I run the job from the job scheduler with SQLInfo_user as the "run as user" parameter, it fails with "Executed as user: SQLInfo_user.
    The SELECT permission was denied on the object 'sysmanagement_shared_registered_servers_internal', database 'msdb', schema 'dbo'. [SQLSTATE 42000] (Error 229).  The step failed."  The login SQLInfo_user has full read and select permissions to
    that table in the MSDB database.  Any suggestions?  Thanks

    Try instead of  "run as user", make that user owner of job. Also, make sure your that user is in linked server for servers that you are connecting has equivalent user on the the destination servers. 
    Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

  • How to Schedule Stored Procedure?

    Hi to all,
    I have one stored procedure which I want to schedule for some specific time duration, How does it possible.
    Bhavesh Solanki

    Hello,
    here is a small sniplet...
    declare
    x number;
    begin
    dbms_job.submit(x,'<name of your procedure;>',sysdate,sysdate+1);
    commit;
    dbms_output.put_line('you scheduled job nr: '||x);
    end;
    F.

  • Scheduling stored procedure using DBMS_JOB package

    I have stored procedure called “extract_every_day”, I want this procedure to run automatically at 7:00 PM every day.
    I used DBMS_JOB.SUBMIT to achieve this, below is pl/sql block
    DECLARE
    v_jobno number ;
    BEGIN
    DBMS_JOB.SUBMIT
    (v_jobno,
    ' extract_every_day ',
    TRUNC (SYSDATE) + 1 + 9/24,
    'TRUNC (SYSDATE) + 1 + 9/24');
    COMMIT;
    END;
    When I run above pl/sql block is that mean procedure “extract_every_day” executes every day and what is the significance of “job” OUT parameter in “DBMS_JOB.SUBMIT “ procedure. Also how can I see list of jobs submitted.
    Any help is appreciated.
    Thanks

    The OUT parameter is the unique number of the job being executed. This is the Sequence generated from sequence sys.jobseq
    Also, in the example you have provided, the Job will run at 9Am and not 7PM.
    To make it run at 7PM every day change the following lines :
    'TRUNC (SYSDATE) + 1 + 9/24'
    'TRUNC (SYSDATE) + 1 + 9/24'
    To ,
    'TRUNC (SYSDATE) + 19/24' <-- Changed
    'TRUNC (SYSDATE) + 1 + 19/24' <-- Changed
    Also do remember to include the parameter "job_queue_processes" parameter within the init.ora file. This parameter is used to determine the max no
    of concurrently running jobs (i.e. Set in Init.ora).
    NOTE :- Job_queue_process cannot be set to 0. If set to 0, no jobs is run.
    he view dba_jobs and dba_jobs_running should be used to view the jobs.
    -- Shailender Mehta --

  • ORA-03111 - JCA Binding error while invoking a stored procedure in DB

    Hi,
    We are facing this problem for one interface alone.
    Need expert advice to fix this problem..
    This is scheduled to run once in a day and fails daily for past 2 weeks..
    We receive below error as response..
    Same interface worked fine for past 1 yr..
    Also it works fine if we reprocess the batch in next day morning...
    Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'DB_Legacy_To_EBS_Invoice_Conversion' failed due to: Stored procedure invocation error. Error while trying to prepare and execute the IRSOA.AR_SOA_INVOICE.TRN_GET_CUST_INV_RAW_TO_STAGE API. An error occurred while preparing and executing the IRSOA.AR_SOA_INVOICE.TRN_GET_CUST_INV_RAW_TO_STAGE API. Cause: java.sql.SQLException: ORA-03111: break received on communication channel ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    AND
    Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'DB_Legacy_To_EBS_Invoice_Conversion' failed due to: Stored procedure invocation error. Error while trying to prepare and execute the IRSOA.AR_SOA_INVOICE.TRN_GET_CUST_INV_RAW_TO_STAGE API. An error occurred while preparing and executing the IRSOA.AR_SOA_INVOICE.TRN_GET_CUST_INV_RAW_TO_STAGE API. Cause: java.sql.SQLException: ORA-01013: user requested cancel of current operation ORA-06512: at "IRSOA.XXIR_AR_SOA_CUSTOMER_INVOICE", line 213 ORA-06512: at line 1 ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution
    Thanks,
    Sundaram

    Looks like the SQL might be taking a longer time to execute and might be timing out.
    Please refer the following:
    Re: ORA-01013: user requested cancel of current operation
    http://www.dba-oracle.com/t_ora_01013_user_requested_cancel_of_current_operation.htm
    Additionally, ORA-06512 indicates that there is a mismatch of the with the data length that is being processed. Refer http://www.techonthenet.com/oracle/errors/ora06512.php
    Hope this helps.
    Thanks,
    Patrick

  • Cannot Send Email Notification Using Stored Procedure.

    Hi Friends,
    I tried to execute this job scheduler...
    begin
    dbms_scheduler.create_job(
    job_name => 'ILMS_JOB_SCHEDULE'
    ,job_type => 'PLSQL_BLOCK'
    ,job_action => 'begin ilms.check_reminder(); end; '
    ,start_date => SYSTIMESTAMP
    ,repeat_interval => 'FREQ=DAILY'
    ,enabled => TRUE
         ,end_date => NULL
    ,comments => 'Ilms job schedule for notification.');
    end;
    However, since the effect is too long I rescheduled the frequency to be every one minute in this set attribute...
    BEGIN
    DBMS_SCHEDULER.SET_ATTRIBUTE(
              name => 'ILMS_JOB_SCHEDULE'
              ,attribute => 'repeat_interval'
              ,value => 'FREQ=MINUTELY;INTERVAL=1'
    DBMS_SCHEDULER.DISABLE('ILMS_JOB_SCHEDULE');
    DBMS_SCHEDULER.ENABLE('ILMS_JOB_SCHEDULE');
    END;
    Check Reminder is the stored procedure invoked by job scheduler to check values in database columns before sending email notification to the respective recipients' email address and also the format of the email notification to be sent to the recipients...
    CREATE OR REPLACE PROCEDURE check_reminder AS
    NO number;
    CURSOR emp_cur is
    select * from pergerakan_ks where TASK_FLAG=7 and TASK_STATUS='InProgress';
    emp_rec emp_cur%rowtype;
    email_to varchar2(200);
    default_email varchar2(200);
    mesg varchar2(4000);
    no_kes varchar2(100);
    subj varchar2(4000);
    kpi number;
    crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
    BEGIN
    default_email:='@abc.com.my';
    FOR emp_rec in emp_cur
    LOOP
    if emp_rec.PKS_TKH_TERIMA is null then
    dbms_output.put_line('count day ' || round(sysdate - to_date(emp_rec.pks_tkh_hantar)) || crlf || crlf);
    if round(sysdate - to_date(emp_rec.pks_tkh_hantar)) >3 then
    email_to:=emp_rec.pks_penghantar_id||default_email;
    select b.KS_BIL_NO into no_kes from kertas_siasatan b where b.KS_ID = emp_rec.pks_ks_id;
    subj:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
    mesg:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
    dbms_output.put_line('Sending email to ' || email_to || ' subject: ' || subj);
    dbms_output.put_line('update old pergerakan pks_id : '||emp_rec.pks_id);
    update pergerakan_ks set task_status='Done' where pks_id=emp_rec.pks_id;
    dbms_output.put_line('insert new pergerakan ks : ');
    insert into pergerakan_ks(pks_id,pks_ks_id,pks_km_id,pks_penghantar_id,pks_tkh_hantar,
    pks_penerima_id,pks_tkh_terima,task_name,task_owner,task_status,task_flag,fb_id)
    values(pks_id_seq.nextval,emp_rec.pks_ks_id,emp_rec.pks_km_id,
    emp_rec.pks_penghantar_id,sysdate,
    null,
    null,emp_rec.task_name,
    emp_rec.pks_penghantar_id,
    'InProgress',6,emp_rec.fb_id);
    commit;
    e_mail_message(email_to,email_to,subj,mesg);
    end if;
    end if;
    if emp_rec.PKS_TKH_TERIMA is not null then
    dbms_output.put_line('emp_rec.pks_km_id ' || emp_rec.pks_km_id || crlf);
    select c.KM_KPI into kpi from keluar_masuk_ks c where c.KM_ID = emp_rec.pks_km_id;
    no := round(sysdate - to_date(emp_rec.pks_tkh_terima))-kpi;
    dbms_output.put_line('count day - kpi' || no || crlf);
    dbms_output.put_line('kpi ' || kpi || crlf);
    if no = 1 then
    email_to:=emp_rec.pks_penghantar_id||default_email;
    select b.KS_BIL_NO into no_kes from kertas_siasatan b where b.KS_ID = emp_rec.pks_ks_id;
    subj:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
    mesg:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
    dbms_output.put_line('Sending email to ' || email_to || ' subject: ' || subj);
    email_to:=emp_rec.task_owner||default_email;
    subj:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
    mesg:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
    dbms_output.put_line('Sending email to ' || email_to || ' subject: ' || subj);
    e_mail_message(email_to,email_to,subj,mesg);
    e_mail_message(email_to,email_to,subj,mesg);
    end if;
    if no = 3 then
    select b.KS_BIL_NO into no_kes from kertas_siasatan b where b.KS_ID = emp_rec.pks_ks_id;
    email_to:=emp_rec.task_owner||default_email;
    subj:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
    mesg:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
    dbms_output.put_line('Sending email to ' || email_to || ' subject: ' || subj);
    e_mail_message(email_to,email_to,subj,mesg);
    end if;
    end if;
    END LOOP;
    END;
    E_mail_message is the stored procedure invoked by the check_reminder to tell scheduler information of the connection and the email address of the recipients...
    CREATE OR REPLACE procedure
    e_mail_message
    from_name in varchar2,
    to_name in varchar2,
    subject in varchar2,
    message in varchar2
    is
    l_mailhost VARCHAR2(64);
    l_from VARCHAR2(64);
    l_to VARCHAR2(64);
    crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
    l_mail_conn UTL_SMTP.connection;
    mesg VARCHAR2( 4000 );
    BEGIN
    select a.SERVER into l_mailhost from email_setting a where a.SERVER is not null;
    select a.USERNAME into l_from from email_setting a where a.SERVER is not null;
    --UTL_SMTP.open_data(l_mail_conn);
    mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf ||
    'From: <'||l_from||'>' || crlf ||
    'Subject: ' ||subject|| crlf ||
    'To: '||to_name || crlf || '' || crlf ;
    mesg:=mesg||message;
    l_mail_conn := UTL_SMTP.open_connection(l_mailhost, 25);
    UTL_SMTP.helo(l_mail_conn, l_mailhost);
    UTL_SMTP.mail(l_mail_conn, l_from);
    UTL_SMTP.rcpt(l_mail_conn, to_name);
    UTL_SMTP.data(l_mail_conn, mesg);
    UTL_SMTP.quit(l_mail_conn);
    END;
    I tried to execute to execute the e_mail_message procedure but received this error. Also, no notification sent to the email address...
    ORA-29279: SMTP permanent error: 501 5.1.3 Invalid address
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 99
    ORA-06512: at "SYS.UTL_SMTP", line 241
    ORA-06512: at "ILMS.E_MAIL_MESSAGE", line 33
    ORA-06512: at line 13
    Please help so that I can receive the email notification into my email...thanks in advance for your time..

    user13281540 wrote:
    ORA-29279: SMTP permanent error: 501 5.1.3 Invalid address
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 99
    ORA-06512: at "SYS.UTL_SMTP", line 241
    ORA-06512: at "ILMS.E_MAIL_MESSAGE", line 33
    ORA-06512: at line 13This is not an Oracle error - this is the mail server saying "+hey, I don't like that e-mail address you are supplying, I'm not accepting it!+".
    If you look at RFC821 (Request For Comments memo 821 describes the SMTP specifications), you'll see that the sender and recipient needs to be supplied in the format +<[email protected]>+, e.g. +<[email protected]>+.
    I have found that not all SMTP servers are equal in this regard. Some may insist on the brackets around the address, some may not.
    You need to confirm the format of the addresses you use in the "+MAIL FROM+" and "+RCPT TO+" commands.. and ensure that these formats are accepted by your SMTP server - and if not, change your code to use an acceptable format.
    The easiest way to do this is using telnet - and interacting directly and manually with the server. SMTP is a clear text protocol and easy to use manually. Try it. It is the best way to test SMTP interaction and validate the approach and SMTP commands and arguments used by your code.

  • ORA-04030: out of process memory when using Java Stored Procedures

    Hello,
    I have a problem using Java Stored Procedures in Oracle 10g.
    My Java application performs http posts to a webservice and the response is parsed in order to populate some DB tables.
    There is a scheduled job which calls the Java Stored Procedure every x minutes.
    No matter of the 'x minutes' values - after about 160 - 200 calls I get this error:
    ORA-04030: out of process memory when trying to allocate 1048620 bytes (joxp heap,f:OldSpace)
    ORA-04030: out of process memory when trying to allocate 2097196 bytes (joxp heap,f:OldSpace)
    The job stops just while is posting the http request. The weird thing is that almost each time the first http post request I get this error:
    java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
         at java.net.Socket.connect(Socket.java:426)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(DashoA6275)
         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
         at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:130)
         at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
         at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
         at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
    and the second try works fine.
    So, The out of process memory occured each time just before getting such an error, and I suspect to be a connection between these errors.
    Tech details:
    1. OS: WinXP
    2. Oracle 10.1.0.2.0
    3. To perform http post I use HttpClient 3.1 from Apache.
    4. I checked the http connection to be closed each time, and this is done.
    5. I checked the oracle statement and connection to be closed each time and this is done
    6. The JVM error (logged in .trc files of Oracle) is:
    java.lang.OutOfMemoryError
         at java.lang.Thread.start(Native Method)
         at sun.security.provider.SeedGenerator$ThreadedSeedGenerator.run(SeedGenerator.java:297)
    DB Settings details:
    Starting up ORACLE RDBMS Version: 10.1.0.2.0.
    System parameters with non-default values:
    processes = 200
    sessions = 225
    shared_pool_size = 159383552
    large_pool_size = 8388608
    java_pool_size = 104857600
    nls_language = AMERICAN
    control_files = C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL01.CTL, C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL02.CTL, C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL03.CTL
    db_block_size = 8192
    db_cache_size = 29360128
    compatible = 10.1.0
    fal_client = XXXXXX
    fal_server = XXXXXXs
    log_buffer = 524288
    log_checkpoint_interval = 100000
    db_files = 70
    db_file_multiblock_read_count= 32
    db_recovery_file_dest = C:\oracle\product\10.1.0\flash_recovery_area
    db_recovery_file_dest_size= 2147483648
    standby_file_management = AUTO
    undo_management = AUTO
    undo_tablespace = undotbs_01
    undo_retention = 14400
    remote_login_passwordfile= EXCLUSIVE
    db_domain =
    dispatchers = (PROTOCOL=TCP) (SERVICE=XXXXXXXDB)
    remote_dependencies_mode = SIGNATURE
    job_queue_processes = 4
    parallel_max_servers = 5
    background_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\BDUMP
    user_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\UDUMP
    max_dump_file_size = 10240
    core_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\CDUMP
    sort_area_size = 1048576
    sort_area_retained_size = 1048576
    db_name = XXXXXX
    open_cursors = 500
    optimizer_mode = FIRST_ROWS
    pga_aggregate_target = 25165824
    Any help would be appreciated. Thanks.
    Can be a problem with JVM threading under Oracle ?

    The server prcess failed to allocate more memory for large objects ( in Oldspace).
    If you Google ORA-04030, you will see several recommendations to work around this.
    The Java VM in the database already has HttpClient, i don't know why you are loading the Apache HttpClient but this might not be the surce of the problem.
    Kuassi http://db360.blogspot.com

  • Why doesn't SSRS like an IF Statement in my SQL Stored Procedure???

    I have multiple IF Statements at the end of my SQL Stored Procedure Process that utilizes a @ReportTypeName Parameter to produce the chosen report result set
    IF @ReportTypeName = 'HMO-POS New To HFHP - No Prior Year Member Spans'
    BEGIN
    SELECT DISTINCT
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Member Contract Nbr],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Member Subscriber Member Nbr],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Pkg],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Division Nbr],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER EFF DATE],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER FIRST NAME],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER LAST NAME],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Broker Name],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER ADDRESS 1],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER CITY],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER STATE],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER ZIPCODE],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER PHONE1],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER PHONE2],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER PHONE3],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER EMAIL],
    CONVERT(VARCHAR,CAST(CONVERT(VARCHAR, [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER YMDBIRTH]) AS DATETIME),101) AS [INDV MEMBER BirthDate],
    FLOOR((CAST (GETDATE() AS INTEGER) - CAST(CONVERT(DATETIME, CONVERT(CHAR(8), [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER YMDBIRTH])) AS INTEGER)) / 365.25) AS [INDV MEMBER AGE]
    FROM [#TempTable_Distinct_Individual_Member_All_Info]
    WHERE (CHARINDEX('HMO',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0
    OR CHARINDEX('POS',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0)
    AND [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR] NOT IN
    (SELECT [#TempTable_Distinct_Individual_Member_Prior_Year_Spans].[INDV MEMBER NBR]
    FROM [#TempTable_Distinct_Individual_Member_Prior_Year_Spans])
    ORDER BY [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR]
    END
    IF @ReportTypeName = 'HMO-POS Renewals'
    BEGIN
    SELECT DISTINCT
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Member Contract Nbr],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Member Subscriber Member Nbr],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Pkg],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Division Nbr],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER EFF DATE],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER FIRST NAME],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER LAST NAME],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV Broker Name],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER ADDRESS 1],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER CITY],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER STATE],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER ZIPCODE],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER PHONE1],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER PHONE2],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER PHONE3],
    [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER EMAIL],
    CONVERT(VARCHAR,CAST(CONVERT(VARCHAR, [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER YMDBIRTH]) AS DATETIME),101) AS [INDV MEMBER BirthDate],
    FLOOR((CAST (GETDATE() AS INTEGER) - CAST(CONVERT(DATETIME, CONVERT(CHAR(8), [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER YMDBIRTH])) AS INTEGER)) / 365.25) AS [INDV MEMBER AGE]
    FROM [#TempTable_Distinct_Individual_Member_All_Info]
    INNER JOIN [#TempTable_Distinct_Individual_Member_Prior_Year_Spans]
    ON [#TempTable_Distinct_Individual_Member_Prior_Year_Spans].[INDV MEMBER NBR] = [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR]
    WHERE (CHARINDEX('HMO',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0
    OR CHARINDEX('POS',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0)
    ORDER BY [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR]
    END
    Microsoft Visual Studio and SQL Server Reporting Services did not like this! When I added my dataset and parameters accordingly, my Dataset had no fields...almost as if running the Stored Procedure in the background to get its Metadata was not working. I
    know this works because I tested it as a result of a straight EXEC Command. Why doesn't Microsoft Visual Studio and SQL Server Reporting Services not like this IF? I did end up getting around this by parameterizing the WHERE clause based on the @ReportTypeName
    chosen.
    WHERE (@ReportTypeName = 'HMO-POS New To HFHP - No Prior Year Member Spans'
    AND (CHARINDEX('HMO',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0
    OR CHARINDEX('POS',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0)
    AND [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR] NOT IN
    (SELECT [#TempTable_Distinct_Individual_Member_Prior_Year_Spans].[INDV MEMBER NBR]
    FROM [#TempTable_Distinct_Individual_Member_Prior_Year_Spans]))
    OR (@ReportTypeName = 'HMO-POS Renewals'
    AND (CHARINDEX('HMO',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0
    OR CHARINDEX('POS',LTRIM(RTRIM([#TempTable_Distinct_Individual_Member_All_Info].[INDV Benefit Plan Name])),1) > 0)
    AND [#TempTable_Distinct_Individual_Member_All_Info].[INDV MEMBER NBR] IN
    (SELECT [#TempTable_Distinct_Individual_Member_Prior_Year_Spans].[INDV MEMBER NBR]
    FROM [#TempTable_Distinct_Individual_Member_Prior_Year_Spans]))
    I appreciate your review and am hopeful for a reply.
    Thanks!

    Hi ITBobbyP,
    I have tested on my local environment and can reproduce the issue, the issue can be caused by the temp table you are using which will also cause the data not display.
    I have use below sample table and record to have a test and details information below for your reference:
    Right click the DataSet to select the "DataSet Properties" and click the query designer to execute the stored procedure by click the "!" to check if you can get the data:
    If you got some error, the issue can be cause by the temp table invalid, so please make sure you have add the query to create and insert  recored to temp table like below:
    CREATE PROCEDURE vickytest0311_1
    @ReportTypeName nvarchar(50)
    AS
    create table #VickyTest
    column1 int,
    column2 varchar(20)
    insert into #VickyTest values (1,'Test1')
    insert into #VickyTest values (2,'Test2')
    insert into #VickyTest values (3,'Test3')
    IF @ReportTypeName ='Test1'
    BEGIN
    select * from #VickyTest
    where Column1=1
    END
    IF @ReportTypeName ='Test2'
    BEGIN
    select * from #VickyTest
    where Column1=2
    END
    GO
    3. I recommend you to not use the temp table and you will not need to add the create and insert statement in the stored procedure.
    4. If you still got no data, please try to click the "Refresh fields" as below:
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Need sample source code for calling stored procedure in Oracle

    Hi.
    I try to call stored procedure in oracle using JCA JDBC.
    Anybody have sample source code for that ?
    Regards, Arnold.

    Thank you very much for a very quick reply. It worked, but I have an extended problem for which I would like to have a solution. Thank you very much in advance for your help. The problem is described below.
    I have the Procedure defined as below in the SFCS1 package body
    Procedure Company_Selection(O_Cursor IN OUT T_Cursor)
    BEGIN
    Open O_Cursor FOR
    SELECT CompanyId, CompanyName
    FROM Company
    WHERE CompanyProvince IN ('AL','AK');
    END Company_Selection;
    In the Oracle Forms, I have a datablock based on the above stored procedure. When I execute the form and from the menu if I click on Execute Query the data block gets filled up with data (The datablock is configured to display 10 items as a tabular form).
    At this point in time, I want to automate the process of displaying the data, hence I created a button and from there I want to call this stored procedure. So, in the button trigger I have the following statements
    DECLARE
    A SFCS1.T_Cursor;
    BEGIN
    SFCS1.Company_Selection(A);
    go_Block ('Block36');
    The cursor goes to the corresponding block, but does not display any data. Can you tell me how to get the data displayed. In the future versions, I'm planning to put variables in the WHERE clause.

  • Identifying which part of stored procedure is taking long time

    Hi Everyone,
    I have a stored procedure which is taking long time to execute.  I am trying to understand which part/query in the stored procedure is taking long time.
    It involves lots of table variables and n no of queries .Could anyone please help me in how to identify which query/part of the stored procedure is taking long time to execute?
    Thanks in Advance

    Hi Vivek -
    I am only familiar with running the plan visualization for a single SQL query.
    Could you please guide me how to run it for a procedure.
    Thanks in Advance.

  • Multiple stored procedures using JDBC Adopter, Synchronous call

    Hello Guys,
    This is kind of different scenario,
    Here is the scenario (SQL Server -> XI -> Legacy)
    1.I want to trigger stored procedure (from XI to)
    2.Inside the stored procedure we are going to have multiple stored procedures.
    -Inside stored procedures
    SP1 -> It supposed to select the data from interface control table, if that is success
    SP2 -> Call some other stored procedures which can be select/insert/delete from different tables most of the cases it would be select, if that is success
         It should give results back (Response) to XI and with some output parameters like (status message, etc…)
    Next step I want send those results to target system which is legacy. If that is success
    Next step I should update entry in the Interface control table(which is in SQL Server) with success entry like (success message, current date, current time, interface name, username.) 
         If it fails any stage like while selecting data from interface control table which is SP1/ SP2 It should give error message back to XI(output parameters). XI is going to send Alerts/Mails to respective interface owners.
    This is my scenario can anybody help me on this what needs to be done to implement this scenario.

    Hi Murali,
    Anyway , altimately you are going to call one stored procedure and going to get one output. So it will not be a problem I think.
    Anyway it is required to introduce BPM here.
    <i>Next step I want send those results to target system which is legacy. If that is success</i>
    >>>You can make sure that message is recieved by legacy system. Because legacy systems like File systems will not support Application Acknowledgement. So here you can go with Transport Acknowledgement.
    From where will get Success messages like (current date etc) are you planning to take XI system date.. If so you can get this. And you can send the message to SQL.
    <i>If it fails any stage like while selecting data from interface control table which is SP1/ SP2 It should give error message back to XI(output parameters). XI is going to send Alerts/Mails to respective interface owners.</i>
    >>>For application errors like SP2 error etc, you need to get the Error Response from stored procedure itsel.
    Second option is you can go with Adapter Alerting, whenever any error in the Sender JDBC adapter.
    Anyway design/requirement should be perfect, before start the process here...
    Regards,
    Moorthy

Maybe you are looking for

  • Looking for a better way to backup end users

    Hello there. Not sure if this the best forum for this post but here goes. Last week my company had a break in and a couple of laptops got lifted. Not a big deal as I had backups of the machines on tape. It did take a while to recover the files though

  • How expired mat. sent back to vendor and credit the vendor account for that

    actually, initially at the time of SAP implementation,some stocks of material uploded directly by 561. now, some of this stock are expired so, i want to sent back those material to vendor and against that give credit to vendor. i have no PO for those

  • Patching vulnerabilities for PCI compliance

    Hi My Apple Profile Manager server has failed a PCI compliance scan, due to the vulnerabilities listed below. The OS and the software are patched to the highest level, but its still failing What do i need to do to be able to resolve these? If i can't

  • Tecra M2: Installing a clean version of Win XP Pro

    I have a tecra M2, and due to the number of updates, and SP2 release I wish to format, install a clean version of windows xp pro, and then install all the toshiba drivers and programs. I am looking for guidance in which order should I install them, o

  • Colour Finesse in Premiere?

    Hi - I'd like to get Synthetic Aperture set up to work in Premiere Pro - it'll save having to open clips in After Effects just to do the colour correcting, meaning that at the end of a project almost all the clips on the timeline are after effects li