1、pip install cx_Oracle
2、数据库连接
```python
import cx_Oracle
conn = cx_Oracle.connect('ets_huser','nmc601','10.10.31.199/history:timesten_client')
cursor = connection.cursor()
cursor.execute("insert into t values (42)")
connection.commit()
connection.close()
```
参考:
https://stackoverflow.com/questions/7982224/python-access-to-timesten/58812853#58812853
https://docs.oracle.com/database/timesten-18.1/TTCDV/oci.htm#TTCDV203
![](https://www.showdoc.cc/server/api/common/visitfile/sign/cce77799412aebb3704d1dd52c097efd?showdoc=.jpg)
3、对接pandas
sql='select * from access_log';
cursor.execute(sql)
rows= cursor.fetchall()
print(cursor.description)
pd.DataFrame(list(rows),columns=[i[0] for i in cursor.description])
参考:
https://www.cnblogs.com/AsuraDong/p/7355436.html