--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,因此數據庫不能打開!