又一个字符串拆分方法
有一个字符串拆分的方法[@more@]/* Formatted on 2011/07/12 13:56 (Formatter Plus v4.8.8) */SELECT SUBSTR ('af,b,cfr,bc', idx1, idx2 - idx1)FROM (SELECT NVL (LAG (idx) OVER (ORDER BY ROWNUM) + 1, 1) idx1, idx idx2FROM (SELECT DISTINCT idxFROM (SELECT DECODE (INSTR ('af,b,cfr,bc',',',ROWNUM),0, LENGTH ('af,b,cfr,bc') + 1,INSTR ('af,b,cfr,bc',',',ROWNUM)) idxFROM DUALCONNECT BY ROWNUM <= LENGTH ('af,b,cfr,bc'))))
详解分区表上的索引问题
今天在做分区切割后查询时,发现索引失效!看到一篇好的文章!共享学习一下![@more@]详解分区表上的索引问题 QUESTION:分区表在管理上的确非常方便,在性能方面的表现也不错。但是就是有一点不是很理想:删除分区和TRUNCATE分区表中数据,会造成主键和全局索引的失效。如果数据表非常大,索引的重建也是需要花很长时间的。针对这个问题,有没有合适的解决办法呢?完整的方案:最后再整理一下,请大家给指正指正 1. 分区表的用途和优势:a 、增强可用性:如果表的一个分区由于系统故障而不能使用,表的其余好的分区仍然可以使用; b 、减少关闭
oracle数据库相关数据的查询
oracle数据库中的表空间和数据对象的大小查询![@more@]--各个表空间Select m.tablespace_name ,Sum(m.bytes)/1024/1024 From Dba_Segments m where m.tablespace_name in('CUSLOGIDX','CUSLOG')Group By m.Tablespace_Name--各个数据对象的大小select t.segment_name,t.partition_name,t.segment_type,t.tablespace_name,bytes/(1024*1024) as "size(M)" from user_segments t--where t.segment_name='G_CUSTOMER_LOG'where t.segment_type in ('TABLE','TABLE PARTITION')order by t.segment_type,bytes/(1024*1024)select
16进制排序,找出连续区间解法!
区间连续性MAC区间的连续区间解法![@more@]select b.work_order, min (b.macid) Start_macid, max (b.macid) End_macidfrom (select a.work_order,a.macid, to_char (to_number(a.macid,'xxxxxxxxxxxxxxxxxxxxxx')- rownum) ccfrom (select t.work_order,t.macid,t.serial_numberfrom sajet.g_sn_status twhere t.work_order='20100900663'and t.macid is not nulland t.macid<>'N/A'order by t.work_order, t.macid) a) bgroup by b.work_order, b.ccorder by b.work_order, b.cc
Oracle的Decode函数进行多值判断
转Decode函数的用法[@more@]Decode函数的语法结构如下:decode (expression, search_1, result_1) decode (expression, search_1, result_1, search_2, result_2) decode (expression, search_1, result_1, search_2, result_2, ...., search_n, result_n) decode (expression, search_1, result_1, default) decode (expression, search_1, result_1, search_2, result_2, default) decode (expression, search_1, result_1, search_2, result_2, ...., search_n, result_n, default) decode函数比较表达式和搜索字,如果匹配,返
查询表空间空闲空间大小
查询表空间空闲空间语句[@more@]select tablespace_name,sum(bytes)/1024/1024 free_Mbytesfrom dba_free_spacegroup by tablespace_nameorder by free_Mbytes
去掉表中空格
代码:[@more@]update QA set MAC=replace(replace(MAC, ' '), '?') WHERE MAC!=replace(replace(MAC, ' '), '?')