HASH JOIN的模式 hash join有三种工作模式,分别是optimal模式,onepass模式和multipass模式,分别在v$sysstat里面有对应的统计信息: SQL> select name, value from v$sysstat where name like '%workarea executions%'; optimal模式 optimal模式就是从build table上获取的结果集比较小,可以把整个hash table都建立在用户可以使用的内存区域里.下面这张图…
A permanent tablespace contains persistent schema objects. Objects in permanent tablespaces are stored in data files. An undo tablespace is a type of permanent tablespace used by Oracle Database to manage undo data if you are running your database in…
1.---表中有重复记录用SQL语句查询出来 select * from Recharge where RechargeSerial in (select RechargeSerial from Recharge group by RechargeSerial having count(*)>1) 2.oracle des加密函数方法 create or replace function encrypt_des(p_text varchar2, p_key varchar2) return va…
n 概述 表连接分为内连接和外连接 n 内连接 内连接实际上就是利用where子句对两张表形成的笛卡尔集进行筛选,我们前面学习的查询都是内连接,也是在开发过程中用的最多的连接查询. 基本语法: select 字段1,字段2,. . . from 表1 inner join 表2 on 条件 . . . select emp.ename,dept.dname from emp,dept where emp.deptno=dept.deptno; 等同于 select emp.enam…
业务场景的问题,我们有一个刷CUBE的SQL,是Oracle环境,平时跑70多分钟, 但是最近突然不动了,这个SQL需要算累计值,比如年累计客户数量. 累计值是什么意思呢?我们使用下面的数据来说明问题. select '201901' as c_month, 100 as c_customers from dual union all select '201902' as c_month, 102 as c_customers from dual union all select '201903…