ZT:简单介绍join,outer-join,semi-join,anti-join的区别
http://www.itpub.net/showthread.php?s=&postid=7357788#post7357788 表连接的方式如join,semi-join,outer-join,anti-join;表连接的实现方式如nested loop,merge,hash.本文简单的介绍表连接的方式join,semi-join,o...
ZT:字符长度与共享问题
http://tkyte.blogspot.com/2007/04/share-and-share-alike.htmlShare and Share alike...create table t ( x varchar2(2000) );declare a varchar2(1) := 'x'; b varchar2(100) := rpad(...
如何优化这个sql?
上个星期发现开发人员写的一条sql,语句如下:0。SELECT DISTINCT a.dept_code, a.dept_name, a.input_code FROM dept_dict a, pat_visit b WHERE a.dept_code = b.dept_admission_to ...
lZ:10gR2--EMCA常用命令说明:
http://vongates.itpub.net/post/2553/271778在10g 中,我们可能会经常遇到OEM不能正常使用的问题,但导致问题的原因不尽相同,最后绝大多数问题可以通过emca 这个命令来解决,详细的说明可以查看连机帮助,下面给出一些...
使用rownum减少函数调用
摘自:oracle高效设计:1。建立测试表:create table t1( prc_chk_key number(9) not null, prod_key number(12) not null, cmpt_loc_key number(5) n...
PK ? compress ? impdp?
http://www.itpub.net/showthread.php?s=&postid=7168709#post7168709今天遇到一个impdp的问题。如果PK索引包含compress参数,会导致的是否无法导入。select * from v$version ;BANNER-----------------------------...
将表emp输出'10 clark king miller'
摘自:http://tkyte.blogspot.com/Suppose someone asks you:I need to take the results of a query and pivot a value. That is, I would like output from the EMP table to look like this: DEPTNO ENAMES------- ------------10 clark king miller20 adams ford ……can this be done in just SQL?With the addition of analytic functions in Oracle 8i Release 2 and the SYS_CONNECT_BY_PATH() function in Oracle 9i Release 1 – this became something we can in fact do rather easily in SQL. The approach we wi
将表emp输出'10 clark king miller'
摘自:http://tkyte.blogspot.com/Suppose someone asks you:I need to take the results of a query and pivot a value. That is, I would like output from the EMP table to look like this: DEPTNO ENAMES-----...
如何使用这个索引
今天看《oracle高效设计》中函数索引的内容,遇到一个简单的问题,如何使用这个索引:例子摘自《oracle高效设计》:create table project(project_ID number primary key,teamid number,job varchar2(100),status va...
关于索引组织表IOT
摘自oracle高效设计:create table t( a int, b int, c int, primary key (a,b))organization index;create index t_idx_c on t(c);set autotrace traceonly explainset autotrace traceonly explainselect a, b ...
toad?中文?us7assii?
最近作统计报表,使用toad发现一些问题,记录如下,toad的版本是7.6.0.11:select * from v$versionBANNER -------------------------------------------...
hc_orcl.dat
在oracle的database目录存在一个hc_orcl.dat文件,orcl应该表示oracle_sid.google发现如下链接:http://forums.oracle.com/forums/thread.jspa?threadID=309881HC stands for a health check monitoring. It contain...
FBI? MAX? INDEX FULL SCAN (MIN/MAX)?
这个是我在comp.database.oracle.server新闻组问的问题,自己一直不知道为什么?昨天看了人家的解答,记录下来。http://jonathanlewis.wordpress.com/2007/03/12/methods/这个地址好像国内无法访问。March 12, 2007M...
NULL与排序
oracle 中按照正常的升序排序,null是在后面的,通过加入以上语句NULLS first可以改变排序,使NULL在前面。测试例子:SELECT * FROM (SELECT NULL a FROM DUAL UNION ALL ...
64K?
oracle在建立本地管理的表空间的时候,存在两种模式系统管理模式以及统一尺寸模式,当使用统一尺寸模式时,存在一个64K的问题,测试如下(摘自oracle高效设计):1。建立表空间:CREATE TABLESPACE aaa DATAFILE ...
建立小写的表
今天一个开发人员问我,他自己用户模式下建立的表无法访问,报 ORA-00942: table or view does not exist 我自己看了一下,确实如此。 进入toad后,无意中发现他建立的表是使用小写,重新修改表名后正常。 ...
表的审计
1.修改参数audit_trail=true,alter system set audit_trail=true scopt=spfile2.启动oracle服务。3测试,建立表create table t1 ( x int );audit insert on t1 by access;insert into t1 values (111);4.查看sys.aud...
定制login.sql
根据Kyte写的login文件,修改一点符合自己的需要。发现在windows下调用vi不正常,可能是缺少vim的环境变量,修改一下定义:REM turn off the terminal output - make it so SQLPlus does notREM print out anything ...
sqlplus中arrayseize参数以及consistent gets
今天测试一下sqlplus中arrayseize参数以及consistent gets。1。建立测试例子:create table t as select * from all_objects ;2. 设置不同的arraysize大小N,从2,5,10,20,50,100,200,400,500,1000,2000,5000.测试需...
关于NULL
今天在优化sql语句的时候发现存在如下sql语句,像这样 select * from t where object_name='' ; 发现执行计划里面存在全表扫描,这个问题主要在与开发人员没有判断输入的条件。 自己写了一个测试例子,如下:1...