简体   繁体   English

cx_Oracle 查询性能

[英]cx_Oracle Query Performance

I plan to use python at my job to connect directly to our main system production database.我计划在我的工作中使用 python 直接连接到我们的主系统生产数据库。 However the IT department is reluctant since apparently there is no easy way to control how much I can query the database.然而,IT 部门并不情愿,因为显然没有简单的方法来控制我可以查询数据库的数量。 Hence they are worried I could affect performance for the rest of the users.因此他们担心我会影响其他用户的性能。

Is there a way to limit frequency of queries from python connection to the database?有没有办法限制从python连接到数据库的查询频率? Or some other method that I can "sell" to my IT department so they will let me connect directly to production DB via python?或者我可以“出售”给我的 IT 部门的其他方法,以便他们让我通过 python 直接连接到生产数据库?

Many thanks非常感谢

Database resource manager gives quite few options for this, depending how the production usage is compared to what you will be adding.数据库资源管理器为此提供了很少的选项,具体取决于将生产使用情况与您将添加的内容进行比较。 This does not depend on the type of client.这与客户端的类型无关。

https://blogs.oracle.com/db/oracle-resource-manager-and-dbmsresourcemanager https://blogs.oracle.com/db/oracle-resource-manager-and-dbmsresourcemanager

Often a plan is created where an order of usage limiting is specified.通常会创建一个计划,其中指定了使用限制的顺序。 Regular production will get most resources, your project a class lower.定期生产将获得最多的资源,您的项目低一级。 If production is running, your session[s] get what is left over by production.如果生产正在运行,您的会话[s] 会得到生产留下的东西。

Also very nice is a cost estimation that allows to cancel a query deemed too expensive.同样非常好的是成本估算,它允许取消被认为过于昂贵的查询。

A bit of thought must be given to slow long running transaction that held blocking locks….必须考虑减慢持有阻塞锁的长时间运行的事务......。 It does need a bit of experimentation to get this right.确实需要一些实验才能做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM