ORA-27102: out of memory 故障

今天在修改sga和pga参数后在启动DB ,遇到了ORA-27102  out of memory 故障,以下是产生该故障操作,增加了

点击(此处)折叠或打开

  1. SQL> show parameter db_writer_processes;

  2. NAME TYPE VALUE
  3. ------------------------------------ ----------- ------------------------------
  4. db_writer_processes integer 6
  5. SQL> show parameter memory_target

  6. NAME TYPE VALUE
  7. ------------------------------------ ----------- ------------------------------
  8. memory_target big integer 57984M
  9. SQL> show parameter sga_max_size

  10. NAME TYPE VALUE
  11. ------------------------------------ ----------- ------------------------------
  12. sga_max_size big integer 57984M
  13. SQL> show parameter sga_target

  14. NAME TYPE VALUE
  15. ------------------------------------ ----------- ------------------------------
  16. sga_target big integer 0
  17. SQL> show parameter pga_aggregate_target

  18. NAME TYPE VALUE
  19. ------------------------------------ ----------- ------------------------------
  20. pga_aggregate_target big integer 0
  21. SQL> show parameter optimizer_mode

  22. SQL> show parameter open_cursors

  23. NAME TYPE VALUE
  24. ------------------------------------ ----------- ------------------------------
  25. open_cursors integer 300
  26. SQL> show parameter db_writer_processes

  27. NAME TYPE VALUE
  28. ------------------------------------ ----------- ------------------------------
  29. db_writer_processes integer 6
  30. SQL>
  31. SQL>
  32. SQL>
  33. SQL> alter system set memory_target=0 scope=spfile;

  34. System altered.

  35. SQL> alter system set sga_target=57984M scope=spfile;

  36. System altered.

  37. SQL> alter system set pga_aggregate_target=20480M scope=spfile;

  38. System altered.

  39. SQL> ALTER SYSTEM SET open_cursors=1000 scope=both;

  40. System altered.

  41. SQL>
  42. SQL> startup force
  43. ORA-27102: out of memory
  44. Linux-x86_64 Error: 28: No space left on device
  45. Additional information: -134217728
  46. Additional information: 1
 好的,让我们来查下资料,这个out of memory 是如何

[ID 301830.1]

Upon startup of Linux database get ORA-27102: out of memory Linux-X86_64 Error: 28: No space left on device [ID 301830.1] To Bottom  
--------------------------------------------------------------------------------
Modified:Oct 4, 2012Type:PROBLEMStatus:PUBLISHEDPriority:3 Comments (0)    

In this Document
 Symptoms 
  Ask Questions, Get Help, And Share Your Experiences With This Article 
 Changes 
 Cause 
 Solution 
 References 
--------------------------------------------------------------------------------
Applies to: 
Oracle Server - Standard Edition - Version 9.2.0.1 and later
Oracle Server - Enterprise Edition - Version 9.2.0.1 and later
Linux x86-64

Symptoms
      When trying to increase the SGA to approach half available RAM with an Oracle 64-bit version on a Linux 64-bit operating system, even though shmmax is set to match half the amount of  RAM, you get the following error when trying to start the instance:

SQL> startup nomount
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device
Ask Questions, Get Help, And Share Your Experiences With This Article
Would you like to explore this topic further with other Oracle Customers, Oracle Employees, and Industry Experts?

Click here to join the discussion where you can ask questions, get help from others, and share your experiences with this specific article.
Discover discussions about other articles and helpful subjects by clicking here to access the main My Oracle Support Community page for Database Install/Upgrade.

 Changes

      shmall is too small, most likely is set to the default setting of 2097152

$ cat /proc/sys/kernel/shmall
2097152

 Cause

      shmall is the total amount of shared memory, in pages, that the system can use at one time.

 Solution

      Set shmall equal to the sum of all the SGAs on the system, divided by the page size.

The page size can be determined using the following command:

 $ getconf PAGE_SIZE 

4096
For example, if the sum of all the SGAs on the system is 16Gb and the result of  '$ getconf PAGE_SIZE' is 4096 (4Kb) then set shmall to 4194304 pages

As the root user set the shmall to 4194304 in the /etc/sysctl.conf file:

kernel.shmall = 4194304

then run the following command:

$ sysctl -p
$ cat /proc/sys/kernel/shmall
4194304


NOTE:

The above command loads the new value and a reboot is not necessary.
Switch back to being the oracle user and retry the startup command.
Modifying /etc/sysctl.conf is a permanent workaround (applies at boot time). If for some reason you DO NOT want to change the system wide configuration, you can do it on the fly by directly changing the kernel pseudo FS AKA procfs.

e.g. echo "4194304" > /proc/sys/kernel/shmall

Using HUGEPAGES does not alter the calculation for configuring shmall.


所以,我们就来确定下操作系统层面的参数shmall 值,以及该参数的实际意义。

点击(此处)折叠或打开

  1. [root@oracle ~]# cat /proc/sys/kernel/shmmax
  2. 4294967295
  3. [root@oracle ~]# getconf PAGE_SIZE
  4. 4096
  5. [root@oracle ~]# cat /proc/sys/kernel/shmall
  6. 2097152
所以我们这边参数shmall的值应该为  20480M 57984M  / 4096 bytes ,按照以下值修改。

(20480+57984) * 1024 *1024 / 4096 = 20086784

点击(此处)折叠或打开

  1. [root@oracle ~]# sysctl -p
  2. net.ipv4.ip_forward = 0
  3. net.ipv4.conf.default.rp_filter = 1
  4. net.ipv4.conf.default.accept_source_route = 0
  5. kernel.sysrq = 0
  6. kernel.core_uses_pid = 1
  7. net.ipv4.tcp_syncookies = 1
  8. kernel.msgmnb = 65536
  9. kernel.msgmax = 65536
  10. kernel.shmmax = 68719476736
  11. kernel.shmall = 4294967296
  12. fs.aio-max-nr = 1048576
  13. fs.file-max = 6815744
  14. kernel.shmall = 20086784
  15. kernel.shmmax = 4294967295
  16. kernel.shmmni = 4096
  17. kernel.sem = 250 32000 100 128
  18. net.ipv4.ip_local_port_range = 9000 65500
  19. net.core.rmem_default = 262144
  20. net.core.rmem_max = 4194304
  21. net.core.wmem_default = 262144
  22. net.core.wmem_max = 1048586
  23. [root@oracle ~]#

修改完成后,可以正常startup了

点击(此处)折叠或打开

  1. SQL> startup
  2. ORACLE instance started.

  3. Total System Global Area 6.0529E+10 bytes
  4. Fixed Size 2267992 bytes
  5. Variable Size 5100274856 bytes
  6. Database Buffers 5.5298E+10 bytes
  7. Redo Buffers 128942080 bytes
  8. Database mounted.
  9. Database opened.
  10. SQL>

参考博客 :
1、 http://blog.youkuaiyun.com/leshami/article/details/8746021
2、http://surachartopun.com/2009/10/shared-memory-tuning-startup-database.html




来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27039319/viewspace-2121815/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/27039319/viewspace-2121815/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值