介紹window環(huán)境下如何使用node連接使用oracle數(shù)據(jù)庫(kù)(不需要安裝VC)
安裝方法
npm install --global npm
npm install --global --production windows-build-tools
npm install instantclient
set PATH=%cd%\instantclient;%PATH%
set OCI_LIB_DIR=%cd%\instantclient\sdk\lib\msvc
set OCI_INC_DIR=%cd%\instantclient\sdk\include
npm install oracledb
通過(guò)python創(chuàng)建
cx_Oracle進(jìn)程訪問(wèn)數(shù)據(jù)庫(kù),所以無(wú)法使用SYSDBAorSYSOPER
常見(jiàn)錯(cuò)誤處理方法
1 . Cannot open include file oci.h 或者 The specified procedure could not be found. D:\xxx\node_modules\oracledb\build\Release\oracledb.node
檢查系統(tǒng)的 PATH 配置,將 Instant Client libs 路徑放到首位
2 . 編譯 windows-build-tools 時(shí),出現(xiàn) Error: spawn powershell.exe ENOENT
在系統(tǒng)的 PATH 路徑加入 %SystemRoot%/system32/WindowsPowerShell/v1.0