Reference: http://blog.csdn.net/tan_yixiu/article/details/6762357
Operating System: Windows enterprise 64-bit
Development Tool: vs2010
Database: oracle11g
ORA-12560: TNS: protocol adapter error after installing odac: odtwithodac112012
Go to the system environment variable settings and view the path. It is found that the Oracle client is installed when odac is installed,
After the installation is complete, the path at the top of the path contains two more paths generated when odac is installed.
F: \ app \ Administrator \ product \ 11.2.0 \ client_1;
F: \ app \ Administrator \ product \ 11.2.0 \ client_1 \ bin;
Path: F: \ app \ Administrator \ product \ 11.2.0 \ client_1; F: \ app \ Administrator \ product \ 11.2.0 \ client_1 \ bin; E: \ app \ Administrator \ product \ 11.2.0 \ dbhome_1 \ bin; % SystemRoot % \ system32; % SystemRoot % \ system32 \ WBEM; % SystemRoot % \ system32 \ windowspowershell \ V1.0 \;
These two paths are placed before the oracle11g database path, resulting in ORA-12560: TNS: protocol adapter Error
Add the new path F: \ app \ Administrator \ product \ 11.2.0 \ client_1; F: \ app \ Administrator \ product \ 11.2.0 \ client_1 \ bin; the ORA-12560: TNS: protocol adapter error can be resolved after the Oracle database path is set.
For example, change path to: e: \ app \ Administrator \ product \ 11.2.0 \ dbhome_1 \ bin; % SystemRoot % \ system32; % SystemRoot % \ system32 \ WBEM; % SystemRoot % \ system32 \ windowspowershell \ V1.0 \; F: \ app \ Administrator \ product \ 11.2.0 \ client_1; F: \ app \ Administrator \ product \ 11.2.0 \ client_1 \ bin;
Resolving ORA-12560: TNS: protocol adapter errors.
Configure the Oracle client. Otherwise, vs2010 cannot connect to Oracle Data.
First find the installation directory of the Oracle database, and then find the following directory
For example, I installed it on an edisk.
E: \ app \ Administrator \ product \ 11.2.0 \ dbhome_1 \ Network \ admin
Find the following two files: tnsnames. ora and sqlnet. ora.
Copy the two files to the following directory under the installation directory of Oracle Developer Tools for Visual Studio. NET,
For example, I installed it on the F drive.
F: \ app \ Administrator \ product \ 11.2.0 \ client_1 \ Network \ admin
Then you can restart the machine (note that the Oracle database and Oracle Developer Tools for Visual Studio. NET are installed on the same server ).