1. Determine the server version
Choose your Oracle Server version first to download the appropriate client. Look at the following sql:
SELECT * from V$version;
If you can't connect to Oracle remotely, you can only log on to the server.
2. Download Oracle Client
According to Oracle version, to http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html download the corresponding client, we will generally download the client and Sqlplus, It is convenient to use sqlplus connections or tests. If the client version I downloaded is versioned 12.1.0.1.0
Instantclient-basic-linux.x64-12.1.0.1.0.zip
Instantclient-sqlplus-linux.x64-12.1.0.1.0.zip
Ps:
Instant client can run your OCI, OCCI, Pro*c, JDBC, and ODBC applications without installing the full Oracle client. In addition, Instant Client supports Sql*plus. Starting with Instant Client 10.2, you can develop applications with OCI and OCCI through the Instant client SDK.
3. Unzip the above two zip files to the directory you have set up, my directory is
/usr/kevin/instantclient_12_1/lib/
4. Setting Environment variables
You can set it in terminal, and I'll add it to the end of the/etc/profile for later convenience:
Export oracle_home=/usr/kevin/instantclient_12_1/
Export ld_library_path=/usr/kevin/instantclient_12_1/lib/
If you want profile to take effect immediately, you can execute it in terminal:
Source/etc/profile
But this will work in the current terminal, and if you want every terminal to work best reboot.
5. Now you can enter
/usr/kevin/instantclient_12_1/lib/
Execute sqlplus.
./sqlplus
However, for convenience it is best to configure the Sqlplus to the PATH environment variable, or you may build a sqlplus soft connection under the/usr/local/bin.
6. Configure Tnsnames.ora
Tnsnames.ora is located under Oracle_home/network/admin/, which needs to be created manually, similar to the following:
TestData =
(DESCRIPTION =
(Failover=on)
(Load_balance=on)
(address_list=
(address = (PROTOCOL = TCP) (HOST =10.9.27.11) (PORT = 1521))
(address = (PROTOCOL = TCP) (HOST =10.9.27.12) (PORT = 1521))
)
(Connect_data =
(SERVER = dedicated)
(service_name = racdb)
)
)
7. After configuration, you can use Sqlplus to test whether your configuration is OK.
Problems encountered in the process of PS breeding:
Error while loading shared libraries:libsqlplus.so
You may encounter a sqlplus when performing a
Error while loading shared Libraries:libsqlplus.so:cannot open Shared object file:no such file or directory
Workaround: This is because the environment variable ld_library_path is not set or improperly set up, the General shared library is installed into/lib or/usr/lib, if installed in other places need to set the LD_LIBRARY_PATH environment variable, its value can be ":" Separate multiple paths.
Error while loading shared libraries:libaio.so.1
You may encounter a sqlplus when performing a
Rror while loading shared libraries:libaio.so.1:cannot open Shared object file:no such file or directory
Workaround: This is because the Libaio dependent library is missing, so you need to install:
sudo apt-get install Libaio-dev
The HTTP proxy server specified by Http_proxy was not accessible
You may encounter a sqlplus when performing a
HTTP proxy setting has incorrect value
Sp2-1502:the HTTP Proxy Server specified by Http_proxy are not accessible
Resolution: This is Http_proxy proxy settings brought, detailed explanation can refer to http://web.stanford.edu/dept/itss/docs/oracle/10gR2/server.102/b14357/ch13.htm
Cause:the HTTP Proxy Server used by Sql*plus cannot to be accessed. Sql*plus'll is unable to run scripts located on a Web server.
Action:check That's proxy setting has the correct value, or unset it if no proxy is needed. Sql*plus may get the proxy name of the environment variable http_proxy, or the value may is set in another way on your s Ystem. Check that's given proxy server is operational. Most Web browsers can is configured to use a proxy. Configure a browser to use the desired proxy and verify this web pages can still be loaded.
My solution is to cancel the agent, or
Unset No_proxy