引言:
ORA-27101: shared memory realm does not exist
ORA-27100: shared memory realm already exists
shared memory realm指的是进程内存中的共享内存段?还是指SGA?
依然报错:OERR: ORA-27100 shared memory realm already exists
网上搜索提到:sga_max_size,sga_target内存设的太大了,也会报错,于是手工把他改小改成:sga_max_size=800M,sga_target=800M;重启依然报错。。。。。
OERR: ORA-27100 shared memory realm already exists
为啥转出的spfile的db_name是其它库的名称而并非orcl1呢?而且细看其它参数也都是描述数据库'xxxxx'的信息。
第二参考文档:
C:\> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Dec 19 09:29:20 2011
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORA-27100: shared memory realm already exists
SQL> shutdown immediate
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SQL>
-- Check the current value of sga_max_size
SQL> show parameter sga_max_size
NAME TYPE VALUE
------------------------------------ ----------- -------
sga_max_size big integer 308M
-- Save the spfile to a pfile in order to restore the original values
SQL> create pfile from spfile;
-- Increase sga_max_size to a value that is actually too large for the system, e.g.
SQL> alter system set sga_max_size=3G scope=spfile;
SQL> shutdown immediate
SQL> exit
-- Now restart the service that is configured to automatically start
-- the instance/database using the (default) spfile
-- Note that the servcie startup is now very quick as compared to
-- successful attempts where the SGA is actually created
-- Trying to start (and shutdown) the database now from the SQL prompt
-- shows the error messages:
C:\> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Dec 19 09:29:20 2011
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORA-27100: shared memory realm already exists
SQL> shutdown immediate
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SQL>
SQL> startup
ORA-27102: out of memory
OSD-00022: additional error information
O/S-Error: (OS 8) Not enough storage is available to process this command.
SQL>
...
Connected to an idle instance.
SQL> create pfile from spfile;
-- Edit the pfile to correct the too large sga_max_size value
-- to a value fitting the available physical memory
SQL> create spfile from pfile;
-- Restart the service
-- This uses the corrected spfile to automatically start the instance
-- (with ORA_<SID>_AUTOSTART=TRUE in the Windows Registry)
第二参考文档:
Problem Description:
====================
You are trying to start an Oracle instance when ORA-27100 is reported.
ORA-27100: shared memory realm already exists
Cause: Tried to start duplicate instances, or tried to restart an
instance that had not been properly shutdown
Action: Use a different instance name, or cleanup the failed instance's
SGA
The instance does not come up successfully and instance recovery is required.
However, instance recovery cannot complete because the instance is requiring
too much memory and will not start.
Bringing the database up in stages reveals ORA-27102 during a startup nomount.
Solution Description:
=====================
The size of the SGA must be reduced so the instance can startup or the new
software must be removed.
To determine if the problem is memory related:
1. Start svrmgr30 or connect as the internal SYSDBA user.
SVRMGR> Connect as internal/userpassword@SID
SVRMGR> shutdown immediate
SVRMGR> startup nomount pfile=C:\ORANT\DATABASE\initSID.ora
or with 9i and 10g
sqlplus /nolog
SQL> connect / as sysdba
SQL> shutdown immediate
SQL> startup nomount pfile='C:\ORANT\DATABASE\initiSID.ora'
ORA-27102 will be reported if the problem is memory related. The instance
cannot start. Proceed to step 2.
2. shutdown immediate
Reduce one or more of the following initSID.ora parameter values using a text
editor:
shared_pool_size (affects the library and data dictionary cache)
db_block_buffers (affects the database buffer cache)
log_buffer (affects the redo log buffer area)
3. Return to Server Manager or SQL*Plus and try to start the instance again.
SVRMGR> startup nomount pfile=C:\ORANT\DATABASE\initSID.ora
or
SQL> startup nomount pfile='C:\ORANT\DATABASE\initSID.ora'
If the instance startup still fails with ORA-27102 repeat steps 1-3
until the instance starts. Once it starts proceed to step 4.
4. At the Server Manager prompt or in SQL*Plus issue:
alter database mount
alter database open
If you are on a unix machine, you can clean up from last shutdown.
1) Delete $ORACLE_HOME/dbs/sgadef<sid>.dbf files (only applicable for
versons prior to 8.1.x).
2) Delete $ORACLE_HOME/dbs/lk<sid> files
3) If more than one instance on this box, need to identify only the
semaphores and shared memory associtated with that instance.
a) SVRMGR>connect internal
b) SVRMGR>oradebug ipc (This will list all shared memory and semaphores
for this instance)
or on 9i and 10g
a) sqlplus /nolog
b) connect / as sysdba
c) oradebug ipc
4) Remove shared memory and semaphores for this instance.
a) ipcs (Lists all Interprocesses)
b) ipcrm -m <id> (Removes Shared Memory Processes)
c) ipcrm -s <id> (Removes Semaphores)
After these steps the database should be able to startup without
any errors and without reducing the size of the SGA.
Explanation:
============
ORA-27100 is received as a result of changes made to initSID.ora parameters
affecting the SGA size, or a new software was recently installed on the
database server which requires additional memory.
Reducing the size of the SGA allows the instance to start and recover. The
database can then be mounted and opened successfully.
References:
===========
Administrators Guide
Reference Guide
Concepts Guide
参考了metalink也没有找到很有用的价值。于是只能静下心来,好好理一下思路。
为啥oralce还一直不释放内存呢?
我查了查spfileorcl1.ora'里面的sga_max_size=10G,sga_target=8G ,难道我用startup pfile='E:\pfile.ora' nomount;命令启动数据库,Oracle去调'E:\oracle10.2.1.0\db_1\dbs\spfileorcl1.ora',而导致的?
一台主机上有三个库(主机的CPU是16个,内存是16G),是不是sga_max_size=10G,sga_target=8G作怪呢》是不是这个原因呢?
下面来验证一下,我把'E:\oracle10.2.1.0\db_1\dbs\spfileorcl1.ora'文件给移走了,然后startup pfile='E:\pfile.ora' nomount; 成功了!!!
缺省安装时,oracle在windows服务启动时会自动启动实例,每次启动服务都会自动用默认的错误(spfileorcl1.ora'里面的sga_max_size=10G,sga_target=8G)的spfile('E:\oracle10.2.1.0\db_1\dbs\spfileorcl1.ora)启动实例,导至内存错误。
参见:
OERR: ORA-27100 shared memory realm already exists 对这个错误先做个笔记。。。以后碰到windows的oracle千成要注意一下!
startup pfile='E:\pfile.ora' nomount;不好使,不管怎么样,问题终于找到原因! 呵呵仅供参考。
参考: