EXECUTE IMMEDIATE into的使用
Use "EXECUTE IMMEDIATE into" to analyze which tables being updated[@more@]DECLAREv_table_name varchar2(30);v_count number;v_rows number;v_sql_statement VARCHAR2(300);CURSOR c1 IS select table_name from dba_tab_columns where owner='Schema_owner' and column_name='CREATE_TIMESTAMP' order by 1;BEGINOPEN c1; -- open the cursor before fetchingLOOPFETCH c1 INTO v_table_name;EXIT WHEN c1%NOTFOUND;v_sql_statement := 'select count(*) from Schema_owner .' || v_table_name || ' where trunc(create_t
frequence gap
the frequence in choosing 5:select * from cai5 where num1<6 and num2<6 and num3<6 and num4<6 and num5<6 order by 1 desc[@more@]9301 gap : 29299 gap : 29297 gap : 159282 gap : 69276 gap : 129264 gap : 29262 gap : 169246 gap : 169230 gap : 79223 gap : 169207 gap : 179190 gap : 209170 gap : 69164 gap : 299135 gap : 19134 gap : 129122 gap : 89114 gap : 89106 gap : 69100 gap : 49096 gap : 19095 gap : 249071 gap : 29069 gap : 49065 gap : 109055 gap : 139042 gap : 69036 gap : 29034 gap :
ball falling out
1,9,11,13,14,16,18,19,21,22,23,24,25,27,28,29,33[@more@]select * from caihistory where num1 not in (2,3,4,5,6,7,8,10,12,15,17,20,26,30,31,32) and num2 not in (2,3,4,5,6,7,8,10,12,15,17,20,26,30,31,32) andnum3 not in (2,3,4,5,6,7,8,10,12,15,17,20,26,30,31,32) andnum4 not in (2,3,4,5,6,7,8,10,12,15,17,20,26,30,31,32) andnum5 not in (2,3,4,5,6,7,8,10,12,15,17,20,26,30,31,32) andnum6 not in (2,3,4,5,6,7,8,10,12,15,17,20,26,30,31,32) order by 1 descalmost every year, we have records not in above numb
statistics on double-color ball
some statistics on double-color ball[@more@]09年:16: NOT IN (1,2,3,4,5,6,7,8,9) 4个以10开始,4个以11开始2 link group: 4 (0个3 link)1 link group: 9 (2个3 link)none link: 311: NOT IN (10,11,12,13,14,15,16,17,18,19)2 link group: 8 (3个3 link)1 link group: 2 (0个3 link)none link: 115: NOT IN (20,21,22,23,24,25,26,27,28,29)2 link group: 2 (1个3 link)1 link group: 9 (2个3 link)none link: 4-------------------------------------------08年:19: NOT IN (1,2,3,4,5,6,7,8,9) 8个以10开始2 link group: 6 (2个3 l
double-color ball
公式:从m个中选n,可能情况为:m*(m-1)*(m-2)*……*(m-n+1)/[n*(n-1)*(n-2)……*3*2*1]比如十选七就是10*9*8*7*6*5*4/(7*6*5*4*3*2*1)=120种。比如十选5就是10*9*8*7*6/(5*4*3*2*1)=252种。双色球: 热号: 5,20,30,32,1,3,7,8,17,14 冷号: 29,22,24,15,9lottery tools we can refer to: http://tool.starlott.com/dantuo/22x5.html [@more@]心水: 4,5,6,7,8,10,17,20,26,30,32 -- 11个号,在925期中,出现5次.select * from caihistory where num1 in (4,5,6,7,8,10,17,20,26,30,32) and num2 in (4,5,6,7,8,10,17,20,26,30,32) andnum3 in
家乡衡阳...
知道家乡衡阳简称雁城, 原来是出自范仲淹, 突然很想家乡了,很想念家乡的亲人.范仲淹词《渔家傲·塞下秋来风景异》赏析塞下秋来风景异,衡阳雁去无留意。四面边声连角起。千嶂里,长烟落日孤城闭。浊酒一杯家万里,燕然未勒归无计。羌管悠悠霜满地。人不寐,将军白发征夫泪![@more@] 范仲淹的《渔家傲》变低沉婉转之调而为慷慨雄放之声,把有关国家、社会的重大问题反映到词里,可谓大手笔。 范仲淹守边时,作《渔家傲》歌数阕,皆以“塞下秋来”为首句,颇述边镇之劳苦,欧阳修尝称为“穷塞主”之词云云。现仅存一首。 起句“塞
read consistent process
the process for oracle read data block [@more@]■ User 1 updates a record in block 777 (user1 has not committed).■ User 2 queries the same block and sees that the lock byte is set for a row being queried.■ User 2 goes to the ITL portion of the block and get the XID (transaction ID).■ The XID maps to the UNDO block, which holds the information before the update was done.■ A clone of the block is done (call it block 778).■ The UNDO information is applied to the block, rolling it forward, but
Bash 实例
http://www.ibm.com/developerworks/cn/linux/shell/bash/bash-2/index.html在 介绍性文章 中的样本程序中,我们使用环境变量 "$1" 来引用第一个命令行自变量。类似地,可以使用 "$2"、"$3" 等来引用传递给脚本的第二和第三个自变量。这里有一个例子: #!/usr/bin/env bash echo name of script is $0 echo first argument is $1 echo second argument is $2 echo seventeenth argument is $17 echo number of arguments is $# 除以下两个细节之外,此例无需说明。第一,"$0" 将扩
awk 实例
第一个 Awk您应该会看到 /ect/passwd 文件中的内容,本文使用该文件来解释 awk 的工作原理。当调用 awk 时,我们指定 /etc/passwd 作为输入文件。Awk 在执行期间对 /etc/passwd 文件中的每一行依次执行 print 命令。所有输出都发送到 stdout,可以得到类似 cat 命令的结果。现在解释代码块 { print }。在 Awk 中,花括号用于将代码分块,这与 C 语言类似。我们的代码块中只有一条 print 命令。在 Awk 中,当 print 命令单独出现时,将打印当前行的全部内容。 $ awk '{ print $0 }' /etc/passwd 在 Awk 中,变量 $0 表示整个当前行,因此
tr命令“字符”处理
tr是Unix系统非常实用的工具,其实用tr做到的事情,几乎都可用sed做到,你可以把tr当作是实现sed许多基本功能的sed“简体”。我认为tr是简单的“字符”处理工具,而sed是功能非常强大的“字符串”处理工具。【注意】tr是单个字符处理工具,而不是字符串处理工具!我自己用过比较实用的例子如下:1、将文件file中出现的"abc"替换为"xyz"# cat file | tr "abc" "xyz" > new_file【注意】这里,凡是在file中出现的"a"字母,都替换成"x"字母,"b"字母替换为"y
sed 命令
C.1. Sed对于sed工具包的所有操作来说, 我们最关心的其实就是3个最主要的操作. 分别是printing(打印到stdout), deletion(删除), 和substitution(替换). Sed是非交互式的行编辑器. 它即可以从stdin中接收文本输入, 也可以从文件中接收文本输入, 它对输入中的指定行进行特定的操作, 一行操作一次, 然后将结果输出到stdout, 或输出到文件中. 在shell脚本中使用的话, sed通常都是作为管道工具链中的一个处理部分来使用. Sed会决定它需要处理那些行, 因为sed的参数就包含有地址范围. [1] 既可以通过行号来指定地址范围, 也可以通过模式匹配来决
数据仓库设计(转)
数据仓库设计(转贴)[@more@]数据仓库设计(转贴) 数据仓库设计指南在一般的数据仓库应用系统中,根据系统体系结构的不同,数据仓库设计的内容和范围不尽相同,并且设计方法也不尽相同,下面的两幅图示分别表示带有ODS的数据仓库应用系统体系结构和不带ODS的数据仓库应用系统体系结构。本文将说明两个体系结构上的差异以及这种差异造成的设计方法的不同,并且重点介绍带有ODS的体系结构中数据仓库的设计方法。在数据仓库的设计指导思想中,数据仓库的概念定义是非常重要的,数据仓库概念规定了数据仓库所具有的几个基本特性,这些特性也正是
ORA-01114: IO error writing block to file (block #)
Following error arose, check data tablespace, there's sufficent free space. There's high probability that this error is due to database unix box disk space. We know the nature of oracle temp tablespace that when space added to temp space it does not allocate physical space, take only when required . The temp mount point is of 15Gb and the tempfile created is of 40GB, So as 15GB size usage reached it throws an error of No space left on device . I guess if the temp space is small, oracle will tr
Isolation level: ORA-08177 can't serialize access for this transaction
Mulit processes are using one procedure, this error arose. Oracle gives the explanation as below:ORA-08177 can't serialize access for this transactionCause: Encountered data changed by an operation that occurred after the start of this serializable transaction.Action: In read/write transactions, retry the intended operation or transaction.[@more@]这个错误是由于设置了事物隔离级别为serializable. 在procedure开始设置为READ COMMITTED也还是出现该错误:EXECUTE IMMEDIATE 'SET TRANSACTION ISOLATION LEVEL
awk, sed 正则表达式
文章出处:http://www.diybl.com/course/3_program/shell/shelljs/200862/119962.html几个实例$ awk '/^(no|so)/' test-----打印所有以模式no或so开头的行。$ awk '/^[ns]/{print $1}' test-----如果记录以n或s开头,就打印这个记录。$ awk '$1 ~/[0-9][0-9]$/(print $1}' test-----如果第一个域以两个数字结束就打印这个记录。$ awk '$1 == 100 || $2 < 50' test-----如果第一个域等于100或者第二个域小于50,则打印该行。for example, contents of test as below:20 jiangxs hello20 30 jiangxs jiangzythe command shows the second
正则表达式简介
http://net.pku.edu.cn/~yhf/tutorial/tao_regexps_zh.html[@more@]么是正则表达式一个正则表达式,就是用某种模式去匹配一类字符串的一个公式。很多人因为它们看上去比较古怪而且复杂所以不敢去使用——很不幸,这篇文章也不能够改变这一点,不过,经过一点点练习之后我就开始觉得这些复杂的表达式其实写起来还是相当简单的,而且,一旦你弄懂它们,你就能把数小时辛苦而且易错的文本处理工作压缩在几分钟(甚至几秒钟)内完成。正则表达式被各种文本编辑软件、类库(例如Rogue Wave的tools.h++)、脚本工具(像awk/grep/sed)广泛的支持
grep 正则表达式
http://blog.rednet.cn/user1/213546/archives/2007/35795.html[@more@]以下为整理的grep 正则表达式的大部分功能,详细参见man grep:要用好grep这个工具,其实就是要写好正则表达式,所以这里不对grep的所有功能进行实例讲解,只列几个例子,讲解一个正则表达式的写法。$ ls -l | grep '^a' 通过管道过滤ls -l输出的内容,只显示以a开头的行。$ grep 'test' d* 显示所有以d开头的文件中包含test的行。$ grep 'test' aa bb cc 显示在aa,bb,cc文件中匹配test的行。$ grep '[a-z]{5}' aa 显示所有包含每个字符串至少有5个连续小写字符的字符
Solaris性能检测(prstat)
prstat:系统进程监控下面将深入探讨 Solaris 工具 prstat(1),帮助了解系统效用的全面实用工具。prstat – 全面的实用工具Solaris 中最重要、使用最广的实用工具是 prstat(参见 prstat(1))。prstat 可以快速回答以下问题: *系统占用了多少 CPU 和内存? *系统效用了哪些进程(或用户、 zone 、项目、任务)? *系统怎样使用进程/线程(用户绑定,I/O 绑定)?在最简单的形式中,prstat <interval>(即 prstat 2)将检测所有进程并根据 CPU 使用率报告数据。进程的顺序根据当前的 CPU 使用率从高(最多)到低(最少)排
vmstat的应用详解
vmstat的应用详解 http://www.chinaunix.net/jh/6/882302.html[@more@]Virtual Memory Statistics ( vmstat ) vmstat 是报告关于进程,虚拟内存,磁盘,CPU活动的一个统计报告. 在一个多CPU系统中,vmstat统计所有个数的CPU的平均输出.为每个进程进行统计.没有参数时,vmstat显示每一行是自从系统启动以后的虚拟内存的活动情况.(注:vmstat输出的第一行对于实施统计没有意义) 用法: 基本的用法是vmstat <options> interval count option: 指定我们所需要的输出选项比如: paging -p , cache -c ,.interrupt -i 等等(还有一个比较有用的是S)
Solaris 命令大全
From: http://bbs2.chinaunix.net/thread-1448707-1-1.html[@more@]Solaris 命令大全终端控制 ctrl+s :终止屏幕输出,如用cat命令输出时,要停一下 ctrl+q :恢复ctrl+q的输出ctrl+c :中断当前的活动,返回命令提示符 ctrl+d :表示文件的结束或退出,如退出终端窗口 ctrl+u :擦除整个命令行 ctrl+w :擦除命令行最后一个单词 ctrl+h :擦除命令行最后一个字符 bc :计算器 #ksh 切换到k shell 命令: .................................................................# uname SunOS NAME #man uname uname - print name of curr