11204刚装好dbca建好库sqlplus 是idle instance,有点奇怪,startup就报错ORA-01102。dbca建好之后界面闪了一下没了,记得之前不是这样的
SQL> startup
ORACLE instance started.
Total System Global Area 300630016 bytes
Fixed Size 2252704 bytes
Variable Size 167772256 bytes
Database Buffers 125829120 bytes
Redo Buffers 4775936 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode
看看什么错误
[oracle@pri orcl]$ oerr ora 1102
01102, 00000, "cannot mount database in EXCLUSIVE mode"
// *Cause: Some other instance has the database mounted exclusive or shared.
// *Action: Shutdown other instance or mount in a compatible mode.
[oracle@pri orcl]$
貌似已经起来了,但我还是dbca的用户会话下就不行了,看看smon进程
[root@pri ~]# ps -ef | grep smon
oracle 2978 1 0 21:47 ? 00:00:00 ora_smon_orcl
root 3226 3064 0 22:03 pts/2 00:00:00 grep smon
果然有,估计该kill
再看看alert日志
...
Wed Dec 16 21:49:14 2015
RECO started with pid=14, OS id=3050
Wed Dec 16 21:49:14 2015
MMON started with pid=15, OS id=3052
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
Wed Dec 16 21:49:14 2015
MMNL started with pid=16, OS id=3054
starting up 1 shared server(s) ...
ORACLE_BASE from environment = /oracle/app/
Wed Dec 16 21:49:14 2015
ALTER DATABASE MOUNT
sculkget: failed to lock /oracle/app//product/11.2.0/dbhome_1/dbs/lkORCL exclusive
sculkget: lock held by PID: 2972
ORA-09968: unable to lock file
Linux-x86_64 Error: 11: Resource temporarily unavailable
Additional information: 2972
ORA-1102 signalled during: ALTER DATABASE MOUNT...
Wed Dec 16 21:50:28 2015
Shutting down instance (abort)
License high water mark = 1
USER (ospid: 3059): terminating the instance
Instance terminated by USER, pid = 3059
Wed Dec 16 21:50:28 2015
Instance shutdown complete
Wed Dec 16 21:53:10 2015
Starting background process SMCO
Wed Dec 16 21:53:10 2015
SMCO started with pid=19, OS id=3145
谨慎起见网上查查,查mos
原文不贴了,贴solution
Verify that the database was shutdown cleanly by doing the following:
1. Verify that there is not a "sgadef.dbf" file in the directory "ORACLE_HOME/dbs".
% ls $ORACLE_HOME/dbs/sgadef.dbf? If this file does exist, remove it.
% rm $ORACLE_HOME/dbs/sgadef.dbf
2. Verify that there are no background processes owned by "oracle"
% ps -ef | grep ora_ | grep $ORACLE_SID
If background processes exist, remove them by using the Unix
command "kill". For example:
% kill -9
3. Verify that no shared memory segments and semaphores that are owned by "oracle" still exist
% ipcs -b
If there are shared memory segments and semaphores owned by "oracle", remove the shared memory segments
% ipcrm -m
and remove the semaphores
% ipcrm -s
NOTE: The example shown above assumes that you only have one
database on this machine. If you have more than one
database, you will need to shutdown all other databases
before proceeding with Step 4.
4. Verify that the "$ORACLE_HOME/dbs/lk" file does not exist
5. Startup the instance
Solution Explanation:
=====================
The "lk" and "sgadef.dbf" files are used for locking shared memory. It seems that even though no memory is allocated, Oracle thinks memory is still locked. By removing the "sgadef" and "lk" files you remove any knowledge oracle has of shared memory that is in use. Now the database can start
一步一步来
1、查看$ORACLE_HOME/dbs下有没有sgadeforcl.dbf的文件,然而并没有
[oracle@pri dbhome_1]$ cd dbs
[oracle@pri dbs]$ ls -rtl
total 20
-rw-r--r--. 1 oracle oinstall 2851 May 15 2009 init.ora
-rw-r----- 1 oracle oinstall 24 Dec 16 21:44 lkORCL
-rw-r----- 1 oracle oinstall 1536 Dec 16 21:45 orapworcl
-rw-rw----. 1 oracle oinstall 1544 Dec 16 21:50 hc_orcl.dat
-rw-r----- 1 oracle oinstall 2560 Dec 16 22:00 spfileorcl.ora
2、ps -ef | grep ora_ | grep $ORACLE_SID查看ora进程然后kill
[root@pri ~]# ps -ef | grep ora_ | grep orcl
oracle 2954 1 0 21:47 ? 00:00:00 ora_pmon_orcl
oracle 2956 1 0 21:47 ? 00:00:00 ora_psp0_orcl
oracle 2958 1 3 21:47 ? 00:00:36 ora_vktm_orcl
oracle 2962 1 0 21:47 ? 00:00:00 ora_gen0_orcl
oracle 2964 1 0 21:47 ? 00:00:00 ora_diag_orcl
oracle 2966 1 0 21:47 ? 00:00:00 ora_dbrm_orcl
oracle 2968 1 0 21:47 ? 00:00:00 ora_dia0_orcl
oracle 2970 1 0 21:47 ? 00:00:00 ora_mman_orcl
oracle 2972 1 0 21:47 ? 00:00:00 ora_dbw0_orcl
oracle 2974 1 0 21:47 ? 00:00:00 ora_lgwr_orcl
oracle 2976 1 0 21:47 ? 00:00:00 ora_ckpt_orcl
oracle 2978 1 0 21:47 ? 00:00:00 ora_smon_orcl
oracle 2980 1 0 21:47 ? 00:00:00 ora_reco_orcl
oracle 2982 1 0 21:47 ? 00:00:02 ora_mmon_orcl
oracle 2984 1 0 21:47 ? 00:00:00 ora_mmnl_orcl
oracle 2986 1 0 21:47 ? 00:00:00 ora_d000_orcl
oracle 2988 1 0 21:47 ? 00:00:00 ora_s000_orcl
oracle 2996 1 0 21:48 ? 00:00:00 ora_qmnc_orcl
oracle 3009 1 0 21:48 ? 00:00:08 ora_cjq0_orcl
oracle 3011 1 0 21:48 ? 00:00:00 ora_q000_orcl
oracle 3013 1 0 21:48 ? 00:00:00 ora_q001_orcl
oracle 3145 1 0 21:53 ? 00:00:00 ora_smco_orcl
oracle 3148 1 0 21:53 ? 00:00:00 ora_w000_orcl
oracle 3178 1 0 21:59 ? 00:00:00 ora_vkrm_orcl
oracle 3182 1 74 22:00 ? 00:02:26 ora_j000_orcl
oracle 3214 1 3 22:03 ? 00:00:00 ora_m000_orcl
oracle 3219 1 0 22:03 ? 00:00:00 ora_w001_orcl
[root@pri ~]# kill -9 2954 2956 2958 2962 2964 2966 2968 2970 2972 2974 2976 2980 2982 2984 2986 2988 2996 3009 3011 3013 3145 3148 3178 3182 3219
-bash: kill: (2954) - No such process
-bash: kill: (2956) - No such process
-bash: kill: (2958) - No such process
-bash: kill: (2962) - No such process
-bash: kill: (2964) - No such process
-bash: kill: (2966) - No such process
-bash: kill: (2968) - No such process
-bash: kill: (2970) - No such process
-bash: kill: (2972) - No such process
-bash: kill: (2974) - No such process
-bash: kill: (2976) - No such process
-bash: kill: (2980) - No such process
-bash: kill: (2982) - No such process
-bash: kill: (2984) - No such process
-bash: kill: (2986) - No such process
-bash: kill: (2988) - No such process
-bash: kill: (2996) - No such process
-bash: kill: (3009) - No such process
-bash: kill: (3011) - No such process
-bash: kill: (3013) - No such process
-bash: kill: (3145) - No such process
-bash: kill: (3148) - No such process
-bash: kill: (3178) - No such process
-bash: kill: (3182) - No such process
-bash: kill: (3219) - No such process
[root@pri ~]# ps -ef | grep ora_ | grep orcl
[root@pri ~]#
杀干净了,杀之前我还看了下共享内存段,这点看过很多资料,还是记不住
[oracle@pri trace]$ ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 1376272 oracle 640 8388608 26
0x00000000 1409041 oracle 640 293601280 26
0x43a45a88 1441810 oracle 640 2097152 26
------ Semaphore Arrays --------
key semid owner perms nsems
0xdb816d2c 851970 oracle 640 154
------ Message Queues --------
key msqid owner perms used-bytes messages
杀了之后是这样的
[root@pri ~]# su - oracle
[oracle@pri ~]$ ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
------ Semaphore Arrays --------
key semid owner perms nsems
------ Message Queues --------
key msqid owner perms used-bytes messages
好了,觉得可以起来了
[oracle@pri ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Wed Dec 16 22:06:23 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 300630016 bytes
Fixed Size 2252704 bytes
Variable Size 167772256 bytes
Database Buffers 125829120 bytes
Redo Buffers 4775936 bytes
Database mounted.
Database opened.
SQL>
至于为什么会这样目前还不清楚。
PS:对于SGA区域内的内存来说,是共享的是全局的,在UNIX上必须为Oracle设置共享内存段(可以是一个或多个),因为oracle在unxi上是多进程; 而在window上Oracle是单进程(多个线程),所以不用设置共享内存段 。
这是网上搜到的,今天暂时到这里。还有测试,明天要干活的
共享内存段和进程的关系。。。
阅读(1959) | 评论(0) | 转发(0) |