Question

Increasing shared_pool_size and java_pool_size

Asked by: sikyala

I am trying to increase my shared_pool_size and java_pool_size. When I try to increase my shared_pool_size I get the following errors:

ORA-02097: parameter cannot be modified because specified value is invalid
ORA-04033: Insufficient memory to grow pool

I found a web page that said that I needed to increase sga_max_size in order to increase the shared_pool_size. However, I don't know how to do that. Could someone tell me how to do that or if that is even the right solution?

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-01-31 at 20:09:55ID22144823
Tags

shared_pool_size

Topic

Oracle Product Info

Participating Experts
3
Points
500
Comments
18

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. SGA Question
    We have a Windows NT system running Oracle Applications. The server has 1GB memory. Oracle Application: 11.5.1 Oracle Database: 8.1.6.1.0. In our initial file, we set db_block_size = 8192 Db_block_buffers = 5000 Log_buffer = 1048576 ...
  2. Dynamic SGA Management
    Is there ever any good reason to deliberately size the components of the SGA ( buffer cache, redo log buffer, shared pool, large pool, java pool) in such a way that they add up to less than the SGA_MAX_SIZE? I understand that if the components DO fill the SGA, then it will n...
  3. SGA allocation units
    What is the definition of a granule in SGA measurement?
  4. Allocated, used and free values for pools in SGA
    Hello, I need to find ALLOCATED, being Used and FREE memory in following memory pools: Shared Pool, buffer cache, Large pool, Java pool and PGA for 9i database. If results are presented in a report format, it will be much appreciated. Best Regards.
  5. SGA_TARGET
    Experts, In 10.2.0.3, or say even 10.2 , can i not set the SGA_TAGET to a value? If SGA_TARGET is not set to 0 , on a reboot the memmory managment goes to automatic? is that correct? Thanks
  6. The SGA was Inadequately sized
    How can I define my SGA size or what are the parameters I have to concentrate while defining my SGA size. Product : Oracle 10g Version 10.2.0.1.0 OS : Microsoft Windows Server 2003 SE, Service Pack 1 Message : 1 # The SGA was inadequately sized, causing additional I/O or har...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: sikyalaPosted on 2007-02-01 at 06:35:23ID: 18444324

I am having a problem with my sga. The total size is 135353968 and I need to increase it in order to increase my shared pool size. How do I fix the sga_max_size so that I can increase the shared_pool_size?

 

by: slightwvPosted on 2007-02-01 at 07:59:00ID: 18445080

Yes, sga_max_size controls the maximum amount of memory for the entire SGA and shared_pool carves out a piece.

>>However, I don't know how to do that

how did you try to change the shared_pool_size?  

It's exactly the same way for any Oracle parameter:  alter system set sga_max_size=<some number> scope=spfile;
Then restart the database.

Having said that:
Why are you explicitly adding shared_pool and java_pool sizes?  Oracle recommends using automatic memory management.  Just set sga_max_size and sga_target ( and possibly a couple more ) and Oracle will automatically manage the other pools for you.

You can read about sga_target at:
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams192.htm

 

by: dottenPosted on 2007-02-01 at 08:22:06ID: 18445286

This is assuming that sikyala is using 10g.  He/she didn't mention the version being used.  If it's 9i, then the only choice to change the max SGA setting is that alter system command from slightwv and a restart.  
However, if you know that perhaps your streams pool and buffer cache, and large pool aren't being used to their max, your quick emergency fix without shutting down the db would be to take some memory away from them and then re-allocate it to your shared pool and java pool.  

Lets say your Large pool is at 2 g, but your nightly batches are done and you aren't using all of it.......
ALTER SYSTEM SET LARGE_POOL_SIZE= 512m;  --you don't need a scope argument because 'BOTH' is the default.   If that's too much, Oracle will tell you that some of that is being used and tell you.  
Assuming that works, you now have 1.5gb that you can re-allocate to your java and shared pools dynamically without having to shut down the database.  

Then you can deal with proper allocations after users are off the systems with minimal interference.  

Of course, if you aren't that fortunate, then the restart has to happen.  

In 10g, when you set SGA_TARGET to a non-zero value, in R2 the SHARED_POOL, BUFFER_CACHE, JAVA_POOL, STREAMS_POOL, AND LARGE_POOL will be automatically managed.  There are three additional processes that are addded to the mix here, MMON (Managibility Monitor), MMAN (memory manager) , and MMNL (manageability monitor light).  Every second, MMNL sticks its toe in the sga and looks at wait events, writing them to a 2m buffer (for performance) to be flushed to disk eventually.  When it's noticed that an auto-managed component is running out of memory, MMAN doesn't just do the knee jerk reaction and quickly move memory.  It behaves like the optimizer, looking at historical statistics in the sga running what if scenarios looking at the short term AND long term effects of the change and only then does it re-allocate.  

By the way...if you are going to do the manual method, you need to make sure you reserve 20% of the physical memory for the operating system.  You play with that fire a bit too much and the operating system will degrade in performance....taking your database with it.  Remember, Oracle's processes don't actually write to the disk or even allocate space or memory without the o/s' cooperation....as the O/S goes, so will your DB.  

 

