[oracle@ybdbtest oradata]$ sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 - Production on Thu Jun 26 10:16:29 2014
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn / as sysdba
ERROR:
ORA-12545: Connect failed because target host or object does not exist
記得昨天都連上去了,怎麼回事,查看oracle進程,進程存在,說明資料庫是啟動並執行。
[oracle@ybdbtest ~]$ ps -ef | grep ora_
oracle 5013 4499 0 11:33 pts/1 00:00:00 grep ora_
oracle 11806 1 0 2013 ? 00:00:00 ora_q001_szyb
oracle 12212 1 0 2013 ? 00:08:51 ora_pmon_szyb
oracle 12214 1 0 2013 ? 00:00:02 ora_psp0_szyb
oracle 12216 1 0 2013 ? 00:00:00 ora_mman_szyb
oracle 12218 1 0 2013 ? 00:03:25 ora_dbw0_szyb
oracle 12220 1 0 2013 ? 00:03:35 ora_dbw1_szyb
oracle 12222 1 0 2013 ? 00:03:36 ora_dbw2_szyb
oracle 12224 1 0 2013 ? 00:05:56 ora_lgwr_szyb
oracle 12226 1 0 2013 ? 02:13:23 ora_ckpt_szyb
oracle 12228 1 0 2013 ? 00:19:35 ora_smon_szyb
oracle 12230 1 0 2013 ? 00:00:00 ora_reco_szyb
oracle 12232 1 0 2013 ? 00:06:43 ora_cjq0_szyb
oracle 12234 1 0 2013 ? 00:40:47 ora_mmon_szyb
oracle 12236 1 0 2013 ? 01:23:21 ora_mmnl_szyb
oracle 12238 1 0 2013 ? 00:00:00 ora_d000_szyb
oracle 12240 1 0 2013 ? 00:00:00 ora_s000_szyb
oracle 12280 1 0 2013 ? 00:00:00 ora_qmnc_szyb
oracle 12300 1 0 2013 ? 00:00:00 ora_q000_szyb
通過SQL*Plus: Release 9.2.0.4.0 - Production on Thu Jun 26 10:16:29 2014,可以看出資料庫版本是9i,記憶中昨天的版本是10g,
檢查發現,9i與10g的版本都有安裝,檢查.bash_profile檔案,發現$ORACLE_HOME指向的是9i,修改$ORACLE_HOME,使其指向
10g(主要是bin目錄下的可執行程式),再次串連,成功:
[oracle@ybdbtest ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Jun 26 11:01:17 2014
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
當安裝了多個版本oracle,確實要注意。