关于ORA-28031问题的解决
在一次vpn账号过期以后,重新连oracle发现出现了如下问题:> conn bm0658@adw1d.na.pg.com Enter password: ERROR: ORA-28031: maximum of 148 enabled roles exceeded 在DBA_PRIVS_ROLE里面看,拥有两个role, 一个是公司的role,里面有137个子role, 另一个是DBA有12个子role; 加起来正好149个,超过了148,所以报这个错误;oracle对最大role数量的限制为148,即便是你将max_enabled_roles参数设为一个很大的值;这是如果你的account的default role为all, 即dba_privs_role里面全为yes,在登陆时就会检查所有的role是否超过148这个
MV定义语句中包含Fact的VIEW,能否Rewrite ?
在数据仓库环境中,复制一张dimension表是比较容易的事,但对于fact表,也许很多人更倾向于创建一个view,因为在新的环境里复制一张十几亿条记录的表,而且将来还要花心思去同步更新,其工作量是难以想象的。于是我们通常把MV的定义在IFCT对应的VIEW上,为了证明是否MV 定义语句里面包含VIEW,也 可以达到REWRITE的效果,我们做如下测试:1. 以SUM_SALES_PSCAT_WEEK_MV为原型,建立测试MV和定于语句中的所有Fact和dimension;###SUM_SALES_PSCAT_WEEK_MV### Definition: ######################SELECT p.prod_subcategory, t.week_ending_day
创建查看和浅析LOCAL INDEX和GLOBAL INDEX
1. 首先了解一下local index 和 global index的创建过程:SQL> create table kl911_1 (no number, name varchar2(60)) 2 partition by range (no) 3 (partition p1 values less than (10) pctfree 50, 4 partition p2 values less than (20) pctfree 50, 5 partition max_values values less than (maxvalue));Table created.SQL> create index idx_kl911_1 on kl911_1(no) local;Index created.SQL> select index_name from dba_ind_partitions where index_name='IDX_KL911_1';INDEX_NAME---------------------------
DML对prebuilt table的内容修改时出现ORA-01732
Insert到一张聚合表时出现如下错误,显然是因为MVs建在该表上,所以不能改,通过查看Metalink的: 463025.1,420777.1尝试不删除的情况下直接修改,但失败了,这种方法只对View有用,对MV没用?如下测试:ERROR at line 1: ORA-01732: data manipulation operation not legal on this viewSQL> create table kl1 as select * from sh.sales where rownum<200; --- kl1 sales Table created. SQL> create table kl2 as select * from sh.products where rownum<200; ---kl2 products Table created. SQL> crea
原来TOAD里能自动产生plan_table
当要执行explain plan时,发现schema下没有Plan table怎么办?toad会自动产生plan_table, 在一个弹出的窗口中输入: plan table schema, plan table name,(是否为gloable temporary table?) tablespace name, 然后就会为你创建一个plan_table, 注意这里默认的table名字为toad_plan_table,当然也可以改为习惯的plan_table。[@more@]
子查询分解
引自Johnathion的COB Fundamental:数学家的对话:“三个女儿年龄和36,年龄和是在场所有人的总数,大女儿又只宠物仓鼠”with age_list as( select rownum age from dba_objects where rownum <=36),product_check as( select age1.age youngest, age2.age middle, age3.age oldest, age1.age + age2.age + age3.age as summed, age1.age * age2.age * age3.age as product from age_list age1 ,age_list age2 ,age_list age3 where age2.age >= age1.age and age3.age >= age
关于查询转换的一些总结
对于查询转化,是优化器的一种功能,较简单的回答,优化器会根据它的推测将你的sql语句以另一种方式展现出来,当然查询结果肯定不变,但性能通常都是较优的。1. NO_UNNEST: 知道优化器关闭查询unnesting,也就是不让它将子查询保持在VIEW中,打散任何子查询。而unnest则是要求使用子查询转换。这里还必须提到一个隐藏参数 "_tablescan_cost_plus_one", 这个参数在8i里默认值是false的,到了9i,10g才变成true.这将导致9i以上的full scan的成本增加1,另外还有initrans这个表现出的变化,9i中其默认值为2,即使你指定为1,或者数
dba_ind_partitions中index的纪录和dba_indexes是否重复
答案是肯定的,与DBA_TABLES和DBA_TAB_PARTITIONS不同,DBA_IND_PARTITIONS是DBA_INDEXES里面被分区的indexes内容的复制。 SQL> select count(0) from dba_indexes where table_name like '%MV' and table_owner='ADWGD'; COUNT(0) ---------- 2152 SQL> select COUNT(distinct(index_name)) from dba_ind_partitions where index_owner='ADWGD'; COUNT(DISTINCT(INDEX_NAME)) --------------------------- 2411 SQL> select distinct(index_name) from dba_ind_partitions w
第一桶金
我的第一桶金,这是个略显沉重的话题,因为到现在已到而立之年,我没有起来金库的钥匙,没有一个绝对饥饿的胃,也没有被大奖砸中的运气. 也许一辈子平平淡淡的生活真的要继续下去了.但是为什么一定要这样呢? 有时候总觉得...
闪回版本查询操作
SQL> create table t4 as select object_id, object_type,created, status from dba_objects where rownum<3000;SQL> select count(*) from t4; COUNT(*)---------- 2999SQ...