by: dottenPosted on 2007-02-01 at 08:23:43ID: 18445305

Oh, to add to the SGA_TARGET discussion.....not even automatic memory management will save you if the overall SGA is undersized.....you may STILL have to up the SGA_Target which will likely mean a change in the SGA_MAX_SIZE.  

 

by: sikyalaPosted on 2007-02-01 at 08:30:03ID: 18445354

I needed to increase the shared_pool_size because I upgraded from 9.2.0.1 to 9.2.0.6 and it is a post-installation requirement that the shared_pool_size be at least 150M. I was aware of the command alter system. I was having problems determining what to alter the size to because it is shown in bytes I thought there may be an easier way other than doing the math.

 

by: dottenPosted on 2007-02-01 at 08:35:10ID: 18445395

You can specify kb or mb, when you alter the size.  Need to do the math, really.  

 

by: dottenPosted on 2007-02-01 at 10:37:11ID: 18446478

correction....NO need to do the math, really.  Oracle will figure out how many bytes it would amount to, so it can confuse us later with sizes.....lol

 

by: slightwvPosted on 2007-02-01 at 11:06:46ID: 18446706

Just to add to dotten's post for clairification:

You can add K, M and more recently G to size parameters.

example:
alter system set sga_max_size=1G scope=spfile;
alter system set shared_pool_size=150M;

 

by: dottenPosted on 2007-02-01 at 11:18:41ID: 18446790

slightwv.....I don't think 9i likes G for size parameters.  I'll admit, that I've never bothered to try it, but I don't think 9i supports it.....alas, I don't have my 9i environment handy to test on....please correct my if I'm mistaken......I've just never bothered to use G in sizing datafiles in 9i.....

10g does support gb file sizing because of the bigfile tablespace feature.....a monster....it can only consist of one datafile, but can be anywhere from 8 to 128Tb in size.....depending on the DB_BLOCK_SIZE.....YIKES!!!!  Don't think I'll be running that off a floppy anytime soon!

I'm thinking from your post snippet 'and more recently G to size parameters'  this is what you mean....

 

by: schwertnerPosted on 2007-02-02 at 03:00:26ID: 18451375

To overcome this problem create a PFILE from the SPFILE:

SQL>create pfile='/u03/init.ora' from spfile;

Open and edit this file:

increase max_sga_size, java_pool_size, shared_pool_size

Open the DB for migration so:

SQL>shutdown immediate
...
SQL>startup migrate pfile=/u03/init.ora

Beginning from 10.2.3 this scenario doesn't help.
Oracle do not allow to open normally the DB before you run the upgrcat.sql.
So you have to open it for migrate and create the PFILE.
After that shutdown, edit and open again ...

 

by: dottenPosted on 2007-02-02 at 10:25:40ID: 18454783

Schwertner,
Are you sure you didn't intend the above post for another question?  The poster was not asking a migration question, only how for advice on changing initialization parameters specific to MAX_SGA_SIZE and JAVA_POOL SIZE.  Additionally, they are running on 9i.  I'm not aware of a starup migrate option in 9i, though I could be mistaken, I've just never used it.  10g, requires the STARTUP UPGRADE to be used when performing an upgrade.  Regardless, unless I missed somethiing, this poster isn't looking to migrate or upgrade.  

 

by: schwertnerPosted on 2007-02-03 at 06:21:47ID: 18459226

Dotten,

The asker asks for the typycal scenario in the second part
of the upgrade process - the catalog upgrade.
And fail in the typical trap - MAX_SGA_SIZE low value.

There is no reasons to change SPFILE parameters. Because if there were reasons to do this it had be done, but if not - there is no reason.

Changing SPFILE parameters is risky - there are syntactical traps that will lead to an invalid SPFILE.

So I always do these upgrades via PFILE miror copies of the SPFILE wit minor changes of 3 parameters.

The asker said: I needed to increase the shared_pool_size because I upgraded from 9.2.0.1 to 9.2.0.6 and it is a post-installation requirement that the shared_pool_size be at least 150M.

Also he uses the right syntax 150M.

Finaly I will said that beginning from 10.2.0.3 the upgrade scenario is more complex - you can not open the DB in normal mode without upgrading the catalog. I fail in this trap - have 5 10.2.0.3 instances running ......

So I have the feeling that my posting is adequate, but please get my appologize if this is not so ...

You know, nobody is perfect, especially old professors like me that began their programmer career with punched tapes and now are trying to be Oracle profis!

 

by: dottenPosted on 2007-02-05 at 12:52:17ID: 18471153

Schwertner, does that mean you're talking about editing the spfile manually in an editor?  I'll bet that's risky since it's classified ad a binary file!  A dba is only supposed to alter it through the ALTER SYSTEM command.  IMHO it would be easier to use 'ALTER SYSTEM than your method, no offense.  

ALTER SYSTEM SET SGA_MAX_SIZE=1024M SCOPE=SPFILE;
ALTER SYSTEM SET SHARED_POOL_SIZE=150M;

