您好,欢迎访问一九零五行业门户网

ORA-12154 和 TNS-03505 监听错误的解决方法

ora-12154 和 tns-03505 监听错误的解决方法
今天在笔记本上本来想做个exp的测试的时候突然报错:
用tnsping 一下:
c:\>tnsping wwl;
tns ping utilityfor 64-bit windows: version 10.2.0.4.0 - production on 21-apr-2012 18:27:52
copyright (c)1997,  2007, oracle.  all rights reserved.
used parameterfiles:
c:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora
tns-03505:failed to resolve name
c:\>
上网google了一下,说是环境变量有问题。 看了一下,环境变量确实有点问题。 oracle的path 是放在中间,,官方要求是将oracle的path放到最前面。 这里要注意的地方,如果在界面上来修改环境变量,是需要重启电脑的。这样太麻烦了。 直接在dos里修改,就不用重启了,这样也方便很多。
1. 在界面修改
我的电脑->属性->高级->环境变量,找到path,把里面的顺序改一下,顺便看一下oracle_home这个变量,如果没有,就加上去。
这种修改方法需要重新启动电脑。
c:\>echo%path%
c:\oracle\client;c:\oracle\product\10.2.0\db_1\bin;c:\programfiles\common files\microsoft shared\wi
ndows live;c:\programfiles (x86)\common files\microsoft shared\windows live;c:\program files (x86)\
commonfiles\netsarang;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\w
indowspowershell\v1.0\;c:\programfiles (x86)\windows live\shared;c:\program files (x86)\lenovo\acce
ssconnections\;c:\program files (x86)\ultraedit\;c:\program files(x86)\dbank\clickup;c:\program fi
les(x86)\dbank\clickup
c:/ >set path=c:\oracle\product\10.2.0\db_1\bin;c:\oracle\client;c:\programfiles\common files\microsoft shared\wi
ndowslive;c:\program files (x86)\common files\microsoft shared\windowslive;c:\program files (x86)\
commonfiles\netsarang;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\w
indowspowershell\v1.0\;c:\programfiles (x86)\windows live\shared;c:\program files (x86)\lenovo\acce
ssconnections\;c:\program files (x86)\ultraedit\;c:\program files(x86)\dbank\clickup;c:\program fi
les(x86)\dbank\clickup
c:/documents andsettings/user.hq-text>echo %path%
c:\oracle\product\10.2.0\db_1\bin;c:\oracle\client;c:\programfiles\common files\microsoft shared\wi
ndowslive;c:\program files (x86)\common files\microsoft shared\windowslive;c:\program files (x86)\
commonfiles\netsarang;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\w
indowspowershell\v1.0\;c:\programfiles (x86)\windows live\shared;c:\program files (x86)\lenovo\acce
ssconnections\;c:\program files (x86)\ultraedit\;c:\program files(x86)\dbank\clickup;c:\program fi
les(x86)\dbank\clickup
c:\>tnspingwwl
tns ping utilityfor 64-bit windows: version 10.2.0.4.0 - production on 21-apr-2012 18:37:12
copyright (c)1997,  2007, oracle.  all rights reserved.
used parameterfiles:
c:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora
used tnsnames adapter to resolve the alias
attemptingto contact (description = (address_list = (address = (protocol = tcp)(host =thinkpad)(po
rt =1521))) (connect_data = (service_name = wwl)))
ok(30 msec)
c:\>在dos窗口修改后,我们可以检查“我的电脑”->“属性”->“高级”->“环境变量”中设置的 path 值,它也自动修改了。不用担心dos窗口中的修改会影响环境变量的值,dos窗口中的环境变量只是windows环境变量的一个副本而已。但是对副本的修改却会引发windows环境变量的刷新,这就达到了我们不用重启电脑的目的。
更多oracle相关信息见oracle 专题页面 ?tid=12
其它类似信息

推荐信息