您好,登錄后才能下訂單哦!
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
注意 LD_LIBRARY_PATH必須添加 否則會找不到libsqlplus.so
下載oracle 11g sqlplus軟件
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
安裝rpm包
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
指定sqlplus運行所需要的庫
由于是RPM包安裝的,因此,oracle客戶端默認所在的路徑為/usr/lib/oracle/11.2/client64/lib/
#vi /etc/ld.so.conf
在最后加入:/usr/lib/oracle/11.2/client64/lib
重啟ldconfig
ldconfig
使用root用戶登錄,在/usr/lib/oracle/11.2/client64目錄下創建network/admin目錄,在此目錄下添加tnsnames.ora文件。并且配置tnsnames.ora文件(保持與DBA創建oracle庫一致)
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)
)
)
通過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 (兩種連接數據庫的方法一個通過tns 一個是通過數據庫名稱)
jdbc.username=nlcmp
jdbc.password=nlcmp980
hibernate.dialect=org.hibernate.dialect.OracleDialect
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。