partition outer join in oracle 10g
Partition outer join is a new mechanism in 10g to "invent" data to fill the gaps in non-contiguous results. In 10g there are many methods to deal with such a problem (including the awe-inspiring, but equally terrifying, MODEL clause). In older versions of Oracle, "data-densification" was not as simple and certainly less efficient than it has now become.
the problem
This article has been motivated by a response I gave to a problem raised on an Oracle developer forum. Our requirement is to produce a report that details customer spending for each month of the year. Our database only records actual spend, so for any given month, data for dormant or idle customers will have to be generated.
setup
First, we'll create a mock CUSTOMER_ORDERS table with sparse data to represent customer spending. To keep the example simple, we'll denormalise the customer name onto the orders table.
SQL> CREATE TABLE customer_orders (name, dt, amt)
2 AS
3 SELECT *
4 from (
5 SELECT owner
6 , TRUNC(created) + MOD(ROWNUM,6)
7 , TRUNC(object_id/ROWNUM)
8 from all_objects
9 WHERE created > TRUNC(SYSDATE,'YEAR')
10 AND owner IN ('ORDSYS','WKSYS')
11 ORDER BY
12 DBMS_RANDOM.RANDOM
13 &nbs
相关文档:
如果web方式的em,isqlplus访问不了。
1. 检查主机名/IP、端口是否正确
安装时的主机名/IP、端口记录在$ORACLE_HOME/install/portlist.ini 文件中。
缺省是:
一般用户
http://ip:5560/isq ......
http://hi.baidu.com/lu_xinzhong/blog/item/4ff92b1725dec505c83d6d09.html
回滚表空间大小
-- 创建一个新的小空间的UNDO TABLESPACE
Create UNDO TABLESPACE UNDOTBS2 DATAFILE '/u01/app/oracle/oradata/orcl/UNDOTBS02.DBF' SIZE 100M REUSE AUTOEXTEND ON;
-- 设置新的表空间为系统UNDO_TABLESPACE
Alter SYSTE ......
转:ORACLE
多表关联 UPDATE 语句
原帖:http://www.cnblogs.com/miley/archive/2010/04/15/1712617.html
为了
方便起见
,建立了以下简单模型
,和构造了部分测试数据
:
在某个业
务受理子系统
BSS中,
--客户资
料表
create table customers
(
& ......
select round(sum(case when o.close_date is null then 1 else 0 end)/count(*),3)*100||'%' SCALE from order o
说明:使用sum对一定条件的数据求和后,与总数进行比较。
||'%' 为以的百分号形式输出结果(例:2%) ......
1. 资源正忙错误
在pl/sql developer开一个sql window,执行如下sql不提交
Create Table aa(a Int);
Insert Into aa Values(234);
再开一个sqlwindow执行
Drop Table aa
就会报ora-00054错误。
Oracle锁的知识:
此时Oracle已经对返回的结果集上加了排它的行级锁,所有其 ......