Article reference: http://blog.csdn.net/caomiao2006/article/details/11901123 thank Bo friends to share O (∩_∩) o~
Install Oracle remote client (typically local if available, install Oracle and install client)
1. To use Oracle remotely, download the following three files first, and note that the best version is the same.
(1) Instantclient-basic-linux32-11.1.0.7.zip
(2) Instantclient-sdk-linux32-11.1.0.7.zip
(3) Instantclient-sqlplus-linux32-11.1.0.7.zip
Look at Oracle's SQL statements, but if you can't go up, you can only ask the administrator of the remote Oracle.
SELECT * from V$version;
Different versions, or different operating systems, please go to the official website to download, there are detailed instructions.
Http://www.oracle.com/technology/tech/oci/instantclient/index.html
2. Create three client installation directories, these three directories can be customized, but when configuring environment variables, you need to be consistent.
Mkdir-p/opt/oracle/lib
Mkdir-p/OPT/ORACLE/SDK
Mkdir-p/opt/oracle/network/admin//Configure listeners and network environments.
3. Unzip the three files downloaded above.
Unzip Instantclient-basic-linux32-11.1.0.7.zip
Unzip Instantclient-sqlplus-linux32-11.1.0.7.zip
such as: Unzip-n xxx.zip-d./tmpdir
-N Do not overwrite the original file when extracting
-d< directory > Specifies the directory to be stored after the file has been decompressed.
Of these, the two files are extracted to the same directory under the current directory, the directoryAll FilesMove to/opt/oracle/lib.
Finally, unzip the instantclient-sdk-linux32-11.1.0.7.zip and move the extracted files to/OPT/ORACLE/SDK.
4. Configure the environment variables.
Vi/etc/profile//Note that this is an environment variable for all users, and if you want to restrict a user, you can only configure the user's profile.
Add to
Export Oracle_home=/opt/oracle
Export Ld_library_path=/opt/oracle/lib
Save and exit.
[[email protected] tmp]# source/etc/profile//Make configuration file effective immediately
[[email protected] tmp]# echo $ORACLE _home//See if the configured environment variable is successful
/opt/oracle
5. Configure the Listener and network environment.
Because you do not have an Oracle database installed locally, you need to get three files from the directory where you installed the Oracle database.
[Email protected] admin]# pwd
/opt/oracle/network/admin
[[email protected] admin]# ls
Listener.ora Sqlnet.ora Tnsnames.ora//For these three files, put them in this directory
6. Edit three files.
Tnsnames.ora
XE = (DESCRIPTION = = ( PROTOCOL = TCP) (HOST = 192.168 . ) (PORT = 1521 )) (Connect_data = = dedicated) (service_name /span>= XE))) Extproc_connection_data = ( DESCRIPTION = (address_list == (PROTOCOL = IPC) (KEY = EXTPROC1))) (Connect_data = (SID = Plsextproc) (PRESENTATION = R O))
Listener.ora
Sid_list_listener =(Sid_list=(Sid_desc=(Sid_name=Plsextproc) (Oracle_home= \opt\oracle)//Note that this is the $oracle_home that was just configured(Program =Extproc)) ) LISTENER=(Description_list=(DESCRIPTION=(ADDRESS= (PROTOCOL = IPC) (KEY =EXTPROC1)) (ADDRESS= (PROTOCOL = TCP) (HOST =192.168.25.46) (PORT =1521))//This is a description . ) )
Sqlnet.ora
is if 'softwareonly'this = (NTS)
7. Completed, tested.
[Email protected] lib]# Cd/opt/oracle/lib
[[email protected] lib]#./sqlplus//If the path is added as an environment variable you can directly execute Sqlplus
Sqlplus:error while loading shared libraries:libsqlplus.so:cannot open Shared object file:no such file or directory
If there is a problem above, it means that your environment variable is not set. Please refer to: 4th.
[Email protected] lib]# sqlplus Testuser/[email protected]
Sql*plus:release 10.2.0.4.0-production on Sun 1 12:20:08 2010
Copyright (c) 1982, Oracle. All rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-production
With the partitioning, OLAP and Data Mining options
Sql>
User's environment variables to execute Sqlplus can be added in. bash_profile
Alias sql= ' sqlplus testuser/[email protected] '
At this point the terminal directly input SQL can!
Installation Complete O (∩_∩) o~
Linux Install Oracle remote client