I have an error ora-04031 on XE 11g

hello,
I have an error ora-04031 on XE 11g
When I restart DB, this error is fixed.
Can I set any parameter(SHARED_POOL_SIZE) to fixed this error?
OS:win 2003 server
ora-00604: error occurred at recursive SQL level 1
ora-04031: unable to allocate 4064 bytes of shared memory ("shared pool","select t.rowcnt, t.blkcnt, t...","sga heap(1,0)","kglsim heap")

Hello,
Can I set any parameter(SHARED_POOL_SIZE) to fixed this error?There actually is a parameter, but in 11g XE it's not effective by default because Automatic Memory Management (AMM) is activated. AMM tries to tune the different memory parameters to achieve best performance for all activities in the database.
You can disable automatic memory management, but I'd not recommend to do that unless you really know what you do.
In your case, I'd start to investigate if a perticular query is causing that issue and you might be able to tune it, so it needs less memory. A second step would be to check whether your instance is already using the 1 GB you can have in XE. To find out, run the following query
select * from v$parameter where name in ('memory_target', 'sga_target','sga_max_size','pga_aggregate_target');The parameters for AMM would be memory_target and memory_max_target where memory_target is the effecitve maximum amount of memory used by XE. If it's not enabled (set to 0), the other three might be effecitve.
To increase the value for memory_target you can run
alter system set memory_target=<size>M;where +<size>M+ would be the amount of memory in megabytes. As mentioned before, you can assign a maximum of 1 GB and not more than you've defined in the memory_max_target parameter. To increase that value, you need to run
alter system set memory_max_target=<size>M scope=spfile;and restart your database before you can alter memory_target to a higher value.
BTW: For further investigation you don't need to restart the database to reset the shared pool: You can do this by issuing the following command
alter system flush shared_pool;If this all doesn't help, I'd recommend to dig in deeper into memory management of the Oracle Database. But let's start with first steps first.
-Udo

