james-gone / knowledge

james gone knowledge record and share.
0 stars 0 forks source link

python-oracle-dispatcher-log #1

Open james-gone opened 7 years ago

james-gone commented 7 years ago

python cx_oracle dispatcher request and logs

james-gone commented 7 years ago

1、安装 Pyehon 3.6.1 勾选加入环境变量
2、解压缩 Oracle instantclient-basic-windows.x64-11.2.0.4.0.zip 到 D 盘 添加 d:\instantclient_11_2\ 到 Path 环境变量 将全部文件夹下内容复制到 d:\Python36\Lib\site-packages\ 3、安装 cx_Oracle 模块 在命令行启动 python -m pip install d:\temp\cx_Oracle-6.0b1-cp36-cp36m-win_amd64.whl 4、验证 cx_Oracle 模块 在 python 交互命令行 import cx_Oracle 没有报错说明安装成功模块 5、验证 与 Oracle 的连接 编写如下内容的文件,first_con.py. 以 python first_con.py 在命令行运行, 返回 Oracle 数据库的版本即表明连接成功。 连接字符串,分别是:用户名/密码@数据库IP:端口/数据库服务名.

import cx_Oracle

con = cx_Oracle.connect('infodba/infodba@172.18.88.40:1521/tc')
print(con.version)
con.close()
james-gone commented 7 years ago

select * from pdataset where puid='hHRVH6PnqONuMB';

select * from pworkspaceobject where puid='hHRVH6PnqONuMB';

select * from ppom_application_object where puid='hHRVH6PnqONuMB';

select * from ppom_object where puid='hHRVH6PnqONuMB';

select * from pdatasettype;

select * from pimanrelation;

//select PUID from pdatasettype where pdatasettype_name='CATPart';--D8QVXCjWqONuMB

select catpartt.puid from pworkspaceobject catpartt where catpartt.pobject_type='CATPart';