-----There's no need to specify the scope in setting the SHARED_POOL_SIZE parameter because the default SCOPE=BOTH and the parameter is one of those that can be dynamically changed.  If you do get the 'insufficient memory' error as mentioned, then add SCOPE=SPFILE to it and restart.  

Your mention of 10.2.0.3 is what threw me off, but from your explanation just given, your posting is just fine.  

 

by: schwertnerPosted on 2007-02-06 at 00:31:13ID: 18474253

Dotten, do not worry, I have very good feelings to you!:
Please pay attention to this my sentence:
-------> So I always do these upgrades via PFILE miror copies of the SPFILE wit minor changes of 3 parameters.

May be I had to write instead PFILE the words "Parameter File" and instead SPFILE "Server Parameter File".

You are absolutely right that it is suicide to edit the SPFILE directly.
Even more - also indirectly via GUI and commands.


Why I do not use ALTER SYSTEM?

I tried this. And I run in troubles. The problem is very curious.
It seems that ALTER SYSTEM and also the OEM GUI
do not checks the entered values. It simply put them AS IS in the SPFILE.
After that trying to open the DB you got:
.... INVALID PARAMETER IN SPFILE.
It is hard task to escape.
You can not open the DB to alter the parameter.
May be this is possible in MOUNT mode, but doubt ...
So the only thing we can do is to find a PFILE and startup the DB
SQL>open pfile=/u03/init_main.ora

Another thought.
Why have you to alter the SPFILE?
If the both parameters are smaller then 150M this means
(if the DBA is a serious guy!!!!) that his will was to use
small values for them. So after the migration he has to put them back
taking the risk I explain.


If you are curious about
SQL>startup migrate pfile=/u03/init_main.ora

It is really so. On Sunday I installed on a University laptop Oracle 9i.

Excerpt (README.HTML of the upgrade kit):


Oracle9i Database Server
Patch Set Notes
Release 2 Patch Set 4 Version 9.2.0.5.0 for Linux x86
March 2004


Post-Installation Tasks

Start the database listener using a command such as lsnrctl start.

Log in as sysdba using SQL*Plus.

Run the following commands and scripts in order from ORACLE_HOME in migrate mode on all updated databases.

Run the startup migrate command.
Run the spool patch.log command.

Run the @?/rdbms/admin/catpatch.sql script.

Run the spool off command.

Review the patch.log file for errors, and rerun the catpatch.sql script after correcting any problems.

Run the shutdown command.

Run the startup command.

Run the @?/rdbms/admin/utlrp.sql script. This step is optional, and will recompile all invalid PL/SQL packages now instead of when the packages are accessed the first time. The utlrcmp.sql script can be used to parallelize this in multiprocessor machines.




 

 

by: sikyalaPosted on 2007-02-06 at 07:29:23ID: 18476801

I did the following:

ALTER SYSTEM SET SGA_MAX_SIZE=350M SCOPE=SPFILE;
ALTER SYSTEM SET SHARED_POOL_SIZE='150M' scope=spfile;

 

by: sikyalaPosted on 2007-02-06 at 07:46:09ID: 18476962

Dotten you made a comment:

I'm not aware of a starup migrate option in 9i, though I could be mistaken, I've just never used it.  10g, requires the STARTUP UPGRADE to be used when performing an upgrade.  Regardless, unless I missed somethiing, this poster isn't looking to migrate or upgrade.  


I actually needed to change the the shared_pool_size and java_pool_size because I was upgraded from 9.2.0.1 to 9.2.0.6. Instructions fro installing that patchset requires the following:

1. check system tablespace size and increase if necessary
2. check shared_pool_size and increase if necessary
3. check the java_pool_size and increase if necessary
4. shutdown database
5. startup database with command: startup migrate
6. run catpatch.sql script and check for errors
7. shutdown and startup the database
7. run utlrp.sql script

 

by: dottenPosted on 2007-02-06 at 10:07:38ID: 18478232

Sikyala,
You're right, I was wrong as I mentioned I might be.  I was speaking in the wrong context.  Schwertner had mentioned 10g, and for some reason I thought he meant you were upgrading to that and had totally missed (acutually, forgotten) your mention of the upgrade.  I've been having some brain cramps lately.....

Great instructions, huh?  Isn't it soooo helpful they tell you to change a pool size 'if necessary' but not give you just a hint on how to determine that?  UGH!  It's the kind of stuff that keeps us employed, since we have to figure it out as we go, but frustrating nonetheless.    

Schwertner:
I'm ecstatic to hear I'm on your  good side!  I'll sleep well now!!!!

Additionally, sir, I suddenly remembered something.....or I accessed a block of my brain that had been corrupted, or something:
I DO REMEMBER using starup migrate.....actually did it a bunch of times.  I nearly slapped myself.  

Just as a reference to all...they simply changed that startup mode to 'upgrade' now in 10g.  Oracle has not redefined the terminology.  Upgrade is now upgrading an Oracle installation.  Migrate is now defined as migrating from a non-Oracle product.  

 

by: schwertnerPosted on 2007-02-07 at 00:10:13ID: 18483263

Everything is OK!

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...