Oracle client installation configuration
Vi / home/oracle/.bashrc
Umask 022
ORACLE_BASE=/usr/lib/oracle
ORACLE_HOME=$ORACLE_BASE/11.2/client64
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
TNS_ADMIN=/usr/lib/oracle/11.2/client/network/admin
Export LD_LIBRARY_PATH ORACLE_BASE ORACLE_HOME PATH TNS_ADMIN
Note that LD_LIBRARY_PATH must be added or libsqlplus.so will not be found
Download oracle 11g sqlplus software
Http://www.oracle.com/technology/software/tech/oci/instantclient/index.html
Oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
Oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm
Oracle-instantclient11.2-devel-11.2.0.2.0.x86_64.rpm
Install the RPM package
Rpm-ivh oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
Rpm-ivh oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm
Rpm-ivh oracle-instantclient11.2-devel-11.2.0.2.0.x86_64.rpm
Specify the libraries required for sqlplus to run
Because it is installed by the RPM package, the default path for the oracle client is / usr/lib/oracle/11.2/client64/lib/
# vi / etc/ld.so.conf
Add: / usr/lib/oracle/11.2/client64/lib at the end
Restart ldconfig
Ldconfig
Log in as the root user, create the network/admin directory in the / usr/lib/oracle/11.2/client64 directory, and add the tnsnames.ora file to this directory. And configure the tnsnames.ora file (consistent with DBA's creation of the oracle library)
LISTENER_TMSDB =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.14.102) (PORT = 1530))
TMSDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.14.102) (PORT = 1530))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = tmsdb.davy.com)
)
)
Through jdbc
Jdbc.driver=oracle.jdbc.driver.OracleDriver
# jdbc.url=jdbc:oracle:thin:@oracleIP:1530:tmsdb
Jdbc.url=jdbc:oracle:thin:@//oracleIP:1530/tmsdb.davy.com (two ways to connect to the database, one through tns and the other through database name)
Jdbc.username=nlcmp
Jdbc.password=nlcmp980
Hibernate.dialect=org.hibernate.dialect.OracleDialect