The scenario is to use the Oracle Instant Client:
Http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
Step One:
Download the corresponding instant client version to the official Oracle website and download the basic version, for example I downloaded:
Instantclient-basic-win32-10.2.0.4.zip
It is recommended that you download the Sqlplus again for testing after the configuration is complete:
Instantclient-sqlplus-win32-10.2.0.4.zip
Step Two:
Create a new folder to extract the downloaded files, such as:
C:\Oracle
Then extract the compressed package from the step to the directory.
Step Three:
Increase in the environment variable:
Nls_lang=simplified Chinese_china. Zhs16gbk
tns_admin=C:\Oracle\instantclient_10_2
Oracle_home=C:\Oracle\instantclient_10_2
Modify the PATH environment variable to the front:
C:\Oracle\instantclient_10_2;
Note: The red part of the path is replaced by your own actual path
Step Four:
Create the Tnsnames.ora file under the C:\Oracle\instantclient_10_2 path.
Add the following Oracle service information:
cywms =
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.80) (PORT = 1521))
)
(Connect_data =
(service_name = cywms)
)
)
Note: The red part should be replaced with your Oracle connection information
Step Five:
At this point, Instantclient has been installed. Let's open the cmd command line and test it:
Sqlplus/nolog
You should see the version information for Sqlplus and connect to the Oracle instance using the following command:
Connect sa/system@cywms
If "Connected" appears, we are connected successfully:-)
Note: Please use your own user name, password, and database service name
Other:
Issue 1: My operating system is Win7 64-bit, using VS2010 development, connect database times badimageformatexception
If the above error is reported in a 64-bit operating system, please re-download the 32-bit version of Instantclient, and don't ask me why:-P
There is information on the Internet to modify the target platform of the project (Project right-property-------the target platform) for x86, after testing the use of 32-bit client, "any CPU" is also possible:)
Issue 2:PL SQL Login without reading the service information configured under Tnsnames.ora
Open PL SQL Cancel login, open tools properties (performances) window
For example, to remove the configuration of the Oracle home and OCI libraries, we have configured the environment variables so that PL SQL automatically reads OK:-)
Reference:
Http://www.cnblogs.com/chinalantian/archive/2011/09/09/2172145.html
Note 1: Methods of not installing Oracle Client remote connection to Oracle