从stackOverflow上https://stackoverflow.com/questions/29351187/oracle-pl-sql-developer-cannot-find-my-tnsnames-ora-file 上找到一个对我有效(之前装过,后面重新装)的解决方案: if you are certain your tnsnames.ora file is correct (eg by testing the connection with the Oracle Net Config Assistant, or logging in successfully with SQLplus), and you are able to open the PLSQL Developer application, but you still can't connect to the database in PLSQL Developer, then follow these steps:
- In PLSQL Developer (version 11.0) go to Help/Support Info
- Click the TNS Names tab. If the path in PLSQL Developer is wrong it will be blank (no tns file found) or incorrect (wrong tns file in use)
- On the Info tab scroll down to the TNS File entry and to see the path for the tns file PLSQL Developer is using. Very likely this is wrong.
- To correct the path:
- open a command prompt
- navigate to the PLSQL Developer directory in Program Files
- enter this command:
plsqldev.exe TNS_ADMIN=c:\your\tns\directory\path\here
- A new PLSQL Developer UI will open and you should be able to connect.
- 【PL/SQL|PL/SQL developer 数据库下拉选没有值的情况】Make sure you have a Windows environment variable TNS_ADMIN set to the same path
- On Windows 7 you go to Start, Control Panel, System, Advanced System Settings, Environment Variables to view/add/update environment variables
推荐阅读
- pl/sql|pl/sql (Oracle) 可编程SQL
- Oracle|Oracle PL/SQL Developer不用安装的安装方法
- 备忘|PL/SQL Developer 安装及配置
- ORACLE|PL/SQL学习笔记