Chinaunix首页 | 论坛 | 博客
  • 博客访问: 503440
  • 博文数量: 130
  • 博客积分: 3581
  • 博客等级: 中校
  • 技术积分: 1200
  • 用 户 组: 普通用户
  • 注册时间: 2005-02-18 10:51
文章分类

全部博文(130)

文章存档

2016年(1)

2015年(8)

2014年(6)

2013年(2)

2012年(9)

2011年(16)

2010年(5)

2009年(4)

2008年(2)

2007年(6)

2006年(50)

2005年(21)

我的朋友

分类: Oracle

2011-08-05 12:09:36

   今天上午有一个数据库恢复的工作,目的是要把预生产库的数据库恢复到生产库去。用的是ASM,磁盘组,参数文件什么都创建好了,尝试启动instance,却发现instance启动不了。 
 
SQL*Plus: Release 11.2.0.1.0 Production on Thu Aug 4 22:25:08 2011
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device
SQL> exit
 
  首先想到是内存不足了,于是用free查看,发现空闲的内存只有876mb , 而大部份内存是被cache了 。
-m
             total       used       free     shared    buffers     cached
Mem:         32055      31179        876          0        443      25223
-/+ buffers/cache:       5513      26542
Swap:         8191        316       7875
  尝试释放cache里的内存:
 

3 > /proc/sys/vm/drop_caches
-m
             total       used       free     shared    buffers     cached
Mem:         32055       8325      23730          0          1       4214
-/+ buffers/cache:       4108      27947
Swap:         8191        316       7875
 
 比较释放前后的值,可以发现已经有近20G内存释放了。重新启动instance,发现仍然不能启动。
 
SQL*Plus: Release 11.2.0.1.0 Production on Thu Aug 4 22:25:08 2011
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device
SQL> exit
 
 
 先把/proc/sys/vm/drop_caches改回默认值再说:
 0 > /proc/sys/vm/drop_caches
 
 又想到linux里的核心参数,于是参考了预生产库的的参数配置:
# Oracle Kernal Parameters
#kernel.shmall = 2097152
#kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 256 96000 100 1024
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 4194304
kernel.msgmni = 2878

 但发现参数文件设定的值和系统的实际完全不一样 :
hostname:elcaro:$ cat /proc/sys/kernel/shmall
4294967296
hostname:elcaro:$ cat /proc/sys/kernel/shmmax
68719476736
 
 于是将生产库的核心参数改为和预生产库一样,问题解决:
#Oracle Kernal Parameters
#kernel.shmall = 2097152
kernel.shmall = 4294967296
#kernel.shmmax = 2147483648
kernel.shmmax = 68719476736
kernel.shmmni = 4096
#kernel.sem = 256 32000 100 142
kernel.sem = 256 96000 100 1024
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
"/etc/sysctl.conf" 70L, 2012C written

-p
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.ip_forward = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.core_pattern = /var/core/core_%e_%p
kernel.shmall = 4294967296
kernel.shmmax = 68719476736
kernel.shmmni = 4096
kernel.sem = 256 96000 100 1024
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 4194304
kernel.msgmni = 2878

logout
hostname:elcaro:$ dbi si
SQL*Plus: Release 11.2.0.1.0 Production on Thu Aug 4 23:33:13 2011
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 4275781632 bytes
Fixed Size                  2220200 bytes
Variable Size             905973592 bytes
Database Buffers         3355443200 bytes
Redo Buffers               12144640 bytes
SQL> exit

 
 关于free 和 /proc/sys/vm/drop_caches ,可参考:
     
 
 
阅读(1771) | 评论(0) | 转发(0) |
0

上一篇:反醒

下一篇:试用dbms_backup_restore包

给主人留下些什么吧!~~