Similar Messages

  • 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

  • ORACLE error ORA-04031: unable to allocate 16 bytes of memory

    Error
    UDI-04031: operation generated ORACLE error 4031
    ORA-04031: unable to allocate 16 bytes of shared memory ("shared pool","SELECT j
    generated during import operation, using documentation about migration from 10g XE to 11g XE.

    Hello,
    you could try to override the automatic memory management and setup your SGA to be larger by setting SGA_TARGET. If that doesn't help yet, you could even try to configure the memory size for the components in SGA manually, but I guess this won't be necessary.
    After your import is done, I'd recommend to use automatic memory management again.
    See the XE 2 Day DBA for details, especially the section on [url http://download.oracle.com/docs/cd/E17781_01/server.112/e18804/memory.htm#ADMQS174]Managing Memory. It's not a complete guide, but a rough introduction, but it'll probably help you understand the memory concepts in the database.
    Keep in mind that you may only assign 1 GB of memory in total when you setup your memory manually.
    -Udo

  • Error (ORA-12505) in answers 11g

    Hi all,
    I have tried to install SampleApp(build 825) on 11g.
    http://www.oracle.com/technetwork/middleware/bi-foundation/obiee-samples-167534.html
    When I try to look data in Administration tool I can, but when loging in in Anayltics and try to look requests I am getting error
    *Oracle Error code: 12505, message: ORA-12505: TNS:listener does not currently know of SID given in connect descriptor at OCI call OCIServerAttach. [nQSError: 17014] Could not connect to Oracle database. (HY000)*
    How to resolve this?
    Thanks

    Admintool and Answers might use different ORACLE_HOMEs.
    Do you have an Oracle db client installed on the same machine?
    In 11g Obiee brings its own Oracle client, so you might have two on your box.
    if so, just check that both tnsnames.ora have the sid you are using.
    Knut

  • SAP BW with ORA-04031 Errors

    Hello All,
    Context:
    We have a financial closing system working in the BW 3.5 and Oracle 9.2.0.7.0.
    We are working with more than 100 millions records in 3 days.
    In general, the system uses the standard data marts and BPS processes (copy, distribution, etc).
    Error:
    We had a lot of ORA-04031 errors for all execution (ABAP Programs, Data Loads, BPS Executions), it stopped the environment.
    We did the "stop/start" the server to solved the problem.
    The basis team increase the parameter "shared_pool_size" = 3000M - We saw the SAP Note (690241) and which is more than enough.
    We have fear about it, we think it is posible to occurs again.
    This is a big impact for the business.
    Have you got this error in the past?
    Could you please help us.
    Thanks a lot.
    Daniel Souza
    SAP BW, SEM and Portal Consultant.
    São Paulo - Brazil
    +55 11 99092151

    Hi Chandran,
    We saw this note.
    The basis team have been changed the KGHDSIDXCOUNT parameter ( 4 to 1).
    I am not founding more causes for this problem in the note.
    Is it posible to have problems if the DB_CACHE_SIZE parameter is very large? example 18000M?
    The basis team reduces the value for 1700M, in the last shutdown.
    How can I flush the memory automatically?
    The basis team reported this error for us. "It is not posible to flush the memory, it is necessary to shutdown the server".
    Is it posible for the oracle 9i manage the memory area (shared pool) automatically? Is it recommended? Have you got this experience?
    We have seen two notes about it:
    997889 --> "Increase the memory SGA the ocurrence of error ORA-04031 but it does not prevent it."
    617416 --> "The following areas of the SGA can be changed dynamically with Oracle 9.2 if the SGA is configured dynamically: Buffer Cache, Shared Pool, Large Pool."
    Thanks a lot.
    Best regards,
    Daniel Souza
    São Paulo - Brazil

  • ORA-04031 . how to remove this error.

    Hi Guys,
    when i try to run one of my query based on a view, i get the following error:
    ORA-04031: unable to allocate 4096 bytes of shared memory ("large pool","unknown object","sort
    subheap","sort key")
    I have no idea if this error is related to memory or what. Pliz help how to resolve this error and run my query.
    Regards,
    Imran Baig

    [oracle@demo oracle]$ oerr ora 4031
    04031, 00000, "unable to allocate %s bytes of shared memory (\"%s\",\"%s\",\"%s\",\"%s\")"
    // *Cause:  More shared memory is needed than was allocated in the shared
    //          pool.
    // *Action: If the shared pool is out of memory, either use the
    //          dbms_shared_pool package to pin large packages,
    //          reduce your use of shared memory, or increase the amount of
    //          available shared memory by increasing the value of the
    //          INIT.ORA parameters "shared_pool_reserved_size" and
    //          "shared_pool_size".
    //          If the large pool is out of memory, increase the INIT.ORA
    //          parameter "large_pool_size".
    [oracle@demo oracle]$

  • I have a error when i am starting database

    ERROR:
    ORA-01034: ORACLE not available
    ORA-27102: out of memory
    SVR4 Error: 12: Not enough space
    Additional information: 1
    Additional information: 202
    can someone tell what can i do.
    database is oracle 9207
    unix env 5.8
    i have total 3 database in this server.
    I think it look to me i have some issue with semaphore settings or something else.
    plese help.
    Thanks

    The reason I am asking LARGE_POOL_SIZE is because,
    Also what your current SGA setting in init file.
    ==========================================
    For example, if Oracle displays the following error on startup:
    ORA-27102: out of memory
    SVR4 Error: 12: Not enough space
    Consider reducing the value for LARGE_POOL_SIZE low enough so your database starts. If after lowering the value of LARGE_POOL_SIZE you see the error:
    ORA-04031: unable to allocate 16084 bytes of shared memory ("large
    pool","unknown object","large pool hea","PX msg pool")
    Execute the following query to determine why Oracle could not allocate the 16,084 bytes:
    SELECT NAME, SUM(BYTES) FROM V$SGASTAT WHERE POOL='LARGE POOL' GROUP BY
    ROLLUP (NAME) ;
    Oracle should respond with output similar to:
    NAME SUM(BYTES)
    PX msg pool 1474572
    free memory 562132
    2036704
    3 rows selected.
    To resolve this, increase the value for LARGE_POOL_SIZE. This example shows the LARGE_POOL_SIZE to be about 2MB. Depending on the amount of memory available, you could increase the value of LARGE_POOL_SIZE to 4MB and attempt to start your database. If Oracle continues to display an ORA-4031 message, gradually increase the value for LARGE_POOL_SIZE until startup is successful.

  • ORA-04031 while creating index

    Hi,
    I am creating a schema using IMP utility.
    The import log is showing error (during index creation)
    ORA-04031: unable to allocate 2064 bytes of shared memory ("shared pool","unknown object","sga heap","multiblock rea")
    This is a Oracle 8 (8.1.7.4.0) database. Exports were taken from Oracle 7 and are being imported into Oracle 8.
    Please guide me. I have never worked in such older versions. Below are some details
    SQL> select * from v$sgastat;
    POOL NAME BYTES
    fixed_sga 73888
    db_block_buffers 4505600
    log_buffer 66560
    shared pool free memory 2120444
    shared pool miscellaneous 494960
    shared pool PLS non-lib hp 2096
    shared pool KGFF heap 61212
    shared pool KGK heap 4248
    shared pool KQLS heap 425692
    shared pool trigger inform 120
    shared pool Checkpoint queue 28944
    POOL NAME BYTES
    shared pool latch nowait fails or sle 37632
    shared pool kcb where/why stats array 29376
    shared pool message pool freequeue 124552
    shared pool sessions 366520
    shared pool transactions 166804
    shared pool State objects 188224
    shared pool branches 45120
    shared pool simulator trace entries 80000
    shared pool enqueue_resources 34200
    shared pool long op statistics array 74800
    shared pool PL/SQL DIANA 525652
    POOL NAME BYTES
    shared pool db_files 36272
    shared pool ktlbk state objects 80036
    shared pool dictionary cache 711268
    shared pool table columns 17148
    shared pool java static objs 30560
    shared pool PL/SQL MPCODE 90204
    shared pool fixed allocation callback 1920
    shared pool library cache 1128364
    shared pool db_handles 75000
    shared pool sql area 2040852
    shared pool db_block_buffers 74800
    POOL NAME BYTES
    shared pool processes 119400
    shared pool SYSTEM PARAMETERS 63604
    shared pool transaction_branches 33856
    shared pool event statistics per sess 590240
    java pool free memory 20000768
    Please guide.
    Regards,
    SID

    Hi SID;
    Please see below notes:
    Diagnosing and Resolving Error ORA-04031 on the Shared Pool or Other Memory Pools [Video] [ID 146599.1]
    OERR: ORA 4031 "unable to allocate %s bytes of shared memory ("%s","%s","%s")" [ID 4031.1]
    Regard
    Helios

  • Diagnosing ORA-04031 on Oracle9iR2

    Hi
    We're running an Oracle9iR2 (9.2.0.6) database on Red Hat Enterprise Linux 4.0 (IA32). The database is used for development and testing. It's been running ok until recently users started getting the following error when trying to connect to the database:
    ORA-04031: unable to allocate 17168 bytes of shared memory ("shared pool","unknown object","sga heap(1,0)","session param values")
    What's changed during the last weeks is that we've installed Oracle10gR2 and the Oracle Calendar server on the machine, and added a about 10-20 new user accounts.
    The server was originally running in dedicated server mode until i noticed there were 115 Oracle processes running on the server at one moment. The database typically has large number of connections which are idle most of the time. I changed it to shared server mode in order to avoid the overhead of having lots of server processes which are doing nothing most of the time.
    I also increased the shared_pool_size and large_pool_size on the server but i'm still seeing ORA-04031 errors in trace files. How do i determine whether the cause is shared or large pool? How do i determine the right sizes for these pools? The traces include heap dumps for large pool.
    The SQL query appearing in the trace files cursor name section is just one type of SQL query in most of the cases. How can i debug shared memory usage for a particular SQL query so that i can try and modify it to a more memory economic direction?
    br. aspa

    Hi,
    If you have access to metalink, I advise you to read 146599.1 Diagnosing and Resolving Error ORA-04031.
    The SQL query appearing in the trace files cursor name section is just one type of SQL
    query in most of the cases. How can i debug shared memory usage for a particular SQL
    query so that i can try and modify it to a more memory economic direction?The following SQL can show you statements with literal values or candidates to include bind variables:
    SELECT substr(sql_text,1,40) "SQL",
    count(*) ,
    sum(executions) "TotExecs"
    FROM v$sqlarea
    WHERE executions < 5
    GROUP BY substr(sql_text,1,40)
    HAVING count(*) > 30
    ORDER BY 2;Note: The number "30" in the having section of the statement can be adjusted as needed to get more detailed information.
    There is a fixed table called x$ksmlru that tracks allocations in the shared pool that cause other objects in the shared pool to be aged out. This fixed table can be used to identify what is causing the large allocation.
    SELECT * FROM X$KSMLRU WHERE ksmlrsiz > 0;Note : This view can only be queried by connected as the SYS.
    How have you RAM ?
    Since your last install, perhaps your RAM is not sufficient any more ?
    Check your memory occupation.
    Nicolas.
    How do i determine whether the cause is shared or large pool? If there is no free memory into large pool left when a request is made then an ORA-4031 will be signalled similar to this : ORA-04031: unable to allocate XXXX bytes of shared memory
    ("large pool","unknown object","session heap","frame")
    Message was edited by:
    N. Gasparotto

  • ORA-04031 unable to allocate 4080 bytes of shared memory

    Hi Everyone,
    The error ORA-04031 has been consistently occuring in our production landscape.
    We have Applied Oracle patches in BI7.0 (2004s - Oracle 10.2.0.2) system as per SAP's suggestions.  (A set of 35 patches as per note 871096)
    (Patches List - 5369855,5253307,6340979,5618049,7133360,5895190,6826661,4704890,6005996,5188321,6447320,3748430,5442919,4952782,5458753,5941030,5345999,6153847,5530958,4883635,5636728,4668719,5635254,5063279,7237154,5103126,4638550,4770693,4864648,6046043,7608184,6729801,5363584,6771608,6435823)
    Applying oracle patches has not resolved this issue.  The error is reoccuring.  Now as per notes 1171650 and 830576 we have tuned in certain parameters.
    We also checked the Notes 869006 and 1120481 but nothing much is helpful. 
    A Go-Live is scheduled this week.  Could you please suggest what further actions need to be taken to identify the issue and resolve it.
    Thanks in advance.
    Best Regards
    Bhupesh

    Hi Stefan / Jens,
    Thanks for the help so far.
    Running the SQL statement produced more than 21000 rows.  We could get an idea as to which statement is using more memory.
    Top 5 statements are as below
    SQL> select * from (SELECT SQL_text, SHARABLE_MEM, PERSISTENT_MEM, RUNTIME_MEM FROM V$SQLAREA ORDER BY SHARABLE_MEM desc) where rownum <=5;
    SQL_TEXT
    SHARABLE_MEM PERSISTENT_MEM RUNTIME_MEM
      select a.segment_type,         round(a.mb,2) size_mb,         round(decode(seg_num,0,0,a.mb/a.seg_num),2) size_avg_mb,         a.seg_num,         a.ext_num,              nvl(b.more100ext,0) more100ext,         decode(lower(a.segment_type),'table',c.com_tab,                                      'index',d.com_ind,                                         'table partition',e.com_tpar,                                    'index partition',f.com_ipar,                         0) compressed,          decode(lower(a.segment_type),'table',g.log_tab,                                      'index',h.log_ind,                                'table partition',i.log_tpar,                                     'index partition',j.log_ipar,                                    'lobsegment',k.log_lob,                                 'lobindex',k.log_lob,                                     0) nologging  from (select segment_type,               nvl(count(*),0) seg_num,                    sum(nvl(bytes,0))/10
         1257431         441584      436528
      select a.username user_name,         a.user_id user_id,         round(nvl(b.mb,0),2) size_mb,         nvl(b.seg,0) segments,         nvl(c.tab,0) tables,     nvl(d.ind,0) indexes,          nvl(b.ext,0) extents,         a.default_tablespace default_tablespace,         a.temporary_tablespace temporary_tablespace,      to_char(a.created, 'dd.mm.yyyy') created,         to_char(a.created, 'hh:mm:ss') created,         a.account_status account_status,         a.profile profile  from    dba_users a,    (select owner, count() seg, sum(nvl(bytes,0))/1024/1024 mb,         sum(nvl(extents,0)) ext     from dba_segments group by owner) b, (select owner, count() tab from dba_segments     where segment_type='TABLE' group by owner) c,    (select owner, count(*) ind from dba_segments     where segment_type='INDEX' group by owner) d  where a.username=b.owner() and     a.username=c.owner() and        a.username=d.owner(+)
          578473         200064      196176
    SELECT count(*) over () as total_count,        sd_xe_ash_nm.event_name,        sd_xe_ash_nm.event_id,        sd_xe_ash_nm.parameter1 as p1text,        (CASE WHEN (sd_xe_ash_nm.parameter1 is NULL                 OR                    sd_xe_ash_nm.parameter1 = '0')              THEN 0              ELSE 1         END) as p1valid,     sd_xe_ash_nm.parameter2 as p2text,        (CASE WHEN (sd_xe_ash_nm.parameter2 is NULL                    OR                    sd_xe_ash_nm.parameter2 = '0')           THEN 0              ELSE 1         END) as p2valid,        sd_xe_ash_nm.parameter3 as p3text,        (CASE WHEN (sd_xe_ash_nm.parameter3 is NULL                         OR                    sd_xe_ash_nm.parameter3 = '0')              THEN 0              ELSE 1         END) as p3valid,        sd_xe_ash_nm.keh_evt_id,        nvl(xc.class#, 0) as class_num,             sd_xe_ash_nm.wait_class_id,        nvl(xc.keh_id, 0) as keh_ecl_id,    sd_xe_ash_nm.ash_cnt,         sd_xe_ash_nm.tot_wts_diff,
          453779         138168      132136
      select    a.name db_name,    round((nvl(b.data_KB,0)nvl(c.temp_KB,0))/1024/1024,2) size_gb,    round((nvl(b.data_KB,0)-nvl(d.data_free,0)             nvl(e.temp_KB_used,0))/1024/1024,2) used_gb,         round((nvl(d.data_free,0)nvl(c.temp_KB,0)-     nvl(e.temp_KB_used,0))/1024/1024,2) free_gb,    to_char(((nvl(b.data_KB,0)-nvl(d.data_free,0)           nvl(e.temp_KB_used,0))/(nvl(b.data_KB,0)+              nvl(c.temp_KB,0)))100, '999') percent_used,    to_char(((nvl(d.data_free,0)nvl(c.temp_KB,0)-           nvl(e.temp_KB_used,0))/(nvl(b.data_KB,0)              nvl(c.temp_KB,0)))100, '999') percent_free,    f.num_seg,    g.num_ts,    h.num_us, to_char((nvl(b.data_KB,0)/(nvl(b.data_KB,0)+             nvl(c.temp_KB,0)))100,'999') percent_data,    to_char((nvl(c.temp_KB,0)/(nvl(b.data_KB,0)+          nvl(c.temp_KB,0)))100,'999') percent_temp,    round(to_char((f.tab_kb/(nvl(b.data_KB,0)+                    nvl(c.temp_KB,0)))*100,'999'),0) percent_tab,    round(to_char((f.
          449213         154968      151184
      select ts,         round(size_mb,2) size_mb,         round(free_mb,2) free_mb,         round(decode(size_mb,0,'',(size_mb-           free_mb)100/size_mb),0) per_used,      autoextensible,         round(total_size_mb,2) tot_size_mb,         round(total_free_mb,2) tot_free_mb,         round(decode(total_size_mb,0,'',(total_size_mb-        total_free_mb)100/total_size_mb),0) per_tot_used,         files,         segments,         extents,         status,         contents  from    (select a.tablespace_name ts,         nvl(c.mb,0)nvl(e.mb,0) size_mb,            decode(lower(a.contents),'temporary',              nvl(e.mb,0)-nvl(f.used_mb,0),nvl(d.free_mb,0))           free_mb,            nvl(c.files,0)nvl(e.files,0) files,            nvl(b.seg,0) segments,            nvl(b.ext,0) extents,         decode(lower(a.contents),'temporary',         decode(sign(nvl(e.tot_mb,0)-nvl(e.mb,0)),1,'YES','NO'),         decode(sign(nvl(c.tot_mb,0)-nvl(c.mb,0)),1,'YES','NO'))
          429595         139184      136072
    SQL>
    Please suggest how to go ahead.
    Thanks & Regards
    Bhupesh

  • ORA-04031: unable to allocate 128 bytes of shared memory

    Hi,
    experts i need your advice here,
    in my application we have on so called Master view which has 550 columns, this view is left outer join with 60 other views, something like
    select c1
    from   master_view
             left outer join v1 on --
             left outer join v2 on --
             left outer join v60 the compilation of the master view takes around 140 secs, but when i give grants to other users, or i re compile again, it shows me the error
    ORA-04031: unable to allocate 128 bytes of shared memory plz assist me how i should resolve this issue,
    Regards
    nic

    Hi billy,
    your idea worked big big time,
    i encaspulated all the outer joins views in small small views and finally build mv on each views,
    the master view is plain equijoin, and has only 5 new mvs in its join condition,
    the performance is increased tremendously,
    thanks,
    some times i wonder y i dont get such ides ;-);
    all and all i can say,
    good judgement comes from good experience, but good experience comes from bad judgement...
    Regards
    nic

  • Dbms_sql  in a different schema from query table-error  ** ORA-00942

    Oracle Experts,
    I think I am having problems with using DBMS_SQL in which the function was created in one schema and the query table was created in a different schema.
    We have 2 schemas: S1, S2
    We have 2 tables:
    T1 in Schema S1
    T2 in Schema S2
    We have a function F1 created by DBA in schema S1 that uses the dbms_sql as:
    CREATE OR REPLACE FUNCTION S1.F1(v1 in VARCHAR2) return NUMBER IS
    cursor1 INTEGER;
    BEGIN
    cursor1 := dbms_sql.open_cursor;
    dbms_sql.parse(cursor1, v1, dbms_sql.NATIVE);
    dbms_sql.close_cursor(cursor1);
    return (0);
    EXCEPTION
    when others then
    dbms_sql.close_cursor(cursor1);
    return (1) ;
    END;
    I am using jdeveloper 11G. We have an Oracle DB 11g.
    We have a java program which uses jdbc to talk to our Oracle DB.
    Basically, in my java program, I call function F1 to check if the query is valid.
    If it is, it returns 0. Otherwise, returns 1:
    oracle.jdbc.OracleCallableStatement cstmt = (oracle.jdbc.OracleCallableStatement) connection.prepareCall ("begin ? := S1.F1 (?); end;");
    cstmt.registerOutParameter (1, java.sql.Types.INTEGER);
    cstmt.setString(2, "Select * from S2.T2");
    cstmt.execute ();
    Since the table that I run the query is T2, created in different schema than F1 was created in, I have the error:
    ** ORA-00942: table or view does not exist
    So my questions are these:
    - I am using Oracle DB 11g, if I run the query on a table that created in a different schema from the one that the function (which uses dbms_sql) was created in, I would get the error ORA-00942?
    - If I runs the query on table T1 in the same schema as the function F1, would I have the same problem(The reason I ask is I cannot create any table in schema S1 because the DBA has to do it; I am not a DBA)
    - This is not a problem, but a security feature because of SQL injection?
    - How to resolve this issue other than creating the table in the same schema as the function that utilizes DBMS_SQL?
    Regards,
    Binh

    Definer rights (default) stored objects run under owner's security domain and ignore role based privileges. So regardless what user you are logged in as, function S1.F1 always executes as user S1 and ignores user S1 roles. Therefore exeuting statement within S1.F1:
    Select * from S2.T2requires user S1 to have SELECT privilege on S2.T2 granted to S1 directly, not via role.
    SY.

  • Using PreparedStatement and the Oracle Error ORA-1000

    Hi,
    I have a question about PreparedStatement objects that is not so simple to explain for me. What I would like to know is: if I use a PreparedStatement following traditional and generic steps:
    1- PreparedStatement pStmt = Connection.prepareStatement(sQuery);
    2- pStmt.setXXX(i,j);
    n - pStmt.setXXX(i,j);
    n+1 - ResultSet rs = pStmt.executeQuery();
    n+2 - while(rs.next()){ ... retrive ResultSet data  ... }
    n+3 - rs.close()
    n+4 - back to point number 2
    and at the end (as you can see in the point numbered n+4), instead of closing the PreparedStatement pStmt using the close() method, I reuse the PreparedStatement pStmt comeing back to the point numebr 2 and setting again all its parameters with new values ... then ... what heppens in the Oracle database ? Has been the cursor (so the mamory area), associated to my PreparedStatement object pStmt, duplicated or is it the same ?
    I know that Java allows you to do this kind of operations with PreparedStatement, and I know that in tha Java Documentation is explained to follow this strategy to optimize the execution time because in this way the same PreparedStatement is precompiled and prepared only once. But if I do a for loop following the steps explained before, after many iterations I have the error "ORA-1000: maximum open cursors exceeded". This error is the reason of my question. Does this error means that it's mandatory to close a PreparedStatement always, otherwise if you reuse it without closing it then the corresponding database cursor will be duplicated ? If it is so, then I think this is a contradiction with official java documentation ...
    I'm using Oracle8i (version 8.1.7) and Oracle JDBC Thin Driver (Windows NT) for use with JDK 1.2.x. Moreover, in my database istance the parameter "maximum open cursor" is equal to 800 ...
    Thank you very much for suggestions :-)

    There is no need to close a prepared statement or its resultset for every iteration.
    After the first iteration in a loop, all subsequent executions of it will close the previous resultset. By adding close() method, you are making one extra costly call to the DB for no reason.
    Following is the sample code.I know what you are saying. In fact at the beginning I wrote my code in the same way of your sample (see the code of my first post at the begin of this page).
    But doing so, after thousand iterations of the loop, I had "Oracle Error ORA-1000 : maximun open cursor exeeded" even if in my database istance the parameter "maximum open cursor" is equal to 8000.
    At this moment in my code, for each iteration, I close the PreparedStatement and in this way I don't have anymore the error :-((
    So it seems that only in theory we can reuse a preparedStatement without closing it. In fact if we see the oracle system table "$open_cursor" (as Konrad Pietzka suggest me) we can find that, for each interation,
    at our line code "rs = pstmt.executeQuery();" correspond a new cursor in the database: this means that for each method "pstmt.executeQuery()" the database open a new cursor and do not use the previous one as it should.
    I posted a question two months ago to search if someone had the same problem (it seems that Konrad Pietzka had the same situation) and was able to explain me what is the cause.
    The only reason I found by myself for this problem, is that probably the Oracle JDBC Thin Driver for Windows NT/2000 has some bugs... but I'm not sure ...
    Thank you very much for you time !!
    bye :-))
    Fidalma

  • Snapshot refresh error:  ora-01401 inserted value too large for column

    I have an error ora-01401 "Inserted value too large for column" when I try to do a refresh on a group at the materialized view site.
    My model is 1 master replicating to a readonly materialized view site. I have 2 refresh groups for separate sets of tables. 1 refresh group work fine...the other I got the above error.
    I have doubled the rbs and system tablespace without any help thinking that I must be running out of default rollback segment space.
    Anyone has this before?

    The error is related to a field, not to any tablespace. This normaly happens to me when I change the lenght or resolution of a field in the base tables. The structure changes don't "flow" to the materialized view! I must "regenerate" them. Normally droping and creating it again to make them receive the new lenght of that field.
    Sometimes, when the field changed is not part of any primary key I have changes directly the field in the materialized view as if it was a normal table.
    Hope this helps
    Luis

  • ORA-04031: unable to allocate 33568 bytes of shared memory  in Oracle 10g

    Hi,
    I am getting following message frequently while taking export in Oracle 10g database:-
    EXP-00008: ORACLE error 4031 encountered
    ORA-04031: unable to allocate 33568 bytes of shared memory ("shared pool","DBMS_REPCAT_UTL","PL/SQL MPCODE","BAMIMA: Bam Buffer")
    ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_REPCAT_UTL"
    ORA-06512: at "SYS.DBMS_REPCAT_EXP", line 87
    ORA-06512: at line 1
    EXP-00083: The previous problem occurred when calling SYS.DBMS_REPCAT_EXP.schema_info_exp
    EXP-00008: ORACLE error 4031 encountered
    ORA-04031: unable to allocate 16416 bytes of shared memory ("shared pool","SELECT SYNNAM, SYNNAM, SYNTA...","kgghtInit","kgghtInit")
    EXP-00000: Export terminated unsuccessfully
    Whats could be the reason?

    There could be a few reasons causing the problem. From literal message it would look like your shared pool size is small and you need to increase. But the root cause of the problem is a little more complicated than that. I suggest you read metalink doc
    Diagnosing and Resolving Error ORA-04031
    Doc ID: Note:146599.1

Maybe you are looking for

  • Artwork in iTunes and on iPod

    Can anybody help me? I am new to iPods but know a reasonable amount about computers. My question is, is there any criteria that artwork must satisfy so it can be used in iTunes and on the iPod? I have gathered images for all of the CDs I have ripped,

  • New iPad with the same account as older one

    I will buy a new iPad mini for my son. Currently, I have iPad2 with several payed apps and games among other. I would like to keep new iPad with the same account and to transfer only games to new iPad. In that case I would like to be responsible for

  • Installation error 1332

    I am trying to install eval version of "Sneak Preview SAP NetWeaver 2004 Slim Edition". I am getting the following error. can any one please give me some advice on how I can correct this to move on? ERROR 2006-06-04 13:50:36 FSL-00001  System call fa

  • List of standard reports in CO

    can some body tell me the way to find all standard sap reports for CO with description....

  • TypeKit does not work - infinite loading

    Hi folks, my Adobe TypeKit does not work: If i launch the cc application and click on "Fonts" (DE: Schriften) the loading bar appears. But the loading never ends. I tried to deactivate Firewall, Anti-virus-program, reinstall Creative Cloud Applicatio