Javama: summary
Https://www.cnblogs.com/joeblackzqq/archive/2011/03/19/1988915.html
First of all: Baidu above the search information, are garbage information, and examples are copied each other, there is no reference value,
The most annoying is the need to install the Oracle remote client, their idiots are mainly local, usually local if there is
Install Oracle, will also install the client, do not need that as a group of fools to publish those useless information, wasting their time.
1. To use Oracle remotely, download the following three files first, and note that the best version is the same.
Oracle-instantclient-basic-10.2.0.4-1.i386.zip
Oracle-instantclient-devel-10.2.0.4-1.i386.zip//This is the SDK, the file name is not stated, hereby stated
Oracle-instantclient-sqlplus-10.2.0.4-1.i386.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 Oracle-instantclient-basic-10.2.0.4-1.i386.zip
Unzip Oracle-instantclient-sqlplus-10.2.0.4-1.i386.zip
Where these two files are extracted to the same directory under the current directory: Instantclient_10_2
CD Instantclient_10_2
Move all files under this directory to/opt/oracle/lib.
Finally unzip the Oracle-instantclient-devel-10.2.0.4-1.i386.zip to extract the files/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.
Join
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
VI Tnsnames.ora
Bossdata =
(DESCRIPTION =
(address = (PROTOCOL = TCP) (HOST =192.168.1.107) (port = 1521))//192.168.1.107 IP address, port number: 1521
(Connect_data =
(SERVER = dedicated)
(service_name = bossdata)//bossdata Global Data name
)
)
Extproc_connection_data =
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1))
)
(Connect_data =
(SID = Plsextproc)
(PRESENTATION = RO)
)
)
VI 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.1.107) (PORT = 1521))//This is explained above
)
)
7. Completed. Test.
CD \opt\oraclelib
[Email protected] lib]# 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 System/[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>
It's okay to test the client, and then install the DBD in Perl.
Linux installs Oracle client separately