文章目录
在安装Oracle Database 12c后,启动数据库时,可能会遇到下面的错误:
1 2
| SQL> startup; ORA-00838: Specified value of MEMORY_TARGET is too small, needs to be at least 3072M
|
导致这一问题的原因可能是修改了pfile,导致内存指定值过低,数据库启动会失败。
解决方法网上一大堆,无非是先指定一个临时的pfile,手动修改内存指定值,再试着启动数据库实例:
首先登陆到数据库,创建临时pfile
1 2 3 4 5 6 7 8 9 10 11
| [oracle@em bin]$ sqlplus / AS SYSDBA
SQL*Plus: Release 12.1.0.2.0 Production on Tue Jul 28 17:42:51 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL> create pfile='/tmp/pfile.bac' from spfile;
|
手动修改这个临时的pfile中的内存指定值:
1 2 3 4
| [root@em ~]# cat /tmp/pfile.bac ...... *.memory_target=3221225472 ......
|
然后以这个临时文件试着启动数据库实例:
1 2
| SQL> startup pfile=/tmp/pfile.bac ORA-00845: MEMORY_TARGET not supported on this system
|
启动失败了,又遇到了ORA-00845错误。导致该错误的原因是系统中tmpfs的空间不足。可以先查看一下系统的tmpfs空间:
1 2 3 4 5 6 7
| [root@em ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_em-lv_root 50G 20G 28G 42% / tmpfs 2.0G 424K 2.0G 1% /dev/shm /dev/sda1 477M 55M 397M 13% /boot /dev/mapper/vg_em-lv_home 73G 54M 69G 1% /home Desktop1 147G 99G 49G 67% /home/oracle/win
|
可以看到tmpfs可用空间发现只有2G可用,显然是不够的,按照下面的方法,增加tmpfs的空间:
1 2 3 4 5 6 7 8 9
| [root@em ~]# mount -t tmpfs shmfs -o size=3500m /dev/shm [root@em ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_em-lv_root 50G 20G 28G 42% / tmpfs 3.5G 0 3.5G 0% /dev/shm /dev/sda1 477M 55M 397M 13% /boot /dev/mapper/vg_em-lv_home 73G 54M 69G 1% /home Desktop1 147G 99G 49G 67% /home/oracle/win shmfs 3.5G 0 3.5G 0% /dev/shm
|
修改/etc/fstab,确保系统重新启动时tmpfs的设置依然有效:
1 2 3
| [root@em ~]# vim /etc/fstab
tmpfs /dev/shm tmpfs size=3500m 0 0
|
最后,再次以临时pfile启动数据库实例:
1 2 3 4 5 6 7 8 9 10
| SQL> startup pfile=/tmp/pfile.bac ORACLE instance started.
Total System Global Area 3221225472 bytes Fixed Size 2929552 bytes Variable Size 1879051376 bytes Database Buffers 1325400064 bytes Redo Buffers 13844480 bytes Database mounted. Database opened.
|
然后按照临时pfile中的内容重新创建pfile:
1 2 3
| SQL> CREATE SPFILE FROM PFILE;
File created.
|
(END)