设为首页 收藏本站
查看: 1802|回复: 0

[经验分享] ORA-01081: "cannot start already-running ORACLE - shut it down first"

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2014-6-3 11:03:57 | 显示全部楼层 |阅读模式
    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

当检查oracle实例后台进程不存在这时启动启动数据库报错:
  

  ORA-01081: "cannot start already-running ORACLE - shut it down first"

造成此种原因是

Orphaned shared memory segments and semaphores did not get cleared properly
from the last instance shutdown.

在oracle实例最后一次shutdown时,某一个孤立的共享内存段和信号没有被清理干净

解决方法


可以利用ipcs来找出共享内存段或者信号,利用ipcrm来手动清除
orphaned shared memory segments(孤立的共享内存段) 和semaphores(信号量)


[iyunv@rac01 ~]# ipcs -a

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
            
0x4e44b264 557069     oracle    640        287309824  25                     
0xd06e774c 524302     oracle    640        132120576  16                     

------ Semaphore Arrays --------
key        semid      owner      perms      nsems     
0x000000a7 0          root      600        1         
0x2e7fd0cc 131073     oracle    640        44        
0x334b5294 262146     oracle    640        154   



[iyunv@rac01 ~]# ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
        
0x4e44b264 557069     oracle    640        287309824  25                     
0xd06e774c 524302     oracle    640        132120576  16                     


ipcs: 检查分配的共享内存
ipcrm:手动释放共享内存段

取得ipc信息:

ipcs [-m|-q|-s]
-m       输出有关共享内存(shared memory)的信息
-q       输出有关信息队列(message queue)的信息
-s       输出有关“信号量”(semaphore)的信息
-a       使用所有打印选项. (针对 -b, -c, -o, -p, and -t的速记符)


Example:
  
    ipcrm -m    shmid 号   - for shared memory
    ipcrm -s    semid  号      - for semaphores
  

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.

在多实例的情况下
  
  
1. 运行
       ipcs -a > /tmp/ipcs_before.out  
  
2. 用 SQL*Plus 连接所有实例做一个简单的查询
         
     select * from dual;
  
3. 再次运行
        ipcs -a > /tmp/ipcs_after.out  
  
4. 对比 "/tmp/ipcs_before.out" 与 "/tmp/ipcs_after.out"  文件
  查找 LPID 没有改变的共享内存段
   
   These are the orphaned shared memory segments you are looking for:  
   
  
    LPID 显示最后过程中附加或者分立共享内存段的进程 ID


     因为,通过在每一个活着的实例中执行查询,你会涉及到属于各自实例的共享内存段,
   但是未涉及的共享内存段将变成孤立的一个
  
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.

   在识别孤立的共享内存段后,可以通过ipcs -a的输出确定具有相同CTIME值的信号找到孤立的共享内存段
   作为相关孤立共享内存段的值
  
   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.



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-20045-1-1.html 上篇帖子: ORA-01652: unable to extend temp segment by 128 in tablespace TEMP01 下篇帖子: ORA-07391: sftopn: fopen error, unable to open text file cannot start
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表