Sunteți pe pagina 1din 7

RAM-SGA

The total RAM demands for Oracle on MS-Windows are as follows:


OS RAM 20 percent of total RAM for MS-Windows, 10% of RAM for UNIX Oracle SGA RAM determined with the show sga command Oracle database connections RAM Each Oracle connection (when not using the Oracle multi-threaded server) will use two megabytes of RAM plus sort_area_size plus hash_area_size. NB: Once we know the total available RAM memory, we have to subtract 20 percent from this value for MS-Windows overhead. Even in an idle state, Windows services use RAM resources, and we must subtract 20% to get the real free RAM on an idle server.

High Water Mark


Once we know the amount of available RAM for Oracle, we must know the high-water mark (HWM) for the number of Oracle connections. For systems that are not using Oracle's multithreaded server architecture, each connected session to the Windows server is going require an area of memory for the program global area, or PGA. There is no easy way to determine the high-water mark of connected Oracle sessions. If you use Oracle STATSPACK you can get this information from the stats$sysstat table

Determining the PGA Size


The size for each PGA RAM region is computed as follows:
OS Overhead - We reserve 2 meg for Windows and 1 meg for UNIX Sort_area_size parameter value - This RAM is used for data row sorting inside the PGA Hash_area_size parameter value - This RAM defaults to 1.5 time sort_area_size, and is used for performing hash joins of Oracle tables.

SQL> show parameters area_size NAME TYPE VALUE ------------------------------------ ----------- --------bitmap_merge_area_size integer 1048576 create_bitmap_area_size integer 8388608 hash_area_size integer 1048576 sort_area_size integer 524288 workarea_size_policy string MANUAL

set pages 999; column pga_size format 999,999,999 select 1048576+a.value+b.value pga_size from v$parameter a, v$parameter b where a.name = 'sort_area_size' and b.name = 'hash_area_size' ;

Now, if we were to multiply the number of connected users by the total PGA demands for each connected user, we will know exactly how much RAM memory in order to reserve for connected sessions.

let's assume that we have a high-water mark of 100 connects sessions to our Oracle database server. We multiply 100 by the total area for each PGA memory region, and we can now determine the maximum size of our SGA: Total RAM on Windows Server 1250 MB Less: Total PGA regions for 10 users: 362 MB RAM reserved for Windows (20 percent) 500 MB ---------862 MB Hence, we would want to adjust the RAM to the data buffers in order to make the SGA size less than 388 MB. Any SGA size greater than 388 MB, and the server will start RAM paging, adversely affecting the performance of the entire server. The final task is to size the Oracle SGA such that the total memory involved does not exceed 388 MB As a review, the size of an Oracle SGA is based upon the following parameter settings:
shared_pool_size This sizes the administrative RAM for Oracle and the library cache. db_cache_size This parameter determines the size of the RAM for the data buffers large_pool_size The size of the Java pool log_buffer The size of the RAM buffer for redo logs

In general, the most variable of these parameters is db_cache_size. Because Oracle has an almost insatiable appetite for RAM data buffers, most DBAs add additional RAM to the db_cache_size.

A Script for Computing Total PGA RAM


set heading off set echo on accept myparm number prompt 'Choose a number between 1 and 10: ' select 'You chose the number '||&myparm from dual; set pages 999; column pga_size format 999,999,999 accept hwm number prompt 'Enter the high-water mark of connected users: ' select &hwm*(2048576+a.value+b.value) pga_size from v$parameter a, v$parameter b where a.name = 'sort_area_size' and b.name = 'hash_area_size' ;

Monitoring Server Resources in MS-Windows


start > settings > control panel > administrative tools > performance. The MS-Windows performance monitor plots three metrics:
Green (CPU) - This is the percentage of CPU resources consumed Yellow (RAM) - This is the number of RAM pages per seconds used Blue (DISK) - This is the disk I/O queue length percentage

Let's take a closer look at the MS-Windows performance monitor. figure 2 is a time-based snapshot of an Oracle databases resource consumption at startup time. These lines form signatures (known usage patterns) that reveals some interesting patterns inside Oracle:
RAM Usage The yellow line is RAM usage, and we see the first spike in the RAM when the SGA is allocated and a short spike in RAM as the database is mounted. DISK Usage The blue line is the disk I/O, and we see the disk I/O activity peg at the point where we mount the database. This is because Oracle must touch every data file header to read the system change number (SCN). CPU Usage The green line is CPU and it is interesting to note that the CPU never goes above 50 percent during Oracle database startup.

S-ar putea să vă placă și