Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle client installation configuration

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report