我正在尝试使用golang连接TimesTen数据库,但是没有TimesTen驱动程序可供我找到。
有没有人有这样的经验,使用高丽访问TimesTen?
因为TimesTen支持OCI。因此,我试图使用一个名为goracle https://github.com/go-goracle/goracle的go包,但失败了。
这是我的sys.odbc.ini和TimesTen的sys.tt:
root@centos-7 ~# more /var/TimesTen/sys.odbc.ini TT_1122=TimesTen数据源sampledb_1122=TimesTen 11.2.2驱动程序sampledbCS_1122=TimesTen 11.2.2客户端驱动程序 TT_1122驱动程序=/opt/TimesTen/TT 1122/lib/libtten.so DataStore=/var/TimesTen/TT 1122/TT_1122 DatabaseCharacterSet=US7ASCII DataStore=/var/TimesTen/tt1122/DemoDataStore/sampledb_1122 PermSize=40 TempSize=32 PLSQL=1 DatabaseCharacterSet=US7ASCII =/opt/TimesTen/opt 1122/lib/libtten.so PermSize=40 TempSize=32 PLSQL=1 DatabaseCharacterSet=US7ASCII Driver=/opt/TimesTen/tt1122/lib/libttclient.so sampledbCS_1122 TTC_SERVER=ttLocalHost_tt1122 TTC_SERVER_DSN=sampledb_1122 TTC_SERVER_DSN=sampledb_1122
--
root@centos-7 TimesTen# more sys.ttconnect.ini ttLocalHost_tt1122 Description=TimesTen Server Network_Address=ttLocalHost TCP_PORT=53397
db, err := sql.Open("goracle","root/XXXXXXX@localhost:53397/sampledbCS_1122:timesten_client") // Trying to use this connect string for TimesTen, I am not sure if it is correct.在运行我的测试应用程序时,它报告错误如下:
根@centos-7 ttrest# ./ttrest错误运行查询username="root“ttrest# minSessions=1 maxSessions=1000 poolIncrement=1 extAuth=0 : ORA-29158:无法打开库。
发布于 2019-11-12 16:40:58
从Oracle TimesTen内存数据库访问Go的最佳方法是使用基于ODPI-C的go-goracle驱动程序。
您应该使用tnsnames.ora来指定一个TimesTen服务名称,该名称将用于连接Go。无论您使用TimesTen还是Oracle,使用goracle的方式都是一样的。
发布于 2019-06-09 10:27:46
您可以运行bin/ttenv.sh来设置环境变量,但是我可以从窗口连接,但我还没有从linux连接
https://stackoverflow.com/questions/55912657
复制相似问题