随笔分类 -  Oracle

oracle 调试中使用到的存储过程
摘要:create or replace procedure put_line_unlimit( p_string in varchar2 ) is l_string long default p_string; begin loop exit when l_string is null; dbms_output.put_line( substr( l_string, 1... 阅读全文
posted @ 2009-03-11 10:40 Oracle 阅读(224) 评论(0) 推荐(0)
autotrace
摘要:安装 用sys用户运行脚本ultxplan.sql 建立这个表的脚本是:(UNIX:$ORACLE_HOME/rdbms/admin, Windows:%ORACLE_HOME%"rdbms"admin)ultxplan.sql。 SQL> connect sys/sys@colm2 as sysdba; SQL> @C:"oracle"ora92"rdbms"admin"utlxplan.sql... 阅读全文
posted @ 2009-03-10 17:37 Oracle 阅读(314) 评论(0) 推荐(0)
ORACLE 8i中实现SYS_CONNECT_BY_PATH函数
摘要:create or replace package hierarchy is type strtabletype is table of varchar2(4000) index by binary_integer; strtable strtabletype; type numtabletype is table of number index by binary_integer; ... 阅读全文
posted @ 2009-03-01 21:27 Oracle 阅读(866) 评论(0) 推荐(0)
ORACLE中translate的妙用
摘要:下面是文档中的话 The following statement translates a license number. All letters 'ABC...Z' are translated to 'X' and all digits '012 . . . 9' are translated to '9': SELECT TRANSLATE('2KRW229', '01234567... 阅读全文
posted @ 2009-03-01 19:26 Oracle 阅读(6907) 评论(1) 推荐(0)
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 阅读(345) 评论(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 阅读(3979) 评论(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)
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)
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 阅读(19754) 评论(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 阅读(1494) 评论(1) 推荐(0)