Large SGA On Linux
Large SGA On Linux
On 32-bit Linux the total SGA size is limited to around 2Gig. There are several ways to allocate more memory than this, but the most robust and scalable method requires the use of a shared memory file, like shmfs in RHEL 2.1 or ramfs in RHEL 3-5. This article presents the methods necessary to create very large buffer caches on Red Hat Enterprise Linux and its clones.Red Hat Enterprise Linux (RHEL) 2.1
Create a shared memory file system (shmfs)
The shmfs is a memory file system so it can be as large as the maximum allowable virtual memory supported by Red Hat Linux AS2.1, currently 16 GB, although the enterprise kernel theoretically supports up to 64 GB of RAM.The shmfs is created using the following command as the root user:
The shared memory file system can be mounted automatically by adding the following line into /etc/fstab file:mount -t shm shmfs -o size=3g /dev/shm
In the above example I've created the shmfs with a size of 3G as that is the size of the buffer cache I am planning to use. The other elements of the SGA are placed in regular memory, not this shared memory file system, so they should not be included when deciding on the size of the shmfs. It is advisable to size this slightly bigger than the actual size needed, but in this example I've used a 3G shmfs for a 3G buffer cache.shmfs /dev/shm shm size=3g 0 0
Enabling big pages
Big pages are enabled by adding thebigpages=xMB
to the relevant kernel entry in the boot loader file /boot/grub/grub.conf file, where "x" is calculated as follows:
Then round this value to the nearest hundredth. So for a 4G SGA we would do the following:(Total SGA size in Gig) x 1024
So the /boot/grub/grub.conf file entry might look like this:4 x 1024 = 4096 = 4100
With this entry saved the system should be rebooted. Once the system is available you must perform the following command as the root user:kernel /vmlinuz-2.4.9-e.40enterprise ro root=/dev/cciss/c0d0p2 bigpages=4100MB
Alternatively you can add the following entry into the /etc/sysctl.conf file so this value persists between reboots:echo 2 > /proc/sys/kernel/shm-use-bigpages
kernel.shm-use-bigpages = 2
Red Hat Enterprise Linux (RHEL) 3, 4 and 5
Mount the ramfs filesystem and make sure it is usable by Oracle.Add these commands into the "/etc/rc.local" file. As with the RHEL 2.1 method, only the buffer cache is stored in this location.umount /dev/shm
mount -t ramfs ramfs /dev/shm
chown oracle:oinstall /dev/shm
For Oracle to lock shared memory for the shared pool, we must adjust the "memlock" parameter in the "/etc/security/limits.conf". The "memlock" figure is specified in Kb, so for a 2G shared pool we would need to set at least (2 * 1024 * 1024 = 2097152), as shown below.
In reality, it is better to oversize it a little.oracle soft memlock 2097152
oracle hard memlock 2097152
Setting the SHMMAX value
For 32 bit architecture, the shmmax value should be set at half the physical memory up to a maximum of 4294967295. For a server with 6G of memory we can set this value to 3G (half physical memory) using the following command as the root user:Alternatively it can be set in the /etc/sysctl.conf file with the following entry:echo 3221225472 > /proc/sys/kernel/shmmax
The contents of your /etc/sysctl.conf file may look something like this:kernel.shmmax = 3221225472
Alterations to the /etc/sysctl.conf file can be applied without a reboot by issuing the following command as root:kernel.shmmax = 3221225472
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.sem = 1000 32000 100 150
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
kernel.shm-use-bigpages = 2
/sbin/sysctl -p
Instance Parameters
Some instance parameter changes are necessary to allow the Oracle instance to use the shared memory file system. The spfile parameters can be manipulated using the ALTER SYSTEM SET command in a running instance, or by modifying the spfile contents offline:The following parameter should be added to the spfile or pfile:-- Change the parameter value in the spfile directly.
ALTER SYSTEM SET parameter = value SCOPE=spfile
-- Create a pfile with the contents of the current spfile.
CREATE PFILE='/tmp/pfile' FROM SPFILE;
-- Manually manipulate the contents of the pfile.
-- Recreate the spfile from the amended pfile.
CREATE SPFILE FROM PFILE='/tmp/pfile';
Also, any references to db_cache_size and db_xK_cache_size parameters should be removed and replaced with the old style db_block_buffers parameter entry:use_indirect_data_buffers=true
This means that the multiple block size feature is not available when using this method. Remember that the buffer cache is only one part of the SGA.[@more@]# 3Gig for an 8K db_block_size. ((3 * 1024 * 1024) / 8) = 393216
db_block_buffers = 393216
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9907339/viewspace-1048977/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE 記憶體管理 之六 SGA Multiple Block Sizes,Large PoolOracle記憶體BloC
- oracle10g在sga手工管理mmm模式如何配置大池large_pool_size(一)Oracle模式
- ORACLE記憶體管理 之五 SGA variable pool,shared_pool,large_pool,java_poolOracle記憶體Java
- Linux Hugepage ,AMM及 USE_LARGE_PAGES - 4Linux
- Linux Hugepage ,AMM及 USE_LARGE_PAGES - 3Linux
- Linux Hugepage ,AMM及 USE_LARGE_PAGES - 2Linux
- Linux Hugepage ,AMM及 USE_LARGE_PAGES - 1Linux
- sga_target設定大於100G遇到的一個bug ORA-00064: object is too largeObject
- linux上Oracle的sga(HugePages)分配問題LinuxOracle
- LOB(large object)Object
- oracle large poolOracle
- sga_target與sga_max_size
- SGA_MAX_SIZE與SGA_TARGET
- sga_target與max_sga_size
- Linux Hugepage ,AMM及 USE_LARGE_PAGES for oracle 11GLinuxOracle
- oracle 10g sga手動管理mmm 基於並行查詢parallel query如何配置large_pool_size大池Oracle 10g並行Parallel
- Memory Allocation API In Linux Kernel && Linux Userspace、kmalloc vmalloc Difference、Kernel Large Section Memory AllocationAPILinux
- ORACLE LARGE MEMORY(zt)Oracle
- show sga和show parameter sga的區別
- 【轉】SGA_MAX_SIZE與SGA_TARGET
- [轉]32位Linux設定超大Oracle SGA的分析LinuxOracle
- 自動SGA共享記憶體管理,ASMM,MMAN,sga_target,sga_max_size記憶體ASM
- LARGE DELETE快速刪除delete
- Linux中設定hugepages 在記憶體中 lock SGALinux記憶體
- 記憶體_SGA記憶體
- oracle sga相關Oracle
- Sga的結構
- oracle sga構成Oracle
- insert:key too large to index…Index
- 使用lock_sga和pre_page_sga引數保證SGA常駐實體記憶體記憶體
- 【sga】資料庫啟動時的的SGA大小顯示資料庫
- 【引數】使用lock_sga和pre_page_sga引數保證SGA常駐實體記憶體記憶體
- 變更oracle 11.2.0.3 rac sga自動管理為sga手工管理Oracle
- 轉:關於SGA_MAX_SIZE與SGA_TARGET的詳解
- oracle 在 aix上large page特性OracleAI
- SGA_TARGET Advice
- oracle10g SGAOracle
- oracle SGA配置和管理Oracle