oracle 10g里,Merge语句的重大改进 zt
发表人:www.wwf.co | 发表时间: 2007年七月23日, 10:101, 能嵌入delete语句2, update, insert语句能嵌入where clause3, update语句与insert语句,不必同时出现,是可选的(optional)http://www.oracle-base.com/articles/10g/MergeEnhancements10g.phpMERGE Statement Enhancements in Oracle Database 10gOracle 10g includes a number of amendments to the MERGE statement making it more flexible.Test Table Optional Clauses Conditional Operations DELETE Clause Test TableThe following examples use the table defined belo
insert append需要注意的问题
zt[@more@] 1. append方式添加记录对insert into ... values语句不起作用。2. 以append方式批量插入的记录,其存储位置在hwm 之上,即使hwm之下存在空闲块也不能使用。3. 以append方式插入记录后,要执行commit,才能对表进行查询。否则会出现错误:ORA-12838: 无法在并行模式下修改之后读/修改对象4. 在归档模式下,要把表设置为nologging,然后以append方式批量添加记录,才会显著减少redo数量。在非归档模式下,不必设置表的nologging属性,即可减少redo数量。如果表上有索引,则append方式批量添加记录,不会减少索引上产生的redo数量
DBMS_STATS分析表
ZT[@more@] 作用:DBMS_STATS.GATHER_TABLE_STATS统计表,列,索引的统计信息.DBMS_STATS.GATHER_TABLE_STATS的语法如下:DBMS_STATS.GATHER_TABLE_STATS (ownname VARCHAR2, tabname VARCHAR2, partname VARCHAR2, estimate_percent NUMBER, block_sample BOOLEAN, method_opt VARCHAR2, degree NUMBER, granularity VARCHAR2, cascade BOOLEAN, stattab VARCHAR2, statid VARCHAR2, statown VARCHAR2, no_invalidate BOOLEAN, force BOOLEAN);参数说明:ownname:要分析表的拥有者tabname:要分析的表名.partname:分区的名字,只对分区
详细解读 STATSPACK 报告
ZT[@more@] 说在前面,很容易被忽略的几个点:在读报告的时候,我们首先需要看清楚,留意3个内容,这份报告所对应的数据库版本,cluster方式,以及报告的时间段。尤其需要注意的就是时间段,脱离了时间段的statspck将是毫无意义的,甚至会得出错误的结果。STATSPACK report for1、报表头信息/* 报表头信息,数据库实例相关信息,包括数据库名称、ID、版本号及主机明等信息。 另外,重点还需要关注一下报告产生的时间跨度(在这里是14分钟),以及并发数(在这里是272)。DB Name DB Id Instance Inst Num Release
How To Determine The Amount of Space Used by an IOT
This article explains how to calculate the space used by an IOT (Index Organized Table).How To Determine the Space Allocated to an IOT----------------------------------------------A. In general, to get the amount of space allocated or consumed by any segment (table, index, etc.), you query the DBA_SEGMENTS or DBA_EXTENTS view, specifying the segment_name as the name of the object.Example:To know the amount of space used by the table SCOTT.EMP: SQL> select segment_name, segment_type, bytes, bl
一个很好的脚本,用来显示cbo的统计信息
发表人:www.wwf.co | 发表时间: 2007年一月09日, 19:38Select to show Optimizer Statistics for CBO,Note:31412.1Instructions Execution Environment: SQL*Plus Access Privileges: Requires select privileges on dba_tables, dba_tab_columns, dba_indexes, dba_ind_columns Usage: sqlplus <user>/<pw> @[SCRIPTFILE] Instructions: The script will ask for Table Name and Owner to show Statistics for. The default Owner is the current user. PROOFREAD THIS
Index online operation的过程 zt
在create index online, alter index rebuild online时,oracle是怎么工作的?http://www.oracle.com/technology/deploy/availability/htdocs/online_ops.htmlOnline Index OperationsOracle provides the capability to perform online index creation. During an online index create operation, concurrent queries and updates are allowed on the base table. During an online index creation operation, changes are recorded in a temporary journal table. At the end of index creation, the journal is merged into the new in
nologging与append zt
最近,因为常常需要对大表进行操作,所以,对于nologging的需要也更加多了,系统地看了一些关于nologging的文章,如下是tom给出的一个nologging与append对应表Table Mode Insert Mode ArchiveLog mode result----------- ------------- ----------------- ----------LOGGING APPEND ARCHIVE LOG redo generatedNOLOGGING APPEND ARCHIVE LOG no redoLOGGING no append "" redo generatedNOLOGGING no append "" redo generatedLOGGING APPEND noarchive log mode no redoNOLOGGING APPEND noarchive log mode no redo
使用Oracle Hint提示来更改执行计划 ZT
=========================================================== 作者: tolywang(http://tolywang.itpub.net)发表于:2007.11.26 15:30分类: Oracle数据库管理 出处:http://tolywang.itpub.net/post/48/418116--------------------------------------------------------------- [@more@]由于每一版本的优化器都变得更为完善,Oracle 为更改您的 SQL 执行计划提供了不断增多的方法。Oracle 提示的最常见用处是作为调试工具。您可以使用提示来确定最优的执行计划,然后向回执行,调节统计量,使调整后的 SQL 模拟所提示的查询。 使用 Oracle
单条SQL语句实现复杂逻辑几例~~
1、按指定规则生成指定商品2002年销售额,其中彩电项值为2001年的销售额加2000年的销售额,微波炉为2000年销售额, 然后汇总彩电+微波炉的2002年总销售额。2、查询字段a的值连续三条以上相同的记录3、查询员工ID:1000的实际工作月数,注意过滤兼职月份4、将列值为0的列替换为距离它最近列的非0值5、行列转换,将列中字符串以'/'分隔,转换成行[@more@]1、按指定规则生成指定商品2002年销售额,其中彩电项值为2001年的销售额加2000年的销售额,微波炉为2000年销售额, 然后汇总彩电+微波炉的2002年总销售额。表数据如下:CITY PRODUCT YEAR
一个树形聚集SQL问题(二) (物料BOM消耗量计算) zt
一个树形聚集SQL问题(二) (物料BOM消耗量计算) =========================================================== 作者: yangtingkun(http://yangtingkun.itpub.net)发表于: 2008.07.15 23:27分类: ORACLE 出处: http://yangtingkun.itpub.net/post/468/466633--------------------------------------------------------------- [@more@]看到ITPUB上一个帖子,感觉楼主的需要比较有意思,于是尝试了一下。问题源自:http://www.itpub.net/thread-1020586-1-1.html上一篇给出了一个SQL实现,不过由于不是很清楚楼主的含义,加上测试数据过于
一个树形聚集SQL问题(物料BOM消耗计算) zt
一个树形聚集SQL问题(物料BOM消耗计算)=========================================================== 作者: yangtingkun(http://yangtingkun.itpub.net)发表于: 2008.07.13 10:18分类: ORACLE 出处: http://yangtingkun.itpub.net/post/468/466388--------------------------------------------------------------- [@more@]看到ITPUB上一个帖子,感觉楼主的需要比较有意思,于是尝试了一下。问题源自:http://www.itpub.net/thread-1020586-1-1.html简单的说,这个问题就是要实现从根节点到每个叶节点的树形记录实现连乘。解决这个问题只
[★] DataGridView 实际项目当中需要注意的问题 zt
DatagridView :[@more@]一 :将数据绑定到 DataGridView 控件非常简单和直观,在大多数情况下,只需设置 DataSource 属性即可。在绑定到包含多个列表或表的数据源时,只需将 DataMember 属性设置为指定要绑定的列表或表的字符串即可。二:数据源的定义任何实现 IList 接口的类,包括一维数组。任何实现 IListSource 接口的类,例如 DataTable 和 DataSet 类。任何实现 IBindingList 接口的类,例如 BindingList 类。任何实现 IBindingListView 接口的类,例如 BindingSource 类。三:BindingSource 组件: 取代 DataSet 和 DataView 是喜还是优
[★] VS2005[C#] 操作 Excel 全攻略 ZT
[★] VS2005[C#] 操作 Excel 全攻略[@more@]using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using Microsoft.Office.Interop.Excel;using System.Data.SqlClient;using System.Data.OleDb;using System.Reflection;namespace ExcelPrj{ /// <summary> /// Excel 系统中的主文件Excel.exe 本身就是 COM 组件,通过在.NET 项目中引用Exel.exe 文件可以实现对Excel 的功能控制 /// 与COM 组件相互操作是通
VS2005(c#)项目调试问题解决方案集锦 ZT
上一次整了个VS2003的,结果反应甚好,当然能帮助大家在程序调试过程中提高效率不失是一件快乐的事,这次也是根据一个项目开发过程中所碰到的种种问题,俺把他记下来了,同时在网站搜集了一些问题及解决方法,一来做个记录好让自己以后可以有章可查,二来发出来给大家分享.分享技术,分享快乐,一直是俺们网站电子期刊的宗旨.希望大家喜欢:) 废话少说:我们要给大家有用的东西才行,希望以下这些东东,能给大家带来帮助.谢谢:) 如果您认为这篇文章对您有用,欢迎您转载,请您注明来自"德仔工作室",俺们是不会去索要专利费的,你放心.[@more@]
代码中使用DataView对象----创建DataView对象
动态生成dataview,对dataset起过滤和排序作用[@more@]创建DataView对象DataTable tbl=new DataTable("table1");DataView dv;dv=new DataView();dv.Table=tbl;dv=new DataView(tbl);//-----------------------------------------------------------------------DataView还有一个构造函数DataTable tbl=new DataTable("Customers");DataViewRowState dvrs;dvrs=DataViewRowState.ModifiedOriginal Or DataViewRowState.Deleted;DataView dv;dv=new DataView();dv.Table=tbl;dv.RowFilter="Country= 'USA' ";
DataGridView新特色(vs2005beta1)
DataGridView常用属性、方法[@more@]1、自定义列 Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance Host Controls in Windows Forms DataGridView Cells 继承 DataGridViewTextBoxCell 类生成新的Cell类,然后再继承 DataGridViewColumn 生成新的Column类,并指定 CellTemplate为新的Cell类。新生成的Column便可以增加到DataGridView中去。2、自动适应列宽 Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control
ASP.NET程序中常用的三十三种代码 (转)
ASP.NET程序中常用的三十三种代码 (转)[@more@]1. 打开新的窗口并传送参数: 传送参数:response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") 接收参数:string a = Request.QueryString("id");string b = Request.QueryString("id1"); 2.为按钮添加对话框Button1.Attributes.Add("onclick","return confirm(’确认?’)");button.attributes.add("onclick","if(conf
IIS连接ORACLE的一个问题
ZT[@more@]今天在连接ORACLE9I的时候遇到一个问题:Microsoft OLE DB Provider for ODBC Drivers (0×80004005) Specified driver could not be loaded due to system error 5 (Oracle in OraHome92).使用oracle client software连接测试数据库工作正常,但是IIS总是不能连接数据库,网上google了一把,可能的原因有:1.权限问题,IUSER_ or Everyone给与READ&EXEC权限。2.MDAC版本问题。折腾了半天1是不行的,2 我的操作系统是XP+SP2本省就是MDAC2.8SP1最新版本,MDAC根本就不让安装,郁闷。不甘心,再找,发现下面的文章,最终解决问题
Scott Mitchell的ASP.NET2.0数据指南中文版索引
http://lovecherry.cnblogs.com/archive/2006/07/02/440840.html[@more@]