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

来源:互联网 发布:淘宝卖家怎么查看总额 编辑:程序博客网 时间:2024/06/06 09:34

  1.   
  2. 当检查oracle实例后台进程不存在这时启动启动数据库报错:   
  3.    
  4.   
  5.   ORA-01081: "cannot start already-running ORACLE - shut it down first"   
  6.   
  7. 造成此种原因是  
  8.   
  9. Orphaned shared memory segments and semaphores did not get cleared properly   
  10. from the last instance shutdown.  
  11.   
  12. 在oracle实例最后一次shutdown时,某一个孤立的共享内存段和信号没有被清理干净  
  13.   
  14. 解决方法  
  15.   
  16.   
  17. 可以利用ipcs来找出共享内存段或者信号,利用ipcrm来手动清除  
  18. orphaned shared memory segments(孤立的共享内存段) 和semaphores(信号量)  
  19.   
  20.   
  21. [root@wl ~]# ipcs -a   
  22.   
  23. ------ Shared Memory Segments --------  
  24. key        shmid      owner      perms      bytes      nattch     status        
  25.              
  26. 0x00000000 688138     oracle    640        4096       0                        
  27. 0x00000000 720907     oracle    640        4096       0
  28.                        
  29.   
  30. ------ Semaphore Arrays --------  
  31. key        semid      owner      perms      nsems       
  32. 0x000000a7 0          root      600        1           
  33. 0x00000000 688138     oracle    640        4096       0          
  34. 0x00000000 720907     oracle    640        4096       0
  35.       
  36.   
  37.   
  38.   
  39. [root@wl ~]# ipcs -m   
  40.   
  41. ------ Shared Memory Segments --------  
  42. key        shmid      owner      perms      bytes      nattch     status        
  43.          
  44. 0x00000000 688138     oracle    640        4096       0                     
  45. 0x00000000 720907     oracle    640        4096       0
  46.                        
         [root@wl ~]# ipcrm - m 720907 
  1.   
  2. ipcs: 检查分配的共享内存  
  3. ipcrm:手动释放共享内存段  
  4.   
  5. 取得ipc信息:  
  6.   
  7. ipcs [-m|-q|-s]  
  8. -m       输出有关共享内存(shared memory)的信息  
  9. -q       输出有关信息队列(message queue)的信息  
  10. -s       输出有关“信号量”(semaphore)的信息  
  11. -a       使用所有打印选项. (针对 -b, -c, -o, -p, and -t的速记符)  
  12.   
  13.   
  14. Example:  
  15.    
  16.     ipcrm -m    shmid 号   - for shared memory   
  17.     ipcrm -s    semid  号      - for semaphores   
  18.    
  19.   
  20. OR  
  21.   
  22. Shutdown all the instances belonging to the user. Next, run "ipcs -b" to find the remaining IPC   
  23. facilities, owned by the same user, and remove them.  However, if you're running multiple production   
  24. instances, this may not be  acceptable.   
  25.   
  26. 在多实例的情况下  
  27.    
  28.    
  29. 1. 运行   
  30.      ipcs -a > /tmp/ipcs_before.out    
  31.    
  32. 2. 用 SQL*Plus 连接所有实例做一个简单的查询   
  33.            
  34.      select * from dual;   
  35.    
  36. 3. 再次运行   
  37.       ipcs -a > /tmp/ipcs_after.out    
  38.    
  39. 4. 对比 "/tmp/ipcs_before.out" 与 "/tmp/ipcs_after.out"  文件  
  40.   查找 LPID 没有改变的共享内存段  
  41.     
  42.    These are the orphaned shared memory segments you are looking for:    
  43.     
  44.    
  45.     LPID 显示最后过程中附加或者分立共享内存段的进程 ID  
  46.   
  47.   
  48.      因为,通过在每一个活着的实例中执行查询,你会涉及到属于各自实例的共享内存段,  
  49.    但是未涉及的共享内存段将变成孤立的一个  
  50.    
  51. 5. After identifying the orphaned shared memory segments, you can find    
  52.    the orphaned semaphores by locating the semaphores with the same    
  53.    value of CTIME in "ipcs -a" output as the value of CTIME for the    
  54.    orphaned shared memory segments: CTIME shows the time when the    
  55.    associated entry was created or changed.   
  56.   
  57.    在识别孤立的共享内存段后,可以通过ipcs -a的输出确定具有相同CTIME值的信号找到孤立的共享内存段  
  58.    作为相关孤立共享内存段的值  
  59.    
  60.   
0 0
原创粉丝点击