02 2009 档案
ORA-01002
摘要:ORA-01002: fetch out of sequence Cause: This error means that a fetch has been attempted from a cursor which is no longer valid. Note that a PL/SQL cursor loop implicitly does fetches, and thus may a... 阅读全文
posted @ 2009-02-26 15:10 Oracle 阅读(1564) 评论(0) 推荐(0)
Oracle 行列转换
摘要:1、固定列数的行列转换 如 student subject grade --------- ---------- -------- student1 语文 80 student1 数学 70 student1 英语 60 student2 语文 90 student2 数学 80 student2 英语 100 …… 转换为 语文 数学 英语 student1 80 70 60 student2 ... 阅读全文
posted @ 2009-02-25 16:59 Oracle 阅读(29215) 评论(1) 推荐(2)
Oracle 嵌套表二
摘要:最近把oracle嵌套表的其他功能仔细看了看并做了个简单整理。 oracle提供两种使用嵌套表的方法: 1. PL/SQL代码中作为扩展PL/SQL语言;(这部分内容就是上边所说oracle内存表是oracle嵌套表的部分功能) 2. 作为物理存储机制,以持久地存储集合。 */ --创建测试表: CREATE TABLE dept (deptno NUMBER(2) PRIMARY... 阅读全文
posted @ 2009-02-25 13:43 Oracle 阅读(758) 评论(0) 推荐(0)
Oracle 嵌套表
摘要:CREATE type addrs_type IS TABLE OF varchar2(128); create table employye ( eoid number(4),mailaddr addrs_type) nested table mailaddr store as addr_table ; insert into employye values(123,addrs_typ... 阅读全文
posted @ 2009-02-25 12:24 Oracle 阅读(344) 评论(0) 推荐(0)
Oracle collections
摘要:一、Types of Collections 1、Associative arrays 数组 它是同种类型的一维、无边界的稀疏集合,只能用于 PL/SQL。 DECLARE TYPE t_name IS TABLE OF varchar2(10) INDEX BY PLS_INTEGER; --创建 Collection i_name ... 阅读全文
posted @ 2009-02-25 11:35 Oracle 阅读(3978) 评论(0) 推荐(0)
ORACLE 8i中的JOIN
摘要:create table test1(a int,b int); create table test2(a int,b int); insert into test1 values(1,456); insert into test1 values(2,427); insert into... 阅读全文
posted @ 2009-02-22 21:52 Oracle 阅读(282) 评论(0) 推荐(0)
ORACLE PL/SQL中的CASE
摘要:1.declare x number := 60; begin case x when 10 then dbms_output.put_line('x=10'); when 20 then dbms_output.put_line('x=20'); when 30 then dbms_output.put_line('x=30')... 阅读全文
posted @ 2009-02-19 14:31 Oracle 阅读(541) 评论(0) 推荐(0)
Oracle PL/SQL中的IF
摘要:declare x number := 20; begin if x = 10 then dbms_output.put_line('x = 10'); elsif x = 20 then dbms_output.put_line('x = 20'); else dbms_output.put_line('no data'); end if; end; 阅读全文
posted @ 2009-02-19 14:24 Oracle 阅读(314) 评论(0) 推荐(0)
ora-01722
摘要:ORA-1722 is Invalid number. We've attempted to either explicity or implicity convert a character string to a number and it is failing. This can happen for a number of reasons. It generally happens... 阅读全文
posted @ 2009-02-16 09:21 Oracle 阅读(1602) 评论(0) 推荐(0)
短语 as yet
摘要:as yet 1. 到目前为止,迄今为止,到这时为止(还没有,还不是);到当时为止;至今还[见 yet] 2. 直到现在,到目前(或当时)为止 Nothing that stood in your way before stands there now in the same way.It's all new,even if you can't as yet s... 阅读全文
posted @ 2009-02-15 20:04 Oracle 阅读(358) 评论(0) 推荐(0)
buffer cache深度分析:概念以及内存结构
摘要:本文首先详细介绍了oracle中buffer cache的概念以及所包含的内存结构。然后结合各个后台进程(包括DBWRn、CKPT、LGWR等)深入介绍了oracle对于buffer cache的管理机制,并详细解释了oracle为什么会采用现在的管理机制,是为了解决什么问题。比如为何会引入touch次数、为何会引入增量检查点等等。最后全面介绍了有关buffer cache监控以及调优的实用方法。... 阅读全文
posted @ 2009-02-14 22:01 Oracle 阅读(1015) 评论(0) 推荐(0)
Oracle's Memory Architecture
摘要: 阅读全文
posted @ 2009-02-14 21:13 Oracle 阅读(125) 评论(0) 推荐(0)
查看应用中运行时间长的SQL
摘要:select username,sid,opname, round(sofar*100 / totalwork,0) || '%' as progress, time_remaining,sql_text from v$session_longops , v$sql where time_remaining 0 and sql_address = address... 阅读全文
posted @ 2009-02-14 18:13 Oracle 阅读(1290) 评论(0) 推荐(0)
英语口语常用短语
摘要:quit it! 别闹! Don't mention it. 没关系,别客气。 Who knows! 天晓得! It is not a big deal! 没什么了不起! How come… 怎么回事,怎么搞的。 Don't push me. 别逼我。 Come on! 快点,振作起来!(come on的含义很多,主要体现在语气上,使用时请注意语气) Have a good of it.玩的很高兴... 阅读全文
posted @ 2009-02-14 11:11 Oracle 阅读(2340) 评论(0) 推荐(0)
oracle 正则表达式续
摘要:General Information Anchoring Charac... 阅读全文
posted @ 2009-02-12 23:34 Oracle 阅读(602) 评论(0) 推荐(0)
Oracle 正则表达式
摘要:就是由普通字符(例如字符a到z)以及特殊字符(称为元字符)组成的文字模式。该模式描述在查找文字主体时待匹配的一个或多个字符串。正则表达式作为一个模板,将某个字符模式与所搜索的字符串进行匹配。 本文详细地列出了能在正则表达式中使用,以匹配文本的各种字符。当你需要解释一个现有的正则表达式时,可以作为一个快捷的参考。更多详细内容,请参考:Francois Liger,Craig McQueen,Pal ... 阅读全文
posted @ 2009-02-12 23:25 Oracle 阅读(19752) 评论(1) 推荐(8)
幾種重要的SCN
摘要:1.Commit SCN 當用戶提交commit命令后,系統將當前的SCN賦給該Transaction,這些信息都反映在redo buffer中,并馬上更新到redo log文件里 2.Offline SCN 除了System tablespace以外的任何表空间,当我们执行SQL>alter tablespace … offline normal命令时,就会触发一个check... 阅读全文
posted @ 2009-02-11 10:43 Oracle 阅读(447) 评论(0) 推荐(0)
ORA-01045
摘要:user lacks create session privilege 解决办法:grant create session to username; 阅读全文
posted @ 2009-02-10 23:06 Oracle 阅读(1493) 评论(1) 推荐(0)
ORACLE 权限问题
摘要:问题: 在数据库用有一用户 A(方案A),A有数据表 t_1,t_2, 视图 v_1,v2, 我想再建一用户B,用户B只有对方案A中的视图v_1,v_2只有浏览的权限, 我的办法是这样的:重新建了一个用户,赋给UNDER ANY VIEW 这个权限,但无法访问A中的视图与数据表。 请教各位达人,如何去创建用户B,及设置他的权限! 也就是新增用户只能访问方案A中的视图,其它资源都不能访问 ... 阅读全文
posted @ 2009-02-10 23:05 Oracle 阅读(4515) 评论(0) 推荐(0)
SQLPLUS 中的COPY命令
摘要:用COPY命令的好處是SQLPLUS可以同時連接多個數據庫,而PL/SQL不行 COPY FROM HR@BOSTONDB TO TODD@CHICAGODB CREATE NEWDEPT (DEPARTMENT_ID, DEPARTMENT_NAME, CITY) USING SELECT * FROM EMP_DETAILS_VIEW 阅读全文
posted @ 2009-02-10 16:47 Oracle 阅读(219) 评论(0) 推荐(0)
IN條件下的綁定變量做法
摘要:create or replace type myTableType as table of number; Type created. create or replace function str2tbl( p_str in varchar2 ) return myTableType as l_str long default p_str || ','; ... 阅读全文
posted @ 2009-02-10 16:22 Oracle 阅读(381) 评论(0) 推荐(0)
how to separate index from data tablespace
摘要:because of the hotspot,sometime we need to separate the index from the data tablespace 1.create the new tablespace 2.alter index index_name rebuild tablespace tablespace_name 續: Oracle强烈建立,任何一个应用... 阅读全文
posted @ 2009-02-10 15:14 Oracle 阅读(290) 评论(0) 推荐(0)
ora-01658
摘要:錯誤原因是表空間大小不足 解決方法: 1.查詢各個表空間的利用率 select a.TABLESPACE_NAME, a.total,nvl(b.used,0) USED, nvl((b.used/a.total)*100,0) PCT_USED from (select TABLESPACE_NAME, sum(bytes)/(1024*1024) total from sys.dba_d... 阅读全文
posted @ 2009-02-10 15:10 Oracle 阅读(2932) 评论(0) 推荐(0)
oracle 10g 中FLASHBACK的增强
摘要:从ORACLE 9I开始,ORACLE 引入FLASHBACK QUERY特性,10g对这个性能加以增强 1. Flashback database 2. Flashback drop 3. Flashback versions QUERY 4. Flashback Transaction QUERY 5. Flashback Table 不过除了 Flashback databa... 阅读全文
posted @ 2009-02-08 23:31 Oracle 阅读(608) 评论(0) 推荐(0)
Oracle 10g的block change tracking 特性
摘要:Block chage tracking是Oracle10g的一个新特性,Block change tracking进程记录自从上一次备份以来数据块的变化,并把这些信息记录在跟踪文件中。RMAN使用这个文件判断增量备份中需要备份的变更数据。这极大的促进了备份性能,RMAN可以不再扫描整个文件以查找变更数据。 启用跟踪可以使用如下命令: ... 阅读全文
posted @ 2009-02-08 22:28 Oracle 阅读(483) 评论(0) 推荐(0)