如何解决ORA-00845错误

简介:
今天刚刚安装了一个oracle 11gr2的数据库,第一次启动时报 ORA-00845错误。
oracle@r05a11016.yh.com:/home/oracle>sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.2.0 Production on Fri Apr 15 16:08:57 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system
SQL> exit
Disconnected
查看资料:
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.
问题是由于设置SGA的大小超过了操作系统/dev/shm的大小:
oracle@r05a11016.yh.com:/home/oracle>df -h /dev/shm          
Filesystem            Size  Used Avail Use% Mounted on
tmpfs                  71G   34G   37G  48% /dev/shm
可用大小是37G 而从spfile文件里的memory_target 是50 多G .
oracle@r05a11016.yh.com:/home/oracle>sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.2.0 Production on Fri Apr 15 16:13:44 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> create pfile='/tmp/orcl.ora' from spfile;
File created.
SQL> exit
Disconnected
oracle@r05a11016.yh.com:/home/oracle>vim  /tmp/orcl.ora
orcl.__db_cache_size=32346472448
orcl.__java_pool_size=134217728
orcl.__large_pool_size=134217728
orcl.__oracle_base='/apsarapangu/disk1/opt/oracle'#ORACLE_BASE set from environment
orcl.__pga_aggregate_target=24427626496
orcl.__sga_target=36373004288
orcl.__shared_io_pool_size=0
orcl.__shared_pool_size=3221225472
orcl.__streams_pool_size=134217728
*.audit_file_dest='/apsarapangu/disk1/opt/oracle/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/apsarapangu/disk1/opt/oracle/oradata/orcl/control01.ctl','/apsarapangu/disk1/opt/oracle/fast_recovery_
area/orcl/control02.ctl'
*.db_block_size=8192
*.db_domain='yh.com'
*.db_name='orcl'
*.db_recovery_file_dest='/apsarapangu/disk1/opt/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=4227858432
*.diagnostic_dest='/apsarapangu/disk1/opt/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
#*.memory_target=60800630784 大于可用/dev/shm大小。将其修改为16g。
*.memory_target=17179869184
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'                                          
"/tmp/orcl.ora" 26L, 1049C written  
重新启动。
SQL*Plus: Release 11.2.0.2.0 Production on Fri Apr 15 16:30:16 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup pfile='/tmp/orcl.ora'
ORACLE instance started.
Total System Global Area 1.7103E+10 bytes
Fixed Size                  2243608 bytes
Variable Size            8455717864 bytes
Database Buffers         8623489024 bytes
Redo Buffers               21712896 bytes
Database mounted.
Database opened.
==============================
当然可以修改/dev/shm大小 ,使其大于SGA大小。
解决步骤:
修改/etc/fstab 中/dev/shm 的大小,使其大于SGA 的大小。
#vi /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
LABEL=/data /data ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
#tmpfs /dev/shm tmpfs defaults 0 0
tmpfs /dev/shm tmpfs defaults,size=10240M 0 0
。。。。
LABEL=SWAP-sda swap swap defaults 0 0
~
"/etc/fstab" 13L, 965C written
卸载再加载
# umount /dev/shm
# mount /dev/shm
再次查看。
# df -k /dev/shm
相关文章
|
SQL 关系型数据库 MySQL
ORA-01948和ORA-04052错误的解决方法
一、事件背景: 业务人员在创建一个物化视图的时候,报了以下错误: SQL> CREATE MATERIALIZED VIEW MV_RETAIL_wbmout_R 2 TABLESPACE SAPDATA 3 PCTUSED 0 ...
1729 0
|
Oracle 安全 关系型数据库
小编教你Oracle数据库ORA-28002错误原因及解决办法
  近期小编在开发api接口时,调试中接口返回ORA-28002错误,看前缀知道是Oracle返回的错误信息,随查了下Oracle相关文档。在此把解决方案分享给有需要的朋友。在oracle database 11g中,默认在default概要文件中设置了“PASSWORD_LIFE_TIME=180天”所导致。密码过期后,业务进程连接数据库异常,影响业务使用。数据库密码过期后,业务进程一旦重启会提示连接失败。注:Oracle 11g启动参数resource_limit无论设置为false还是true,密码有效期都是生效的,所以必须通过以下方式进行修改:
531 0
|
缓存 Oracle 关系型数据库
重现ORA-01555错误
非常经典的一个一致性快照过旧的错误,Oracle面试必读。
|
SQL 缓存 Oracle
ORA-4031错误深入解析
Oracle共享池一个非常经典的错误,下面我们来详细解读,帮你理解共享结构。
|
Oracle 关系型数据库 数据库
|
SQL 监控 Oracle
ORA-600(2662)错误的重现和解决(二)
前两天同事在测试DATA GUARD的时候将主库的ONLINE日志意外覆盖,造成数据库无法打开,采用隐含参数的方法打开又碰到ORA-600错误,最后采用设置EVENTS的方式解决。
1281 0
|
SQL 监控 Oracle
ORA-600(2662)错误的重现和解决(一)
前两天同事在测试DATA GUARD的时候将主库的ONLINE日志意外覆盖,造成数据库无法打开,采用隐含参数的方法打开又碰到ORA-600错误,最后采用设置EVENTS的方式解决。
1252 0