【问题记录】数据库打不开 报ORA-00845错误 /dev/shm设置过小

--startup时报错

SQL> startup

ORA-00845: MEMORY_TARGET not supported on this system

 

--查看该错

[oracle11@CD1 goldengate]$ oerr ora 845

00845, 00000,"MEMORY_TARGET not supported on this system"

// *Cause: TheMEMORY_TARGET parameter was not supported on this operating system or /dev/shmwas not sized correctly on Linux.

// *Action:Refer to documentation for a list of supported operating systems. Or,size /dev/shm to be at least the SGA_MAX_SIZE oneach Oracle instance running on the system

在oracle 11g中新增的内存自动管理的参数MEMORY_TARGET,它能自动调整SGA和PGA,这个特性需要用到/dev/shm共享文件系统,而且要求/dev/shm必须大于MEMORY_TARGET(SGA_MAX_SIZE),如果/dev/shm比MEMORY_TARGET小就会报错。

 

--查看当前/dev/shm大小

[oracle11@CD1 goldengate]$ df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

                       26G   16G 8.6G  65% /

/dev/sda1              99M   13M  82M  14% /boot

tmpfs                 624M     0 624M   0% /dev/shm

 

--将/dev/shm调大

[root@CD1 ~]# cat /etc/fstab | grep tmpfs

tmpfs                   /dev/shm                tmpfs  defaults        0 0

 

[root@CD1 ~]# mount -o remount,size=1g /dev/shm

 

 

--确保操作系统重启之后能生效,修改/etc/fstab文件

[root@CD1 ~]# cat /etc/fstab | grep tmpfs

tmpfs                   /dev/shm                tmpfs   defaults        0 0

 

[root@CD1 ~]# vi /etc/fstab

/dev/VolGroup00/LogVol00/                       ext3    defaults        1 1

LABEL=/boot             /boot                   ext3    defaults        1 2

tmpfs                  /dev/shm                tmpfs   defaults,size=1g       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/LogVol01swap                    swap    defaults        0 0

 

--确认修改结果

[root@CD1 ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

                       26G   16G 8.6G  65% /

/dev/sda1              99M   13M  82M  14% /boot

tmpfs                 1.0G     0 1.0G   0% /dev/shm

 

--打开数据库

[root@CD1 ~]# su - oracle11

[oracle11@CD1 ~]$ sql

 

SQL*Plus:Release 11.2.0.3.0 Production on Wed Dec 25 13:18:48 2013

 

Copyright (c)1982, 2011, Oracle.  All rights reserved.

 

Connected toan idle instance.

 

SQL> startup

ORACLEinstance started.

 

Total SystemGlobal Area  839282688 bytes

FixedSize                  2233000 bytes

VariableSize             511708504 bytes

DatabaseBuffers          318767104 bytes

RedoBuffers                6574080 bytes

Databasemounted.

Databaseopened.

成功打开了!

 

--查看memory_target参数

SQL> show parameter memory_target

 

NAME                  TYPE                          VALUE

--------------------------------------------------------------------- ------------------------------

memory_target           big integer                 804M

 

SQL> show parameter SGA_MAX_SIZE

 

NAME                  TYPE                 VALUE

--------------------------------------------------------------------- ------------------------------

sga_max_size            big integer             804M

原先的/dev/shm 为624M,小于804M,因此数据库不能打开!

 




你可能感兴趣的:(oracle,startup,MEMORY_TARGET,devshm,ORA-00845错误)