Oracle

Recently executed SQL not in V$SQL

独自空忆成欢 提交于 2021-02-19 02:22:45
问题 Under what circumstances does a select query not appear in the V$SQL view? For example, if I run this: select /*findme*/ * from T ... And then immediately afterward run this: select * from v$sql where sql_text like '%/*findme*/%'; Under what circumstances would I get no rows returned? And under those circumstances can I force a query's info to be recorded in V$SQL? 回答1: Under what circumstances does a select query not appear in the V$SQL view? One situation is on a Real Application Cluster

Forcing Entity Framework to not generate NCLOB's when building Linq-to-Sql Code (Model First)

不羁的心 提交于 2021-02-19 00:36:01
问题 I have a class with a nullable int property that that for filtering reasons, I need to convert to a string to do some comparisons. I have EF 6.1.2 installed, so using a .ToString() will work for that. queryableData = queryableData.Where(a => a.PropName.HasValue && a.PropName.Value.ToString().Contains("8675309")); When examining the actual SQL being executed, the number is being CAST into an NCLOB type, which is resulting in the following error: ORA-00932: inconsistent datatypes: expected

Forcing Entity Framework to not generate NCLOB's when building Linq-to-Sql Code (Model First)

南楼画角 提交于 2021-02-19 00:34:36
问题 I have a class with a nullable int property that that for filtering reasons, I need to convert to a string to do some comparisons. I have EF 6.1.2 installed, so using a .ToString() will work for that. queryableData = queryableData.Where(a => a.PropName.HasValue && a.PropName.Value.ToString().Contains("8675309")); When examining the actual SQL being executed, the number is being CAST into an NCLOB type, which is resulting in the following error: ORA-00932: inconsistent datatypes: expected

Forcing Entity Framework to not generate NCLOB's when building Linq-to-Sql Code (Model First)

 ̄綄美尐妖づ 提交于 2021-02-19 00:34:11
问题 I have a class with a nullable int property that that for filtering reasons, I need to convert to a string to do some comparisons. I have EF 6.1.2 installed, so using a .ToString() will work for that. queryableData = queryableData.Where(a => a.PropName.HasValue && a.PropName.Value.ToString().Contains("8675309")); When examining the actual SQL being executed, the number is being CAST into an NCLOB type, which is resulting in the following error: ORA-00932: inconsistent datatypes: expected

enq: TM

拜拜、爱过 提交于 2021-02-18 21:49:21
今天下午,有台服务器出现异常,响应特别慢,io等待奇高,awr top 5事件如下: 经回查ash,找到了造成这些事件的sql语句,如下: select * from v$active_session_history where event = ' enq: TM - contention ' select * from v$active_session_history where event = ' enq: KO - fast object checkpoint ' enq-TM的事件主要由insert /*+ append */语句引起,如下: enq-TM是一个表级别锁,在本例中主要是由于append引起。 TM 锁在下列场景中被申请: 在OPS(早期的RAC)中LGWR会以ID1=0 & ID2=0去申请该队列锁来检查 DML_LOCKS 在所有实例中是全0还是全非0 当一个单表或分区 需要做不同的表/分区操作时,ORACLE需要协调这些操作,所以需要申请该队列锁。包括: 启用参考约束 referential constraints 修改约束从DIASABLE NOVALIDATE 到DISABLE VALIDATE 重建IOT 创建视图或者修改ALTER视图时可能需要申请该队列锁 分析表统计信息或validate structure时 一些PDML并行DML操作

「分布式技术专题」三种常见的数据库查询引擎执行模型

元气小坏坏 提交于 2021-02-18 20:46:44
注: 本文涉及到的相关资料图片摘自 CARNEGIE MELLON DATABASE GROUP 发表的 CMU SCS 15-721 (Spring 2019) :: Query Execution & Processing (点击可查看) 1. 迭代模型/火山模型(Iterator Model) 又称 Volcano Model 或者 Pipeline Model 。 该计算模型将关系代数中每一种操作抽象为一个 Operator,将整个 SQL 构建成一个 Operator 树,查询树自顶向下的调用next()接口,数据则自底向上的被拉取处理。 火山模型的这种处理方式也称为拉取执行模型(Pull Based)。 大多数关系型数据库都是使用迭代模型的,如 SQLite、MongoDB、Impala、DB2、SQLServer、Greenplum、PostgreSQL、Oracle、MySQL 等。 火山模型的优点在于:简单,每个 Operator 可以单独实现逻辑。 火山模型的缺点:查询树调用 next() 接口次数太多,并且一次只取一条数据,CPU 执行效率低;而 Joins, Subqueries, Order By 等操作经常会阻塞。 2. 物化模型(Materialization Model) 物化模型的处理方式是:每个 operator 一次处理所有的输入

