Solved

Oracle 7.2 error in Sol 2.5

Posted on 1997-06-07
3
187 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Include multiple hostnames in this command? 3 52
sumDigits challenge 9 98
zeroMAx challenge 20 76
unix example issues 18 49
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This video discusses moving either the default database or any database to a new volume.

757 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

23 Experts available now in Live!

Get 1:1 Help Now