?
Solved

Oracle 7.2 error in Sol 2.5

Posted on 1997-06-07
3
Medium Priority
?
195 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
dhm earned 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

770 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