Oracle与Sql server的区别

ε祈祈猫儿з 提交于 2021-02-18 20:25:03
Oracle与Sql server的区别 来源 https://www.cnblogs.com/fengxiaojiu/archive/2017/11/16/7844994.html 一直搞不明白Oracle数据库和sql server的区别,今天我特意查资料把他们的区别整理出来 Oracle数据库:Oracle Database,又名Oracle RDBMS,或简称Oracle。是 甲骨文公司 的一款 关系数据库管理系统 。 它是在数据库领域一直处于领先地位的产品。可以说Oracle数据库系统是目前世界上流行的关系数据库管理系统,系统可移植性好、使用方便、功能强,适用于各类大、中、小、微机环境。它是一种高效率、可靠性好的 适应高吞吐量的数据库解决方案。 sql server数据库:美国Microsoft公司推出的一种关系型数据库系统。SQL Server是一个可扩展的、高性能的、为分布式客户机/服务器计算所设计的 数据库管理系统 ,实现了与WindowsNT的有机结合,提供了基于 事务 的企业级信息管理系统方案 两者的区别: (1)操作的平台不同 Oracle可在所有主流平台上运行,Oracle数据库采用开放的策略目标,它使得客户可以选择一种最适合他们特定需要的解决方案。客户可以利用很多种第三方应用程序、工具。而SQL Server却只能在Windows上运行了。   但SQL

Formatting hierachical queries with lpad function

≡放荡痞女 提交于 2021-02-18 19:18:09
问题 SELECT LPAD(last_name, LENGTH(last_name)+(LEVEL*2)-2,'_') AS org_chart FROM employees START WITH last_name='King' CONNECT BY PRIOR employee_id=manager_id ; LPAD(char1,n [,char2]) returns char1, left-padded to length n with the sequence of characters in char2. This tells SQL to take the LAST_NAME and left-pad it with the '_' character till the length of the resultant string is equal to the value determined by LENGTH(last_name)+(LEVEL*2)-2. For LEVEL = 1. Hence, (2 * 1) - 2 = 2 - 2 = 0. For

How can I force flyway to clean my docker oracle database?

≯℡__Kan透↙ 提交于 2021-02-18 17:39:24
问题 I've downloaded the official oracle docker image for Oracle Database EE. I've got a flyway configuration and often run flyway:clean against the locally installed XE version of the database. However flyway tells me it is not allowed to clean the database in the docker image, but it can migrate it. Is there a way to force flyway to clean the oracle db? To answer the questions from the comments: Here's the error message when running flyway through maven: org.flywaydb.core.api.FlywayException:

linux下安装php扩展pdo_oci和oci8

假装没事ソ 提交于 2021-02-18 15:47:14
此次安装扩展耗费了我大半天的时间,特此记录其中的安装过程,希望这篇教程能够帮助到大家,避免大家在安装的过程中少走弯路。 CentOS服务器上已有相关环境:apache2、 php 7 需要安装:1. oracle 客户端、2.oci8扩展、3.pdo_oci扩展 一、安装Oracle客户端 Oracle客户端可以在oracle官网下载(https://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html) 选择这上面这两个安装包,下载到/usr/local/src 然后解压: unzip instantclient-basic-linux.x64-11.2.0.4.0.zip unzip instantclient-sdk-linux.x64-11.2.0.4.0.zip 然后进入到解压后的目录:cd instantclient_11_2/将下面的三个文件作一下连接 ln -s libnnz11.so libnnz.so ln -s libclntsh.so.11.1 libclntsh.so ln -s libocci.so.11.1 libocci.so 然后将解压后的目录移动到 /usr/local/lib目录下,并易名为‘instantclient' mv ./instantclient_11_2