Solved

Oracle 7.2 error in Sol 2.5

Posted on 1997-06-07
3
188 Views
Last Modified: 2013-12-26
I get the following error from Oracle when using OCI
ORA-04031: unable to allocate 740 bytes of shared memory ("unknown object","sga heap","library cache")
Any hints as to solve this
0
Comment
Question by:waslap
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
dhm earned 100 total points
ID: 1293257
I use Oracle/OCI on Solaris-2.5.1 quite a bit, but I've never seen that error.  Is your database up & running correctly?  You are supposed to modify the kernel when you install Oracle, and one of the things you're supposed to do is increase the amount of shared memory that is available to user programs.  If you didn't modify the kernel (and reboot), perhaps your system has just enough shared memory to run Oracle, but not enough for client programs.

The kernel mod in question happens in the file /etc/system; you need to add lines like these (which are copied directly from my /etc/system on an Ultra-2 running 2.5.1):

#
# Set shared mem and semaphore limits for Oracle
#
set shmsys:shminfo_shmmax=8388608
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10
set semsys:seminfo_semmns=400
set semsys:seminfo_semmni=70

Then, of course, you have to do a "reboot -- -rv" to reboot and reconfigure the kernel.
0
 

Author Comment

by:waslap
ID: 1293258
I did this and the system ran well for a couple of months but now starts giving this error. Its always exactly 740 bytes and the "unknown object" part intrigues me. Could it be that there is just too many processes running and memory is running too low ( I noticed each oracle connection using 25Mb in /proc, is this normal ? ). Next thing I'm going to try is make the SGA larger in INI.ORA. Maybe the DB is too busy, but even if so, Oracle should throw away other cached objects, not so ?
0
 
LVL 3

Expert Comment

by:dhm
ID: 1293259
Do you only get the error with this particular program?  Does it always happen, or only when you run (e.g.) 10 copies of the program?  Can you run sqlplus or some other OCI program right after you get the error?

I just ran oerr to find out more about the error; here's what I got:

dhm@eagleone[3]$ oerr ora 04031
04031, 00000, "unable to allocate %s bytes of shared memory (\"%s\",\"%s\",\"%s\")"
// *Cause:  More shared memory is needed than was allocated in the shared
//          pool.
// *Action: 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 parameter "shared_pool_size".

So your idea of increasing the SGA in init.ora is close.  I don't know what the "dbms_shared_pool" package is, or how to use it to "pin large packages."  I'd try increasing "shared_pool_size", though.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Separate into files by filename 12 76
countEvens challenge 2 79
child constructor and parent constructor, overriding and overloading 6 79
scoreUp challenge 14 57
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now