1.運行 sqlplus / as sysdb
sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Sep 12 18:37:07 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
2.輸入命令 !ps -aef | grep orcl (orcl 爲你當前登錄用戶的名稱)
orcl 3591 3312 0 18:31 pts/0 00:00:00 sqlplus as sysdba
orcl 3592 3591 0 18:31 ? 00:00:00 oracleorcl.2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
orcl 3600 3591 0 18:32 pts/0 00:00:00 /bin/bash -c ps -aef | grep orcl
orcl 3601 3600 1 18:32 pts/0 00:00:00 ps -aef
orcl 3602 3600 0 18:32 pts/0 00:00:00 grep orcl
3.找到類似與倒數第四條的格式: oracleorcl.2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
其中oracleorcl.2 爲Oracle進程名,名字的格式爲oracle$ORACLE_SID. 可以很容易的看出當前進程與orcl.2實例關聯。
4.(問題出現地方) 運行 startup
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00130: invalid listener address '(ADDRESS=(PROTOCOL=TCP)(HOST=CentOS.haibao637)(PORT=1521))'
原因,由第3步可以得知,與當前進程綁定的實例名爲orcl.2. startup命令會到$ORACLE_HOME/dbs目錄下 搜索名字爲init${ORACLE.SID}.ora (當前爲initorcl.2.ora)
所以,其中一個原因就是不存在該文件,要不就是該文件爲空
5.退出exit
6.運行 echo db_name=orcl.2 > initorcl.2.ora
7.轉到第一步
。。。。
8.到第四步時,運行成功到結果(數字不一樣不是錯。。。):
ORACLE instance started.
Total System Global Area 150667264 bytes
Fixed Size 1335080 bytes
Variable Size 92274904 bytes
Database Buffers 50331648 bytes
Redo Buffers 6725632 bytes
9.bingo!