下面是使用的initotars.ora参数文件, 通过参数文件创建spfile
db_name='OTARS'
memory_target=1G
processes = 150
audit_file_dest='/oracle/database/admin/otars/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/oracle/database/flash_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='/oracle/database'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files = (/oracle/database/oradata/otars/control01.ctl, /oracle/database/oradata/otars/control02.ctl)
compatible ='11.2.0'
[oracle@node01 dbs]$ echo $ORACLE_SID
otars
[oracle@node01 dbs]$
[oracle@node01 dbs]$
[oracle@node01 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 3 20:27:07 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> create spfile from pfile;
File created.
SQL> startup nomount;
ORA-00845: MEMORY_TARGET not supported on this system
我们继续查看ORA-00845的详细解释
[oracle@node01 dbs]$ oerr ora 00845
00845, 00000, "MEMORY_TARGET not supported on this system"
// *Cause: The MEMORY_TARGET parameter was not supported on this operating system or /dev/shm was 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 on each Oracle instance running on the system.
[oracle@node01 dbs]$
在自己的虚拟机环境中有两个实例,应该是/dev/shm使用不足造成。需要从操作系统层面解决这个问题。
[oracle@node01 dbs]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_node01-lv_root 27G 19G 6.5G 74% /
tmpfs 932M 231M 702M 25% /dev/shm
/dev/sda1 485M 40M 421M 9% /boot
在这里,我们看到/dev/shm 的大小是932M ,那我们理解下它是干什么的,为什么用到它,简单的说:
/dev/shm是Linux非常有用的一个目录,它就是所谓的tmpfs,也可以称之为临时文件系统(不是块设备),类似oracle中的临时表空间一样,用于加速和优化系统。
最主要的是该目录并没有放在磁盘上,而上在内存当中。
我们现在通过以下方法,临时修改和永久修改
mount -o size=3G -o nr_inodes=1000000 -o noatime,nodiratime -o remount /dev/shm --临时,服务器重启后失效
编辑 /etc/fstab 文件,指定/dev/shm的size 如下 --永久,服务器重启后依然有效
tmpfs /dev/shm tmpfs default,size=3G0 0
修改完成后,继续我们的初始化数据库实例操作就正常了
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1068937216 bytes
Fixed Size 2260088 bytes
Variable Size 671089544 bytes
Database Buffers 390070272 bytes
Redo Buffers 5517312 bytes
参考博客:
http://blog.csdn.net/cougar_mountain/article/details/22988673
http://blog.csdn.net/rlhua/article/details/13293445