oracle client 安裝配置

來源:互聯網
上載者:User

標籤:oracle client 安裝配置

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.99bill.com)

    )

  )

通過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 (兩種串連資料庫的方法一個通過tns 一個是通過資料庫名稱)

jdbc.username=nlcmp

jdbc.password=nlcmp980

hibernate.dialect=org.hibernate.dialect.OracleDialect


本文出自 “DavideyLee” 部落格,請務必保留此出處http://davideylee.blog.51cto.com/8703117/1533230

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.