The parameter SGA_TARGET specifies the total size of all SGA components. If SGA_TARGET is set to a value greater than zero then
DB_CACHE_SIZE,
SHARED_POOL_SIZE,
LARGE_POOL_SIZE and
JAVA_POOL_SIZE are automatically sized.
are automatic sized components.
On the other hand,
LOG_BUFFER,
BUFFER_POOL_KEEP,
BUFFER_POOL_RECYCLE,
DB_nK_CACHE_SIZE other than DB_CACHE_SIZE,
STREAMS_POOL_SIZE ,
Fixed SGA and
other internal components are manually sized components.
However setting the value to manually sized components automatically reduce the value from SGA_TARGET if SGA_TARGET is set to value greater than zero.
When SGA_TARGET>0 then automatic sized components of SGA are automatically allocated and this is called Automatic Shared Memory Management.
Both the automatic and manually sized components of SGA are dynamic components because they dynamically can be changed. You can see them from V$SGA_DYNAMIC_COMPONENTS.
Related Documents
How to determine free memory and used memory in Oracle
Showing posts with label SGA. Show all posts
Showing posts with label SGA. Show all posts
Thursday, August 14, 2008
Tuesday, July 29, 2008
How to determine free memory and used memory in Oracle
The summary information of the SGA is determined by,
SQL> select * from V$SGA;
NAME VALUE
------------------------------------------------------------ ----------
Fixed Size 2073376
Variable Size 1056967904
Database Buffers 1509949440
Redo Buffers 14700544
To know the current settings of the sga dynamic components ( can be set in memory by ALTER SYSTEM)
SQL> col COMPONENT format a30
SQL> select COMPONENT, CURRENT_SIZE from V$SGA_DYNAMIC_COMPONENTS;
COMPONENT CURRENT_SIZE
------------------------------ ------------
shared pool 989855744
large pool 16777216
java pool 16777216
streams pool 33554432
DEFAULT buffer cache 603979776
KEEP buffer cache 0
RECYCLE buffer cache 0
DEFAULT 2K buffer cache 33554432
DEFAULT 4K buffer cache 637534208
DEFAULT 8K buffer cache 0
DEFAULT 16K buffer cache 67108864
COMPONENT CURRENT_SIZE
------------------------------ ------------
DEFAULT 32K buffer cache 167772160
ASM Buffer Cache 0
13 rows selected.
To know the details of free and used memory use,
col total_sga format a20
col used format a20
col free format a20
SQL> select round(sum(bytes)/1024/1024,2)||' MB' total_sga, round(round(sum(bytes)/1024/1024,2) - round(sum(decode(name,'free memory',bytes,0))/1024/1024,2))||' MB' used, round(sum(decode(name,'free memory',bytes,0))/1024/1024,2)||' MB' free from v$sgastat;
TOTAL_SGA USED FREE
-------------------- -------------------- --------------------
2608.11 MB 2382 MB 226.12 MB
Related Documents
Memory Usage of Solaris Operating System
SQL> select * from V$SGA;
NAME VALUE
------------------------------------------------------------ ----------
Fixed Size 2073376
Variable Size 1056967904
Database Buffers 1509949440
Redo Buffers 14700544
To know the current settings of the sga dynamic components ( can be set in memory by ALTER SYSTEM)
SQL> col COMPONENT format a30
SQL> select COMPONENT, CURRENT_SIZE from V$SGA_DYNAMIC_COMPONENTS;
COMPONENT CURRENT_SIZE
------------------------------ ------------
shared pool 989855744
large pool 16777216
java pool 16777216
streams pool 33554432
DEFAULT buffer cache 603979776
KEEP buffer cache 0
RECYCLE buffer cache 0
DEFAULT 2K buffer cache 33554432
DEFAULT 4K buffer cache 637534208
DEFAULT 8K buffer cache 0
DEFAULT 16K buffer cache 67108864
COMPONENT CURRENT_SIZE
------------------------------ ------------
DEFAULT 32K buffer cache 167772160
ASM Buffer Cache 0
13 rows selected.
To know the details of free and used memory use,
col total_sga format a20
col used format a20
col free format a20
SQL> select round(sum(bytes)/1024/1024,2)||' MB' total_sga, round(round(sum(bytes)/1024/1024,2) - round(sum(decode(name,'free memory',bytes,0))/1024/1024,2))||' MB' used, round(sum(decode(name,'free memory',bytes,0))/1024/1024,2)||' MB' free from v$sgastat;
TOTAL_SGA USED FREE
-------------------- -------------------- --------------------
2608.11 MB 2382 MB 226.12 MB
Related Documents
Memory Usage of Solaris Operating System
Saturday, July 12, 2008
ORA-02097, ORA-00384 while setting memory components
Error Description:
-----------------------------
While settings dynamic memory components ORA-00384: is raised.
SQL> alter system set db_4k_cache_size=800M;
alter system set db_4k_cache_size=800M
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-00384: Insufficient memory to grow cache
Cause of The Problem:
--------------------------------------------
This problem can be raised for several reasons.
1)SGA_MAX_SIZE is not set
--------------------------------------------------
The initialization parameter SGA_MAX_SIZE is not set explicitly either in spfile or in pfile and hence its default value at the time of startup is set to sum of the total memory parameters plus some overhead.
You can check your current sga memory by issuing any one of the following in SQL*plus,
show sga;
show parameter sga_max_size;
So, whenever you use ALTER SYSTEM SET to set the value of dynamic memory components like DB_CACHE_SIZE , DB_nK_CACHE_SIZE this will fail as it cannot grow beyond SGA_MAX_SIZE . Thus, the errors which your are seeing is expected.
2)SGA_MAX_SIZE is set but not enough to allow memory to allocate
--------------------------------------------------------------------------------
There may be explicitly set SGA_MAX_SIZE but it is not enough to allow the memory settings as it set by ALTER SYSTEM SET statement. Suppose total sga memory after setting sga dynamic components exceeds SGA_MAX_SIZE.
3)Oracle Bug
---------------------------
There is oracle Bug 4587117 and Bug 4919526 which is responsible to cause the above error.
Solution of the Problem:
----------------------------------
The solution is based on the cause of the error.
For Case 1)
Increase the SGA_MAX_SIZE parameter of the database and bounce the database. As SGA_MAX_SIZE is invoked only at startup so in order to affect the changes database need to be restarted. You can set it in spfile from sql*plus by,
ALTER SYSTEM SET SGA_MAX_SIZE=4G scope=spfile;
SHUTDOWN;
STARTUP;
For Case 2)
If you have limited memory in your system then set the lower value of the dynamic components. Suppose you tried to set 800M which raised error. You may set it lower value which will not raise error. Like,
alter system set db_4k_cache_size=300M;
For Case 3)
Install Server Patch Set from metalink.
Related Documents
http://arjudba.blogspot.com/2008/05/startup-fails-with-ora-27102-out-of.html
http://arjudba.blogspot.com/2008/12/expdp-fails-with-ora-39125-ora-04031.html
http://arjudba.blogspot.com/2009/05/ora-27100-shared-memory-realm-already.html
http://arjudba.blogspot.com/2008/05/startup-fails-with-oracle-error-ora.html
http://arjudba.blogspot.com/2008/09/database-startup-fails-with-ora-27302.html
http://arjudba.blogspot.com/2008/07/database-startup-fails-with-error-ora.html
http://arjudba.blogspot.com/2008/08/startup-fails-with-ora-01261-parameter.html
-----------------------------
While settings dynamic memory components ORA-00384: is raised.
SQL> alter system set db_4k_cache_size=800M;
alter system set db_4k_cache_size=800M
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-00384: Insufficient memory to grow cache
Cause of The Problem:
--------------------------------------------
This problem can be raised for several reasons.
1)SGA_MAX_SIZE is not set
--------------------------------------------------
The initialization parameter SGA_MAX_SIZE is not set explicitly either in spfile or in pfile and hence its default value at the time of startup is set to sum of the total memory parameters plus some overhead.
You can check your current sga memory by issuing any one of the following in SQL*plus,
show sga;
show parameter sga_max_size;
So, whenever you use ALTER SYSTEM SET to set the value of dynamic memory components like DB_CACHE_SIZE , DB_nK_CACHE_SIZE this will fail as it cannot grow beyond SGA_MAX_SIZE . Thus, the errors which your are seeing is expected.
2)SGA_MAX_SIZE is set but not enough to allow memory to allocate
--------------------------------------------------------------------------------
There may be explicitly set SGA_MAX_SIZE but it is not enough to allow the memory settings as it set by ALTER SYSTEM SET statement. Suppose total sga memory after setting sga dynamic components exceeds SGA_MAX_SIZE.
3)Oracle Bug
---------------------------
There is oracle Bug 4587117 and Bug 4919526 which is responsible to cause the above error.
Solution of the Problem:
----------------------------------
The solution is based on the cause of the error.
For Case 1)
Increase the SGA_MAX_SIZE parameter of the database and bounce the database. As SGA_MAX_SIZE is invoked only at startup so in order to affect the changes database need to be restarted. You can set it in spfile from sql*plus by,
ALTER SYSTEM SET SGA_MAX_SIZE=4G scope=spfile;
SHUTDOWN;
STARTUP;
For Case 2)
If you have limited memory in your system then set the lower value of the dynamic components. Suppose you tried to set 800M which raised error. You may set it lower value which will not raise error. Like,
alter system set db_4k_cache_size=300M;
For Case 3)
Install Server Patch Set from metalink.
Related Documents
http://arjudba.blogspot.com/2008/05/startup-fails-with-ora-27102-out-of.html
http://arjudba.blogspot.com/2008/12/expdp-fails-with-ora-39125-ora-04031.html
http://arjudba.blogspot.com/2009/05/ora-27100-shared-memory-realm-already.html
http://arjudba.blogspot.com/2008/05/startup-fails-with-oracle-error-ora.html
http://arjudba.blogspot.com/2008/09/database-startup-fails-with-ora-27302.html
http://arjudba.blogspot.com/2008/07/database-startup-fails-with-error-ora.html
http://arjudba.blogspot.com/2008/08/startup-fails-with-ora-01261-parameter.html
Wednesday, May 14, 2008
Startup fails with ORA-27102: out of memory Solaris-AMD64 Error
Scenario of The problem:
------------------------------
In my computer I have two database. One database is running smoothly but another database is not started whenever I invoke startup. It fails with error,
SQL> startup
ORA-27102: out of memory
Solaris-AMD64 Error: 22: Invalid argument
Reason of The problem:
------------------------
The database which could not start is because of the low memory on the system or in the sga_max_size there is high value set. So the system could not allocate so large memory as it does not have free so much. There may be other reasons like OS limitation in order of usage the memory. As in this case one database is ok (Both database are running on same user)and another database is failed so I suspect either low memory on the system or in the sga_max_size parameter inside spfile there is high value set.
Solution of The problem:
------------------------------
1)Set a lower amount of memory in the first database.
You can do it by, On dbase1,
SQL> alter system set sga_max_size=1600M scope=spfile;
System altered.
SQL> alter system set sga_target=1600M;
System altered.
SQL>shutdown
Now set ORACLE_SID and start the instance.
bash-3.00$ export ORACLE_SID=dupbase
bash-3.00$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu May 15 01:34:15 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 2019320 bytes
Variable Size 113246216 bytes
Database Buffers 50331648 bytes
Redo Buffers 6369280 bytes
Database mounted.
Database opened.
Or,
2)Lower the setting of SGA_MAX_SIZE, SGA_TARGET on the 2nd database. To do this create pfile from spfile.
SQL>create pfile from spfile;
And then edit the pfile parameter of SGA_MAX_SIZE and SGA_TARGET.
And start the database with the pfile.
SQL>STARTUP PFILE='pfile_name';
Later , Create spfile from pfile,
SQL>CREATE SPFILE from PFILE;
Related Documents
http://arjudba.blogspot.com/2008/12/expdp-fails-with-ora-39125-ora-04031.html
http://arjudba.blogspot.com/2009/05/ora-27100-shared-memory-realm-already.html
http://arjudba.blogspot.com/2008/05/startup-fails-with-oracle-error-ora.html
http://arjudba.blogspot.com/2008/09/database-startup-fails-with-ora-27302.html
http://arjudba.blogspot.com/2008/07/database-startup-fails-with-error-ora.html
http://arjudba.blogspot.com/2008/08/startup-fails-with-ora-01261-parameter.html
------------------------------
In my computer I have two database. One database is running smoothly but another database is not started whenever I invoke startup. It fails with error,
SQL> startup
ORA-27102: out of memory
Solaris-AMD64 Error: 22: Invalid argument
Reason of The problem:
------------------------
The database which could not start is because of the low memory on the system or in the sga_max_size there is high value set. So the system could not allocate so large memory as it does not have free so much. There may be other reasons like OS limitation in order of usage the memory. As in this case one database is ok (Both database are running on same user)and another database is failed so I suspect either low memory on the system or in the sga_max_size parameter inside spfile there is high value set.
Solution of The problem:
------------------------------
1)Set a lower amount of memory in the first database.
You can do it by, On dbase1,
SQL> alter system set sga_max_size=1600M scope=spfile;
System altered.
SQL> alter system set sga_target=1600M;
System altered.
SQL>shutdown
Now set ORACLE_SID and start the instance.
bash-3.00$ export ORACLE_SID=dupbase
bash-3.00$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu May 15 01:34:15 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 2019320 bytes
Variable Size 113246216 bytes
Database Buffers 50331648 bytes
Redo Buffers 6369280 bytes
Database mounted.
Database opened.
Or,
2)Lower the setting of SGA_MAX_SIZE, SGA_TARGET on the 2nd database. To do this create pfile from spfile.
SQL>create pfile from spfile;
And then edit the pfile parameter of SGA_MAX_SIZE and SGA_TARGET.
And start the database with the pfile.
SQL>STARTUP PFILE='pfile_name';
Later , Create spfile from pfile,
SQL>CREATE SPFILE from PFILE;
Related Documents
http://arjudba.blogspot.com/2008/12/expdp-fails-with-ora-39125-ora-04031.html
http://arjudba.blogspot.com/2009/05/ora-27100-shared-memory-realm-already.html
http://arjudba.blogspot.com/2008/05/startup-fails-with-oracle-error-ora.html
http://arjudba.blogspot.com/2008/09/database-startup-fails-with-ora-27302.html
http://arjudba.blogspot.com/2008/07/database-startup-fails-with-error-ora.html
http://arjudba.blogspot.com/2008/08/startup-fails-with-ora-01261-parameter.html
Wednesday, April 2, 2008
SGA Components in Oracle 10g
A system global area (SGA) is a group of shared memory structures that contain data and control information for one Oracle database instance. If multiple users are concurrently connected to the same instance, then the data in the instance's SGA is shared among the users. Consequently, the SGA is sometimes called the shared global area.
The SGA is made up of three required components and three optional components.
Required SGA Components:
---------------------
1)Shared Pool:Caches the most recently used SQL statements that have been issued by database users.
2)Database Buffer Cache: Caches the data that has been most recently accessed by database users.
3)Redo Log Buffer: Stores transaction information for recovery purposes
Optional SGA Components:
---------------------
1)Java Pool:Caches the most recently used Java objects and application code when
Oracle’s JVM option is used.
2)Large Pool:Caches data for large operations such as Recovery Manager (RMAN)
backup and restore activities and Shared Server components
3)Streams Pool:Caches the data associated with queued message requests when
Oracle’s Advanced Queuing option is used.
The SGA is made up of three required components and three optional components.
Required SGA Components:
---------------------
1)Shared Pool:Caches the most recently used SQL statements that have been issued by database users.
2)Database Buffer Cache: Caches the data that has been most recently accessed by database users.
3)Redo Log Buffer: Stores transaction information for recovery purposes
Optional SGA Components:
---------------------
1)Java Pool:Caches the most recently used Java objects and application code when
Oracle’s JVM option is used.
2)Large Pool:Caches data for large operations such as Recovery Manager (RMAN)
backup and restore activities and Shared Server components
3)Streams Pool:Caches the data associated with queued message requests when
Oracle’s Advanced Queuing option is used.
Subscribe to:
Posts (Atom)