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 Ld_library_path must be added otherwise you will not find libsqlplus.so
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
Installing RPM Packages
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 the Sqlplus to run
Because the RPM package is installed, the default path for the Oracle client is/usr/lib/oracle/11.2/client64/lib/
#vi/etc/ld.so.conf
In the last addition:/usr/lib/oracle/11.2/client64/lib
Restart Ldconfig
Ldconfig
Using the root user login, create the Network/admin directory under the/usr/lib/oracle/11.2/client64 directory and add the Tnsnames.ora file in this directory. and configure the Tnsnames.ora file (keep consistent with DBA creation 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.99bill.com)
)
)
Through the JDBC
Jdbc.driver=oracle.jdbc.driver.oracledriver
#jdbc. Url=jdbc:oracle:thin: @oracleIP: 1530:tmsdb
Jdbc.url=jdbc:oracle:thin:@//oracleip:1530/tmsdb.99bill.com (two ways to connect to a database one through TNS one is through the database name)
jdbc.username=nlcmp
jdbc.password=nlcmp980
Hibernate.dialect=org.hibernate.dialect.oracledialect
This article is from the "Davideylee" blog, make sure to keep this source http://davideylee.blog.51cto.com/8703117/1533230