Error ORA-04031 while executing a stored procedure from Pro C++ code

I am getting the error ORA-04031(Unable to allocate 4096 bytes of shared memory("Shared Pool",.....)) while trying to execute a stored procedure from my pro*C application. This happens only after a few hours since the application has been running. I am closing the cursor after every database call.
Does anyone know why it is happening and any possible solutions?
TIA
Srithaj.

One thing that can be done is to flush the shared pool before starting the application.
alter system flush shared pool;
Another is to increase the shared pool size by setting the parameter shared_pool_size in init_sid.ora file.
null

Similar Messages

  • Error while executing a stored procedure from forms6i

    When I execute a STORED PROCEDURE from ORACLE DB 10g this procedure works perfectly fine.
    But when I execute the same from the FORMs 6i I get the following error:
    PDE-PLU022 Don't have access to the stored program unit
    XMLPARSERCOVER in schema CARE.
    where XMLPARSERCOVER is the class and
    CARE is the schema.
    Regards,
    Jignesh S

    I have tried this with both the owner of the schema and the intended user, -from both forms and directly.
    All rights was granted on the stored procedure. Since posting I have found that one of the tables that the procedure might insert into, was not explicitly granted to the intended user, and after rectifying that the error message went away.
    -however, the procedure now silently "finishes" without any evidence that it ever ran, if invoked from the forms application. When invoked from SQL Plus (or JDev, or Toad) it runs as expected.
    I have no public synonym for the procedure, -is that necessary?
    The stored procedure in question is implemented in java, and published as a stored procedure. It does rather heavy lifting, when running, using a view against another server , updating local tables and quite a lot of data validation/cleansing, and logging. All recourses are within the same schema.
    Any ideas?

  • Error while executing java stored procedure from a pl/sql procedure

    We have a requirement where we need to execute JAVA code stored in an Oracle database (Java Stored Procedure). This code uses some JAR files which we have already loaded without any errors in the database.
    The class file was also loaded in the database without any errors. But when we execute the method of this class (JAVA code), it gives the following error:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.NoClassDefFoundError
    Is there any way of debugging the code and getting to know where exactly the problem is? Or, any tool/software available for doing the same.
    Any pointers would be of great help!
    Thanks in advance

    Hi Uday,
    My guess is that there is a problem with your java stored procedure that is causing the "ExceptionInInitializer" error to be thrown. According to the javadoc:
    is thrown to indicate that an exception occurred during
    evaluation of a static initializer or
    the initializer for a static variable
    Since I didn't see any of your code in your post, I can't help you much more, I'm afraid. Perhaps if you would provide some more details, I may be able to help you some more. I think the following details would be helpful:
    1. Complete error message and stack trace you are getting.
    2. The section of your java code that you think is causing the problem.
    3. Oracle database version you are using.
    Good Luck,
    Avi.

  • Error while executing the stored procedure through sender JDBC adapter

    Hi All,
    I am getting below error while executing the stored procedure through sender JDBC adapter.
    Database-level error reported by JDBC driver while executing statement 'exec SapgetNextEntity 'SalesOrder''. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor.
    what is the problem? any idea to anyone...
    regards
    Ramesh

    hi Dharamveer,
    I am not getting below statement for your reply
    Try to use Refrence Cursor it will return u reference of resultset.
    I mention SP like this
    exec SapgetNextEntity 'SalesOrder'
    SapgetNextEntity -
    > SP Name
    SalesOrder----
    > Parameter I am passing...
    regards
    Ramesh

  • Strange error while executing a stored procedure: Incorrect syntax near '@p0'

    All, I am getting a strange error while executing a stored procedure: Incorrect syntax near '@p0'  using JDBC CallableStatment.
    Here is my code...
    CallableStatement cStmt = con.prepareCall("{call SET CHAINED ON EXEC <dbName>.<schemaName>.<SPName> (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}");
    cStmt.setString(1, "2012005881");
    cStmt.setString(2, "07");
    cStmt.setString(3, "10");
    cStmt.setString(4, "Case title");
    cStmt.setString(5, "Open");
    java.sql.Date dt1 = new java.sql.Date(2014,10,20);
    cStmt.setDate(6, dt1);
    cStmt.setString(7, "01");
    cStmt.setString(8, "N");
    cStmt.setString(9, "ADA Test");
    cStmt.setString(10, "N");
    cStmt.setString(11, "English");
    cStmt.setString(12, "N");
    cStmt.setString(13, "N");
    cStmt.setString(14, "N");
    cStmt.setString(15, "N");
    cStmt.setString(16, "N");
    cStmt.setString(17, "N");
    cStmt.setString(18, "07");
    cStmt.setString(19, "10");
    cStmt.setString(20, "juache0");
    java.sql.Date dt2 = new java.sql.Date(2014,10,20);
    java.sql.Date dt3 = new java.sql.Date(2014,10,20);
    cStmt.setDate(21, dt2);
    cStmt.setDate(22, dt3);
    cStmt.setString(23, "userid0");
    cStmt.setString(24, "");
    cStmt.setString(25, "");  
    cStmt.setString(26, "");
    java.math.BigDecimal bg1 = new java.math.BigDecimal(10);
    cStmt.setBigDecimal(27, bg1);
    cStmt.setString(28, "userid");
    cStmt.setString(29, "userid");
    int hadResults = cStmt.executeUpdate();
    Your help is greatly appreciated.
    I am executing the above using Jconnect3.0 driver, inside WebSphere Application Server V8.0
    Thanks
    Nags

    NOTE: I don't work with JDBC/jConnect so (at this point) just some questions ...
    1 - are you sending this to ASE, ASA, IQ, or some other RDBMS?
    2 - what is the value of <schemaname>?
    3 - do you have other prepareCall() instances that successfully call a stored proc? [would be interesting to see if there's a difference in the format of the calls]
    A quick google search shows a couple ways to submit a stored proc execution to the RDBMS, with the format depending on the format expected by the target RDBMS.
    I'm wondering if you really need/want the parentheses around the argument list, ie, what happens if you change
    from
    -- parentheses around args
    EXEC <dbName>.<schemaName>.<SPName> ( ?,?,?,?,?,...,? )
    to
    -- no parentheses around args
    EXEC <dbName>.<schemaName>.<SPName> ?,?,?,?,?,...,?
    In ASE if I wrap the parameters in parentheses I get the same error you're getting:
    ================== w/ parentheses => error
    1> sp_who (sa)
    2> go
    Msg 102, Level 15, State 1:
    Server 'CC1_V1', Line 1:
    Incorrect syntax near 'sa'.   <<=== sa == @p0 ??
    ================== w/out parentheses => works
    1> sp_who sa
    2> go
    fid spid status  loginame origname ...
       0   17 running sa       sa       ...
    ==================

  • How to limit the response rows while invoking a stored procedure from OSB 10gR3

    Dear Experts,
    I am trying to limit the response while invoking a stored procedure from OSB via DB adapter.
    Here the stored procedure returns cursors as response. I tried using the MaxTransactionSize propertiy (which is used for polling the database option in DB adapter).
    We are investigating the ways to protect the application from response containing huge number of rows.
    Is there any way to restrict the number of rows returned in each and every cursor while invoking the stored procedure via DB adapter?
    Thanks
    Ram

    Hi James ,
    I want to know how to run stored procedure using jca adapter in OSB11g.
    I am new to stored prcoedure,will be great if you could share some example on it as above.
    Req: Single input xml will be posted on queue ,need to perform 3 DB operation (with same input):
    1.Insert operation to insert master table contents.
    2.select the primary key column value from master table for the last inserted record.
    3.Need to insert primary key column value + other fields frm same xml file to child table.
    Pls assist me on how to create a simple stored procedure and to run the same with OSB 11g.I am familiar with creation of DB adapter using Jdeveloper,we have option to perform insert and to call stored procedure here,will it be useful for this scenario?
    Edited by: Anitha R on Nov 21, 2010 9:30 PM

  • Execute a stored procedure from a JSP.(Help...)

    How can I execute a stored procedure from a JSP.
    Wich tags I need to use ???
    I'm using the oracle thin JDBC.
    please help me.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Mario Bellido ([email protected]):
    How can I execute a stored procedure from a JSP.
    Wich tags I need to use ???
    I'm using the oracle thin JDBC.
    please help me.<HR></BLOCKQUOTE>
    I just try a simple call with a data tag just like this (see category.jsp in the onlineorder example provided with Jdev 3.2.3):
    <!-- Tutorial - ApplicationModule Tag -->
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <jbo:ApplicationModule configname="OnlineOrders.OnlineOrdersModule.LocalConfig" id="OnlineOrdersModule" username="BC4J" password="BC4J" />
    <!-- Tutorial - DataSource Tag -->
    <jbo:DataSource id="category" appid="OnlineOrdersModule" viewobject="CategoryView" ></jbo:DataSource>
    <jbo:ExecuteSQL appid="OnlineOrdersModule" >
    insert into tablejsp values ('testtable')
    </jbo:ExecuteSQL>
    <jbo:ExecuteSQL appid="OnlineOrdersModule" >
    call testjsp()
    </jbo:ExecuteSQL>
    <jbo:Commit appid="OnlineOrdersModule" />
    testjsp is a stored PL/SQL procedure without arguments.
    null

  • How to call stored procedure from Pro*C

    How to call stored procedure from Pro*C ?
    my system spec is SuSE Linux 9.1, gcc version : 3.3.3, oracle : 10g
    my Pro*C code is the following..
    EXEC SQL EXECUTE
    begin
    test_procedure();
    end;
    END-EXEC;
    the test_procedure() has a simple update statement. and it works well in SQL Plus consol. but in Pro*C, there is a precompile error.
    will anybody help me what is the problem ??

    I'm in the process of moving C files (with embedded SQL, .PC files) from Unix to Linux. One program I was trying to compile had this piece of code that called an Oracle function (a standalone), which compiled on Unix, but gives errors on Linux:
    EXEC SQL EXECUTE
    BEGIN
    :r_stat := TESTSPEC.WEATHER_CHECK();
    END;
    END-EXEC;
    A call similar to this is in another .PC file which compiled on Linux with no problem. Here is what the ".lis" file had:
    Pro*C/C++: Release 10.2.0.1.0 - Production on Mon Jun 12 09:26:08 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Error at line 193, column 5 in file weather_check.pc
    193 BEGIN
    193 ....1
    193 PCC-S-02346, PL/SQL found semantic errors
    Error at line 194, column 8 in file weather_check.pc
    194 :r_stat := TESTSPEC.WEATHER_CHECK();
    194 .......1
    194 PLS-S-00000, Statement ignored
    Error at line 194, column 18 in file weather_check.pc
    194 :r_stat := TESTSPEC.WEATHER_CHECK();
    194 .................1
    194 PLS-S-00201, identifier 'TESTSPEC.WEATHER_CHECK' must be declared
    Pro*C/C++: Release 10.2.0.1.0 - Production on Mon Jun 12 09:26:08 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    System default option values taken from: /oracle_client/product/v10r2/precomp/ad
    min/pcscfg.cfg
    Error at line 194, column 18 in file weather_check.pc
    :r_stat := TESTSPEC.WEATHER_CHECK();
    .................1
    PLS-S-00201, identifier 'TESTSPEC.WEATHER_CHECK' must be declared
    Error at line 194, column 8 in file weather_check.pc
    :r_stat := TESTSPEC.WEATHER_CHECK();
    .......1
    PLS-S-00000, Statement ignored
    Semantic error at line 193, column 5, file weather_check.pc:
    BEGIN
    ....1
    PCC-S-02346, PL/SQL found semantic errors

  • Geeting TIMEOUT while executing a Stored Procedure.

    Hi Gurus,
    Am facing a TimeOut  issue while executing the Sql Stored Procedure.
    I have changed a settings of Execution TimeOut to Zero (which is unlimited ), Am still unable to execute the Stored Procedure.
    Should i have to add any TimeOut Command in my Sql Stored Procedure. If please suggest me.
    Thanks in advance.

    Time out is the client who throws the error  not SQL Server. Please read Erland's article
    http://www.sommarskog.se/query-plan-mysteries.html
    Are you sure there is blocking/locking? Is that possible someone run BEGIN TRAN and did not properly specify COMMIT TRAN?
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Executing a stored procedure from a java program

    Hi.. how can i call a oracle stored procedure from a java
    program. the OSP has four IN parameters and one OUT parameter(a
    cursor). when i try this way.. i get an error
    con = DriverManager.getConnection(url, "stored", "stored");
    CallableStatement cs =
    con.prepareCall(
    "{call stored_proce_1(?,?,?,?,?)}");
    cs.registerOutParameter(1, OracleTypes.CURSOR);
    cs.setString(2, "14541");
    cs.setString(3, "gen");
    cs.setInt(4, 0);
    cs.setInt(5, 5);
    ResultSet rs =cs.getResultSet();
    while(rs.next()){
    System.out.println(rs);
    appreciate ur help.
    qs

    I'm no expert on this, but I have a similar call where I fetch
    an Oracle REF CURSOR from a call to a stored function. If you
    fetch the cursor as an Object from your CallableStatement, you
    can then cast it to a ResultSet e.g.
    mystatement.executeUpdate();
    ResultSet rs = (ResultSet) mystatement.getObject(1);
    Then you should be able to loop through your ResultSet as usual.
    Good luck!
    Chris

  • Execute oracle stored procedure from C# always returns null

    Hi,
    I'm trying to execute a stored procedure on oracle 9i. I'm using .Net OracleClient provider.
    Apparently, I can execute the stored procedure, but it always returns null as a result (actually all the sp's I have there returns null)! I can execute any text statement against the database successfully, and also I can execute the stored procedure using Toad.
    This is not the first time for me to call an oracle stored procedure, but this really is giving me a hard time! Can anyone help please?
    Below are the SP, and the code used from .Net to call it, if that can help.
    Oracle SP:
    CREATE OR REPLACE PROCEDURE APIECARE.CHECK_EXISTENCE(l_number IN NUMBER) AS
    v_status VARCHAR2(5) := NULL;
    BEGIN
    BEGIN
    SELECT CHECK_NO_EXISTENCE(to_char(l_number))
    INTO v_status
    FROM DUAL;
    EXCEPTION WHEN OTHERS THEN
    v_status := NULL;
    END;
    DBMS_OUTPUT.PUT_LINE(v_status);
    END CHECK_CONTRNO_EXISTENCE;
    C# Code:
    string connStr = "Data Source=datasource;Persist Security Info=True;User ID=user;Password=pass;Unicode=True";
    OracleConnection conn = new OracleConnection(connStr);
    OracleParameter param1 = new OracleParameter();
    param1.ParameterName = "v_status";
    param1.OracleType = OracleType.VarChar;
    param1.Size = 5;
    param1.Direction = ParameterDirection.Input;
    OracleParameter param2 = new OracleParameter();
    param2.ParameterName = "l_number";
    param2.OracleType = OracleType.Number;
    param2.Direction = ParameterDirection.Input;
    param2.Value = 006550249;
    OracleParameter[] oraParams = new OracleParameter[] { param1, param2 };
    OracleCommand cmd = new OracleCommand("CHECK_EXISTENCE", conn);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.AddRange(oraParams);
    conn.Open();
    object result = cmd.ExecuteScalar();
    conn.Close();

    Hi,
    Does that actually execute? You're passing two parameters to a procedure that only takews 1 and get no error?
    Your stored procedure doesnt return anything and has no output parameters, what are you expecting to be returned exactly?
    If you're trying to access V_STATUS you'll need to declare that as either an output parameter of the procedure, or return value of the function, and also access it via accessing Param.Value, not as the result of ExecuteScalar.
    See if this helps.
    Cheers,
    Greg
    create or replace function myfunc(myinvar in varchar2, myoutvar out varchar2) return varchar2
    is
    retval varchar2(50);
    begin
    myoutvar := myinvar;
    retval := 'the return value';
    return retval;
    end;
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    public class odpfuncparams
         public static void Main()
          OracleConnection con = new OracleConnection("user id=scott;password=tiger;data source=orcl");
          con.Open();
          OracleCommand cmd = new OracleCommand("myfunc", con);
          cmd.CommandType = CommandType.StoredProcedure;
          OracleParameter retval = new OracleParameter("retval",OracleDbType.Varchar2,50);
          retval.Direction = ParameterDirection.ReturnValue;
          cmd.Parameters.Add(retval);
          OracleParameter inval = new OracleParameter("inval",OracleDbType.Varchar2);
          inval.Direction = ParameterDirection.Input; 
          inval.Value="hello world";
          cmd.Parameters.Add(inval);
          OracleParameter outval = new OracleParameter("outval",OracleDbType.Varchar2,50);
          outval.Direction = ParameterDirection.Output;
          cmd.Parameters.Add(outval);
          cmd.ExecuteNonQuery();
          Console.WriteLine("return value is {0}, out value is {1}",retval.Value,outval.Value);
          con.Close();
    }

  • Incorrect Update Count by executing a stored procedure from Java

    Hi Guys,
    I am calling a stored procedure from the java program which is modifying the rows of a table. Now I want to know how many rows have been modified by executing the stored procedure. I am writing the following code for the purpose:
    OracleCallableStatement stmt =
    (oracle.jdbc.driver.OracleCallableStatement)con.prepareCall("{callsp_um_setForumID(?,?)}");
    stmt.setInt(1,101);
    stmt.setInt(2,666);
    n = stmt.executeUpdate();
    System.out.println(n + " row(s) updated");
    This procedure is actually modifying the table(When I query the databse it has modified 1 row). But it is returning a value 0 and is printing "0 row(s) updated".
    Is there a way by which I can find out the number of rows updated by executing the stored procedure?
    Thanks
    Sachin
    [email protected]

    I'm no expert on this, but I have a similar call where I fetch
    an Oracle REF CURSOR from a call to a stored function. If you
    fetch the cursor as an Object from your CallableStatement, you
    can then cast it to a ResultSet e.g.
    mystatement.executeUpdate();
    ResultSet rs = (ResultSet) mystatement.getObject(1);
    Then you should be able to loop through your ResultSet as usual.
    Good luck!
    Chris

  • Executing a stored procedure from an Ifs Program

    I have a need to execute a stored procedure in another schema
    within the same database, and I need to receive an OUT parameter
    to continue processing. The oracle.ifs.server.sql.IfsConnection
    is not in my class path. Can someone tell me which jar file to
    adde to my classpath to have this funcitonality that IFS claim.
    Regards,
    Jeff

    Guys I need help with this one as soon as possible.

  • Execute Oracle Stored Procedure from Excel

    Is it possible to execute an Oracle Stored Procedure from Microsoft Excel and return the result of the Oracle Store Procedure into the excel spreadsheet.

    Yes. You can use Oracle Objects for OLE to accomplish this. It comes with Excel examples and an online help file with many more examples.

  • Execute APEX stored procedure from outside APEX

    I am looking at developing an application in APEX, but there needs to be a batch component that I would like to call from our corporation's scheduler. Is there a way for me to call an APEX stored procedure from a 3rd party scheduling software?
    We use this method on all other oracle databases here, but are new to using APEX.
    Thank you,
    Trevor

    This applicaiton is for the internal administration of an External database.
    So there is an external web application that will have a user sign in, and request some transactions. These requests need to be brought inside our firewall to the APEX tables, where our admin staff will access the requests via this internal administrative applicaiton. It will tie into our Customer Information System, giving our staff all the data they need in one application. Requested transactions, and customer information. Once processed, the status of each transaction will be pushed back out to the external database for our customers to view.
    The transfer of data, along with some other logic, is written in PL/SQL stored procs. To keep within our devlopement guidleines, I would like to kick them off using our existing scheduler. That way I only have one internal database to worry about.

Maybe you are looking for