python連線oracle資料庫

2021-08-22 19:19:27 字數 658 閱讀 3232

在windows下不要使用easy_install或者pip,因為這樣安裝不會同步環境,並報錯:

distutils.errors.distutilssetuperror: cannot locate oracle include files in…

(64位版本)

cx_oracle.inte***ceerror: unable to acquire oracle environment handle

3解決中文亂碼問題

3.1設定環境變數(全域性,可能對其它oracle客戶端產生影響)

「計算機」->「系統屬性」->「高階系統設定」->「系統屬性/高階 選項卡」->「環境變數」->「系統變數」->「新建」->

變數名:nls_lang

變數值:simplified chinese_china.zhs16gbk

4連線資料庫

import cx_oracle

db = cx_oracle.connect(username/passwd@host:port/sevicename) #

cx_oracle.connect(scott/tiger@host;1521/orcl)

cursor = db.cursor()

db.commit()

db.close()

R for windows連線oracle資料庫

相關資料均出自r manual。只包含rodbc方法。其他oci等暫不考慮。1.安裝r軟體。2.安裝oracle。安裝目錄 d oraclexe 這個目錄下面有tnsnames.ora,listener.ora,sqlnet.ora等配置檔案,修改tnsnames.ora檔案新增需要登入的資料庫se...

Oracle檢視連線數

有時候連得上資料庫,有時候又連不上.可能是資料庫上當前的連線數目已經超過了它能夠處理的最大值.select count from v process 當前的連線數 select value from v parameter where name processes 資料庫允許的最大連線數 修改最大連...

oracle的連線數

1 查詢oracle的連線數 select count from v session 2 查詢oracle的併發連線數 select count from v session where status active 3 檢視不同使用者的連線數 select username,count userna...