2013年4月15日

SQL Queries and Subqueries(10gR2)

摘要: Before start reading this article, you need to pay attention to the words in red.About Queries and SubqueriesCreating Simple QueriesHierarchical QueriesThe UNION [ALL], INTERSECT, MINUS OperatorsSorting Query ResultsJoinsUsing SubqueriesUnnesting of Nested SubqueriesSelecting from the DUAL TableDist 阅读全文

posted @ 2013-04-15 14:41 kramer 阅读(798) 评论(0) 推荐(0) 编辑

2013年4月12日

转载

摘要: 常常有人把这三个hint搞混,主要是因为对三种重写原理不清楚。特总结如下。(实验环境为10204)1. no_unnest, unnestunnest我们称为对子查询展开,顾名思义,就是别让子查询孤单地嵌套(nest)在里面。所以un_unnest双重否定代表肯定,即让子查询不展开,让它嵌套(nest)在里面。现做一个简单的实验:create table hao1 as select * from dba_objects;create table hao2 as select * from dba_objects;analyze table hao1 compute statistics;an 阅读全文

posted @ 2013-04-12 17:05 kramer 阅读(193) 评论(0) 推荐(0) 编辑

Unnesting of Nested Subqueries ( 10gr2 )

摘要: 本文的目的是要研究一下nested subquery。所谓nested subquery,就是指出现在where语句中用括号括起来的子查询。通常oracle对这些子查询的处理情况是把它们当做一个独立的对象,嵌套在父查询中执行。比如说下面这个例子SQL> select /*+ gather_plan_statistics */ ename from emp where exists (select /*+ no_unnest */ 1 from dept where deptno=emp.deptno and deptno=20);----------------------------- 阅读全文

posted @ 2013-04-12 16:47 kramer 阅读(436) 评论(0) 推荐(0) 编辑

2013年4月10日

IN , EXIST

摘要: 在SQL优化中,经常会有人问IN,NOT IN,NOT EXIST, EXIST的区别,会问IN 和 EXIST, NOT IN 和 NOT EXIST做比较哪些会更快些。 以前在RBO时代也许他们还是有区别的,但是现在oracle都是用CBO来处理SQL了,应该不会有区别。 但这只是猜想,还是要试... 阅读全文

posted @ 2013-04-10 15:11 kramer 阅读(342) 评论(0) 推荐(0) 编辑

2013年4月9日

python 导数据脚本

摘要: 背景:测试环境有表若干,产品环境有表若干。客户发信要求把产品环境数据同步到测试环境并提供了需要同步的table list。问题:该list可能有如下问题list中的表存在重复list中的表在测试环境不存在list中的表缺少依赖关系,比如parent表不在list中。解决上述问题:list中的表在测试环境不存在的问题:我们先根据客户提供的list,也就是rawlist创建一个外部表create directory my_dir as '/tmp';create table raw_list_tab(owner varchar2(40),table_name varchar2(80 阅读全文

posted @ 2013-04-09 18:08 kramer 阅读(305) 评论(0) 推荐(0) 编辑

v$ view and v_$ view

摘要: 不知道我是太较真了还是太闲了,才会写下这篇文章。本文主要讨论一下 V$ 和 V_$开头的这些数据对象的关系。 通常来说他们的关系是这样的V$开头的一般来说是同义词,他们通常指向同名的V_$视图,或者指向同名的V$ fixed view。比如 这是上图的前三层。它们都只反映了单实例的一些信息,所以它们一般是从GV这种数据对象中根据instance id 截取出来的,也就是后面的4-6层。GV$开头的一般也是同义词,通常指向GV_$这样的视图或者指向同名的GV$ fixed view。这是4-6层。而第七层是最底层是X$ 开头的fixed table。 他们是最底层的,上面6层的信息一般是从这一层 阅读全文

posted @ 2013-04-09 12:45 kramer 阅读(348) 评论(0) 推荐(0) 编辑

2013年4月8日

cache buffers chains

摘要: cache buffers chains 看名字像是一个链表结构,但实际上它是一个latch。 要理解它,首先要理解下面的概念。hash buckethash chain listhash bucket和hash chain list是用来在data buffer里快速定位数据块的。oracle在访... 阅读全文

posted @ 2013-04-08 16:41 kramer 阅读(722) 评论(0) 推荐(0) 编辑

automount

摘要: Automoun is another kind of NFS. The different is that in NFS mode the client need to connect to NFS server all the time. This will consume server resources making the server slow. But in automount mode, client dont have to connect to server all the time. When you access the nfs resource, the automo 阅读全文

posted @ 2013-04-08 11:50 kramer 阅读(265) 评论(0) 推荐(0) 编辑

2013年4月2日

Never use absolute path when you create tar

摘要: In unix, especially Solaris, the tar file is dangerous if you create a tar file with absolute path.For example:We have an very important config files here, if you change the content may cause some problem1 bash-2.03$ ls -ltr /home/limingwei/config.txt2 -rw-r--r-- 1 limingwei mqm 3 Apr ... 阅读全文

posted @ 2013-04-02 14:59 kramer 阅读(258) 评论(0) 推荐(0) 编辑

2013年4月1日

Oracle RAC 10g – Cache Fusion(original link is under the title)

摘要: Oracle RAC 10g – CacheFusion8(http://avdeo.com/2008/07/21/oracle-rac-10g-cache-fusion/)Introduction:This post is about Oracle Cache Fusion technology, which is implemented in Oracle database 10g RAC. We are going to discuss just about cache fusion. You should have the architecture knowledge about RA 阅读全文

posted @ 2013-04-01 18:17 kramer 阅读(325) 评论(0) 推荐(0) 编辑

导航