- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
4#
发表于 2011-10-24 22:50:13
Mos 文档 ORA-1081: Starting Instance 介绍了该问题,引用如下
- ORA-1081: Starting Instance [ID 1010214.6]
- Modified 07-APR-2011 Type PROBLEM Status PUBLISHED
- Applies to:
- Oracle Server - Enterprise Edition - Version: 8.1.7.4 to 11.2.0.2.0 - Release: 8.1.7 to 11.2
- Generic UNIX
- Symptoms
- An attempt to start an instance that is not running results in
- the following error:
-
- ORA-01081: "cannot start already-running ORACLE - shut it down first"
- When checking for the instance background processes, none exist.
- Cause
- Orphaned shared memory segments and semaphores did not get cleared properly
- from the last instance shutdown.
- Solution
- Remove the orphaned shared memory segments and semaphores via the ipc command specific to the platform.
- Example:
-
- ipcrm -m - for shared memory
- ipcrm -s - for semaphores
-
- The challenge is to find the ID of the orphaned shared memory and
- semaphores among the IPC facilities, that are used by other Oracle
- instances and owned by the same user on the same server.
- Refer to Document 18657.1 ORA 1081 cannot start already-running Oracle - shut it down first
- OR
- Shutdown all the instances belonging to the user. Next, run "ipcs -b" to find the remaining IPC
- facilities, owned by the same user, and remove them. However, if you're running multiple production
- instances, this may not be acceptable.
-
- If so, the following approach to solving the problem can be utilized:
-
- 1. Run
- % ipcs -a > /tmp/ipcs_before.out
-
- 2. Use SQL*Plus to run a simple query against each Oracle
- instance running on the server (e.g., "select * from dual;").
-
- 3. Run
- % ipcs -a > /tmp/ipcs_after.out
-
- 4. Compare the files "/tmp/ipcs_before.out" and "/tmp/ipcs_after.out"
- to find the shared memory segments whose LPID value has not changed.
- These are the orphaned shared memory segments you are looking for:
-
- LPID shows the process ID of the last process to attach or detach
- the shared memory segment.
-
- Since by running a query in each surviving instance you touched the
- shared memory belonging to those instances, the untouched shared
- memory segments will be the orphaned ones.
-
- 5. After identifying the orphaned shared memory segments, you can find
- the orphaned semaphores by locating the semaphores with the same
- value of CTIME in "ipcs -a" output as the value of CTIME for the
- orphaned shared memory segments: CTIME shows the time when the
- associated entry was created or changed.
-
- NOTE: This step may not be necessary on the platforms implementing
- post-wait kernel extension (AT&T Unix, AIX), when semaphores
- are not used by Oracle at all.
- If you have started one instance, you must reset the instance name before
- starting up the next instance.
-
-
- For example, for the 2 instances:
-
- ORACLE_SID prod
- ORACLE_SID test
-
-
- With ORACLE_SID set to prod:
-
- % sqldba mode=line
-
- sqldba> connect internal (connects you to prod)
- sqldba> startup (starts up prod)
- sqldba> startup pfile=inittest.ora (will still attempt to startup prod)
-
-
- To change instances from within SQL*DBA, use SET INSTANCE
-
- Example (starting up 2 instances) with ORACLE_SID set to prod:
-
- % sqldba mode=line
-
- sqldba> connect internal (connects you to prod)
- sqldba> startup (starts up prod)
- sqldba> disconnect (disconnects you from prod)
- sqldba> set instance p:test
- sqldba> connect internal
- sqldba> startup (starts up test)
复制代码 |
|