某日,出现如下错误:
C:\Documents and Settings\Administrator>sqlplus ifsapp/ifsapp@smtestSQL*Plus: Release 10.2.0.1.0 - Production on 星期三 8月 27 16:53:09 2008Copyright (c) 1982, 2005, Oracle. All rights reserved.ERROR:ORA-12514: TNS: listener does not currently know of service requested in connect descriptor请输入用户名:经检查:
1. 检查服务器端服务为【已启动】状态。 2. 客户端tnsping状态为:C:\Documents and Settings\Administrator>tnsping smtestTNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 27-8月 -2008 16:57:25Copyright (c) 1997, 2005, Oracle. All rights reserved.已使用的参数文件:D:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora已使用 TNSNAMES 适配器来解析别名Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.2.60)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = TEST)))OK (10 毫秒) 3.服务器端C:\Documents and Settings\Administrator>SET ORACLE_SID=TESTC:\Documents and Settings\Administrator>sqlplus /nologSQL*Plus: Release 10.2.0.2.0 - Production on 星期三 8月 27 16:49:08 2008Copyright (c) 1982, 2005, Oracle. All Rights Reserved.SQL> conn / as sysdba;已连接到空闲例程。SQL> select * from v$instance;select * from v$instance*第 1 行出现错误:ORA-01034: ORACLE not available 有点想不明白,明明在Windows服务列表中看到服务是启动的,可为何是空闲例程。想了半天,才猛然想起:此前为了将服务器重启时间减少,而将HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb10g_home1 下的ORA_TEST_AUTOSTART值设置为FALSE。参看文章《
Windows 下逐状态启动 Oracle数据库》。于是:
SQL> startup;ORACLE 例程已经启动。Total System Global Area 645922816 bytesFixed Size 1291108 bytesVariable Size 432016540 bytesDatabase Buffers 209715200 bytesRedo Buffers 2899968 bytes数据库装载完毕。数据库已经打开。SQL> 问题解决。