Questions - Shared Pool Size and PL/SQL Packages

From: Dan Gaffaney <dpg_at_halide.Kodak.COM>
Date: Thu, 23 Jun 1994 17:08:56 GMT
Message-ID: <Crv0yw.50F_at_newsserver.pixel.kodak.com>


Is anyone out there making extensive use of PL/SQL Packages (a PL/SQL V2 and Oracle 7 concept) containing PL/SQL stored procedures?

I am working on an application which has a decent number of packages, some of which might have quite a bit of PL/SQL code in stored procedures and 'complex' cursors (such as a number of tables joined together). The stored procedures within the packages are being called from Pro*C code.

We periodically get messages similar to the following when calling a stored procedure from our C code:

	ORA-04031: out of shared memory when trying to 
	allocate 50212 bytes (PL/SQL MPCODE,BAMIMA: 
	Grow Bam Buffer)
	ORA-06508: PL/SQL: could not find program unit 
	being called
	ORA-06512: at line 1

'Bouncing' the database instance (dbshut/dbstart) clears up the problem
temporarily, as does issuing an 'ALTER SYSTEM FLUSH SHARED_POOL;' SQL command. Either one of these actions tends to be disruptive to users who are trying to use the application.

In attempting to workaround this problem, I have kept increasing the value of the SHARED_POOL_SIZE parameter in init.ora -- it's now up to 16777216 (16 MB), which is quite a bit larger than the 'LARGE' recommendation from Oracle in this file.

I thought that Oracle was supposed to 'fault' things in and out of the Shared Pool as necessary. In looking at the output of the sys.dbms_shared_pool.sizes() procedure provided by Oracle, cursors (which should be able to be deleted when not being used) can end up being quite a bit larger than any of my package bodies.

Does this version of Oracle have a problem with management of memory in the shared pool? Is it simply a fragmentation issue? I've tried to
'pin' items in shared pool by using the sys.dbms_shared_pool.keep()
procedure, but it can't seem to validate the package names I give it, no matter if I am connected as system or as the owner of the packages, and no matter if I append the schema name on the front of the package name or not. Calling the keep() procedure consistently gives me these errors:

	ORA-06564: object <object-name> does not exist
	ORA-06512: at "SYS.DBMS_UTILITY", line 18
	ORA-06512: at "SYS.DBMS_SHARED_POOL", line 17
	ORA-06512: at "SYS.DBMS_SHARED_POOL", line 24
	ORA-06512: at line 1

Environment:
	Oracle V7.0.15.4.0
	PL/SQL 2.0.17.1.0
	
	Sun 4/470, SunOS 4.1.3, 64 MB memory, running two Oracle
	instances with similar init.ora parameters.

Does anybody have any feedback on these items?

Thanks for any input/guidance you can give me.

---
Dan Gaffaney			Internet: dpg_at_halide.Kodak.COM
Senior Software *ngineer 	(I'm NOT infringing on state licensing laws)
Eastman Kodak Company		Rochester, NY 14652-3712	(716) 722-3968
Received on Thu Jun 23 1994 - 19:08:56 CEST

Original text of this message