原因是我每次登錄sql*plus時都報錯,雖然解答很簡單,但是始終不是個事,所以我就找找看怎麼解決,也就是死馬當活馬醫了。
首先我設置了一下ORACLE_SID的值爲orcl,但是結果出現了錯誤。
C:\Documents and Settings\Administrator>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 4月 27 15:27:01 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn sys/as sysdba
輸入口令:
ERROR:
ORA-12560: TNS: 協議適配器錯誤
開也開不了,關也關不了(當然啦,因爲沒有連接到數據庫。。)
SQL> startup
ORA-12560: TNS: 協議適配器錯誤
SQL> shutdown immediate
ORA-12560: TNS: 協議適配器錯誤
SQL> exit
可能會是大小寫敏感的問題,於是我重來:
C:\Documents and Settings\Administrator>set ORACLE_SID=ORCL
C:\Documents and Settings\Administrator>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 4月 27 15:30:57 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn system/orcl as sysdba
已連接到空閒例程。
(居然有用,我是不是瞎貓啊。。。)
SQL> startup
ORACLE 例程已經啓動。
Total System Global Area 167772160 bytes
Fixed Size 1247900 bytes
Variable Size 75498852 bytes
Database Buffers 88080384 bytes
Redo Buffers 2945024 bytes
數據庫裝載完畢。
數據庫已經打開。
SQL>
sql*plus也能登進去了。。
不過每次“該有”的問題都還存在。。