Due to the sheer size of Oracle, there are times when we need to connect to a remote database with only the Oracle client installed, such as Plsql, Toad, and so on, but without Oracle there is no configuration file to support it. Finally found a very effective method, Oracle's Instantclient toolkit can be a good solution to this problem, but also small and convenient.
1. First download instant Client to Oracle website:
http://www.oracle.com/us/solutions/index-097480.html
The folder after decompression is called: Instantclient_11_2. Can be placed in any directory on the local disk. For example: d:/instantclient_11_2
2, in the D:/instantclient_11_2 directory under the new directory network, in the network directory to build the admin directory, in the Admin directory under the new file Tnsnames.ora, open to write the following:
ORCL =
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.6.8.10) (PORT = 1521))
)
(Connect_data =
(service_name = ORCL)
)
)
Where ORCL is the local host name of the remote database, 10.6.8.10 is the IP address of the remote server, ORCL is the name of the remote database.
3. Add an environment variable named Tns_admin and the value is the path where the Tnsnames.ora file is located.
Add environment variables by (My Computer-attribute-advanced-environment variable-new).
4. Download and install the PL.SQL.Developer configuration app
Configure Tools->preferences->connection
Oracle Home
D:/instantclient_11_2
OCI Library
D:/instantclient_11_2/oci.dll
After the configuration is complete, turn off PL/SQL and restart.
The host name appears in the list of PL/SQL developer, and you can log in to the remote Oracle database by entering the user name password.
When we successfully connected, sometimes the query data will be garbled, this is because the local encoding and server-side coding inconsistent, we can pass the SQL statement:
Select Userenv (' language ') from dual;
Query the server-side encoding, as my own query results are
USERENV (' LANGUAGE ')
American_america. Zhs16gbk
We need to add an environment variable Nls_lang with a value of: American_america. ZHS16GBK then restart PL/SQL and there will be no more garbled problems.
Oracle,plsql Remote Connection database is not installed locally