OS Memory Usage   «Prev  Next»
Lesson 1

Tuning for OS memory usage

Tuning Oracle memory

Another very important component of the external environment when tuning Oracle system is the memory consumption within your Oracle database server. Many DBAs falsely assume that the only memory they need to worry about is the memory that is allocated to their SGA when they create the Oracle instance. However, an experienced DBA understands that there are additional memory demands upon the database server, even one that is totally dedicated to the Oracle database. We have to deal with the demands of PGA memory for all of the connected users as well as dealing with memory demands for other components of the Oracle database, including the database listener, multithreaded server, and all of the other components that are running within your database server environment. In this module were going to be looking at the generic tool called vmstat that will actually measured the amount of paging and swapping all OS memory within your Oracle instance.

Managing RAM Memory

In this module, you will delve into managing the RAM memory in the OS environment.
Memory has a huge impact on performance. Because of this, Oracle allocates a region of RAM memory, called the SGA, at database startup time. Each connected user process causes the database server to experience Oracle-related memory demands. Therefore, you must understand a range of memory management techniques. By the end of this module, you should be able to:
  1. Explain virtual memory
  2. Explain UNIX memory management
  3. Check the vmstat run queue
  4. Place statistics into Oracle tables
  5. Reduce memory usage

The next lesson is an overview of OS memory usage.

How does vmstat measure the amount of paging and swapping of OS memory within an Oracle instance?

vmstat is a Unix/Linux utility that provides information about the system's virtual memory and CPU usage. It can be used to measure the amount of paging and swapping of operating system (OS) memory within an Oracle instance.
To measure paging and swapping, you can use the following fields in the vmstat output:
  1. pi (page in): This field shows the number of pages swapped in from disk per second. A high value for pi indicates that the system is swapping a lot of memory to disk, which can lead to performance degradation.
  2. po (page out): This field shows the number of pages swapped out to disk per second. A high value for po indicates that the system is paging out frequently, which can also lead to performance degradation.
  3. swpd (swapped memory): This field shows the amount of virtual memory used in kilobytes. A high value for swpd indicates that the system is using a lot of virtual memory and may be swapping a significant amount of memory to disk.
  4. free: This field shows the amount of free memory available in kilobytes. A low value for free indicates that the system is running low on memory and may be paging or swapping frequently.
By analyzing the values of these fields over time, you can get a sense of how much paging and swapping is occurring in your Oracle instance. If you see high values for pi, po, or swpd, it may be necessary to add more physical memory to your system to reduce the amount of paging and swapping that is occurring.

What type of memory consumption must be observed when running a database using Oracle 18c?

When running an Oracle 18c database, it's important to monitor memory consumption to ensure that the database is operating efficiently and that there are no memory-related issues that could impact performance or stability. There are several types of memory consumption that should be observed when running an Oracle 18c database, including:
  1. SGA memory consumption: The System Global Area (SGA) is a shared memory region that contains data structures and information used by the Oracle database instance to manage memory and cache data. It's important to monitor SGA memory consumption to ensure that there is enough memory allocated to the SGA for optimal performance.
  2. PGA memory consumption: The Program Global Area (PGA) is a memory region used by each individual Oracle database process to store session-specific data. It's important to monitor PGA memory consumption to ensure that there is enough memory allocated to each process for optimal performance.
  3. Memory allocation: It's important to monitor the allocation of memory in the Oracle database to ensure that memory is being used efficiently and that there are no memory leaks or other issues that could impact performance.
  4. Virtual memory usage: The virtual memory usage of the Oracle database should also be monitored to ensure that there is enough virtual memory available to support the database and prevent out-of-memory errors.
  5. Operating system memory usage: Finally, it's important to monitor the overall memory usage of the operating system hosting the Oracle database to ensure that there is enough memory available to support the database and other applications running on the system

By monitoring memory consumption in these areas, database administrators can ensure that the Oracle 18c database is operating efficiently and that any memory-related issues are identified and addressed in a timely manner.