环境:RHEL 5 ,64位,Oracle 11 R2。
在做实验的时候,由于想开两台虚拟机做数据库迁移测试和数据比对,由于笔记本物理内存不够,想将Linux虚拟机内存调小,VMware中设置完成之后进入系统发现数据库没起来,提示:
SQL>
conn / as sysdba
Connected to an idle instance.
SQL>
startup
ORA-00845: MEMORY_TARGET not supported on this system
经网上查询,发现是因为/dev/shm在跟着虚拟机内存调整之后(一般为物理内存的一半)小于MEMORY_TARGET值导致的该错误。
Oracle官方解释:
Starting with Oracle Database 11g, the Automatic Memory Management feature requires more shared memory (/dev/shm)and file descriptors. The size of the shared memory should be at least the greater of MEMORY_MAX_TARGET and MEMORY_TARGET for each Oracle instance on the computer. If MEMORY_MAX_TARGET or MEMORY_TARGET is set to a non zero value, and an incorrect size is assigned to the shared memory, it will result in an ORA-00845 error at startup.
查看MEMORY_TARGET:
SQL>
sho parameter target
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
archive_lag_target integer 0
db_flashback_retention_target integer 1440
fast_start_io_target integer 0
fast_start_mttr_target integer 0
memory_max_target big integer 700M
memory_target big integer 700M
parallel_servers_target integer 8
pga_aggregate_target big integer 0
sga_target big integer 0
查看shm大小:
[root@dbserver ~]#
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
26G 18G 6.5G 74% /
/dev/sda1 99M 21M 73M 23% /boot
tmpfs 636M 0 636M 0% /dev/shm
none 636M 104K 636M 1% /var/lib/xenstored
MEMORY_TARGET确实是小于/dev/shm值的大小。
解决问题的方法有两个:
1.修改fstab文件:
[root@dbserver ~]#
cat /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
将/dev/shm那一行修改成如下形式:
tmpfs /dev/shm tmpfs defaults,
size=1G 0 0
-----------size一定要大于MEMORY_TARGET 重启便可使修改生效。
2.手动重新挂载
[root@dbserver ~]#
mount -o remount,size=1G /dev/shm
然后起数据库:
[root@dbserver ~]#
su - oracle
[oracle@dbserver ~]$
sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Mar 7 06:29:59 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
startup
ORACLE instance started.
Total System Global Area 730714112 bytes
Fixed Size 2216944 bytes
Variable Size 574622736 bytes
Database Buffers 146800640 bytes
Redo Buffers 7073792 bytes
Database mounted.
Database opened.
SQL>
OK!
阅读(6198) | 评论(0) | 转发(0) |