waterye

          #

          Partitioned Tables

          Partitioned Tables

          -- ?Range?Partitioning?Example
          CREATE ? TABLE ?sales_range?
          (salesman_id??
          NUMBER ( 5 ),?
          salesman_name?
          VARCHAR2 ( 30 ),?
          sales_amount??
          NUMBER ( 10 ),?
          sales_date????DATE)
          PARTITION?
          BY ?RANGE(sales_date)?
          (
          PARTITION?sales_jan2006?
          VALUES ?LESS?THAN(TO_DATE( ' 02/01/2006 ' , ' MM/DD/YYYY ' )),
          PARTITION?sales_feb2006?
          VALUES ?LESS?THAN(TO_DATE( ' 03/01/2006 ' , ' MM/DD/YYYY ' )),
          PARTITION?sales_mar2006?
          VALUES ?LESS?THAN(TO_DATE( ' 04/01/2006 ' , ' MM/DD/YYYY ' )),
          PARTITION?sales_apr2006?
          VALUES ?LESS?THAN(TO_DATE( ' 05/01/2006 ' , ' MM/DD/YYYY ' )),
          PARTITION?sales_may2006?
          VALUES ?LESS?THAN(TO_DATE( ' 06/01/2006 ' , ' MM/DD/YYYY ' ))
          );


          insert ? into ?sales_range? values ( 12345 ,? ' test ' ,? 1000 ,?to_date( ' 2006-01-15 ' ,? ' yyyy-mm-dd ' ));
          insert ? into ?sales_range? values ( 12345 ,? ' test ' ,? 1000 ,?to_date( ' 2006-02-15 ' ,? ' yyyy-mm-dd ' ));
          insert ? into ?sales_range? values ( 12345 ,? ' test ' ,? 1000 ,?to_date( ' 2006-03-15 ' ,? ' yyyy-mm-dd ' ));
          insert ? into ?sales_range? values ( 12345 ,? ' test ' ,? 1000 ,?to_date( ' 2006-04-15 ' ,? ' yyyy-mm-dd ' ));
          insert ? into ?sales_range? values ( 12345 ,? ' test ' ,? 1000 ,?to_date( ' 2006-05-15 ' ,? ' yyyy-mm-dd ' ));

          create ? index ?idx_sales_range_sales_date? on ?sales_range?(sales_date);

          ALTER ? TABLE ?sales_range? DROP ?PARTITION?sales_jan2006? UPDATE ?GLOBAL?INDEXES;

          When to Partition a Table
          Here are some suggestions for when to partition a table:

          • Tables greater than 2GB should always be considered for partitioning.
          • Tables containing historical data, in which new data is added into the newest partition. A typical example is a historical table where only the current month's data is updatable and the other 11 months are read-only.

          參考:? ora92_doc/server.920/a96524/c12parti.htm

          詳細請參考oracle文檔

          posted @ 2006-05-12 16:37 waterye 閱讀(1090) | 評論 (1)編輯 收藏

          yahoo email, 3.5g

          yahoo的郵箱容量已經增加至3.5G, 好大啊. 不過還是喜歡gmail.

          posted @ 2006-05-10 22:43 waterye 閱讀(694) | 評論 (0)編輯 收藏

          Tobago, 看上去不錯

          The goal of Tobago is to provide the community with a well designed set of user interface components based on JSF and run on MyFaces.

          Introduction

          Demo

          posted @ 2006-05-02 08:54 waterye 閱讀(1118) | 評論 (1)編輯 收藏

          ec的oracle分頁

          http://extremecomponents.org/wiki/index.php/Simplified_Chinese_Tutorials_Limit

          上面的版本是mysql

          oracle的分頁實現, 在傳參數時增加limit.getRowStart()即可

          public?String?limitQuery(int?rowStart,?int?rowEnd,?String?query)?{
          ????????String?querySql?
          =?"select?*?from?(?"?+
          ????????????????
          "????select?my_table.*,?rownum??my_rownum?from?(?"?+
          ????????????????query?
          +
          ????????????????
          "????)?my_table?where?rownum?<=?"?+?rowEnd?+
          ????????????????
          ")?where?my_rownum?>?"?+?rowStart;
          ????????
          return?querySql;
          }

          posted @ 2006-04-30 15:30 waterye 閱讀(1284) | 評論 (1)編輯 收藏

          FlyakiteOSX, 讓xp變成mac

          Intel Mac能夠運行OS X和XP,還是有誘惑力的,但兩萬塊左右MacBook Pro對于普通老百姓來說太貴了.

          FlyakiteOSX, 讓我的xp變成mac os x, 爽

          mac

          desktop

          posted @ 2006-04-22 23:47 waterye 閱讀(1365) | 評論 (0)編輯 收藏

          idea create war file

          用idea創建war文件時(J2EE Build Settings|Create web module war file),老是將所有jar復制到WEB-INF/lib下,一直羨慕JBuilder的exclude, include功能。

          原來idea也有這個功能,在Web Module Settings |??Modules and Libraries to Package下,選擇Do not package即可。

          posted @ 2006-04-18 22:11 waterye 閱讀(1566) | 評論 (0)編輯 收藏

          Struts Plugin: Struts Assistant

          IDEA Struts Plugin: Struts Assistant

          1.?安裝: 在idea plugins下載并安裝
          2. 配置: 指定struts解壓包的路徑

          posted @ 2006-04-15 15:21 waterye 閱讀(1245) | 評論 (0)編輯 收藏

          hibernate的column級lazy

          1. Using lazy property fetching
          To enable lazy property loading, set the lazy attribute on your particular property mappings:
          <class?name="Document">
          ???????
          <id?name="id">
          ????????
          <generator?class="native"/>
          ????
          </id>
          ????
          <property?name="name"?not-null="true"?length="50"/>
          ????
          <property?name="summary"?not-null="true"?length="200"?lazy="true"/>
          ????
          <property?name="text"?not-null="true"?length="2000"?lazy="true"/>
          </class>

          Lazy property loading requires buildtime bytecode instrumentation! If your persistent classes are not enhanced, Hibernate will silently ignore lazy property settings and fall back to immediate fetching.

          For bytecode instrumentation, use the following Ant task:
          <target?name="instrument"?depends="compile">
          ????
          <taskdef?name="instrument"?classname="org.hibernate.tool.instrument.InstrumentTask">
          ????????
          <classpath?path="${jar.path}"/>
          ????????
          <classpath?path="${classes.dir}"/>
          ????????
          <classpath?refid="lib.class.path"/>
          ????
          </taskdef>

          ????
          <instrument?verbose="true">
          ????????
          <fileset?dir="${testclasses.dir}/org/hibernate/auction/model">
          ????????????
          <include?name="*.class"/>
          ????????
          </fileset>
          ????
          </instrument>
          </target>

          Please note that this is mostly a marketing feature, as in practice, optimizing row reads is much more important than optimization of column reads.

          debug麻煩, 并沒有測試

          2. use hql

          //?use?vo
          String?hql?=?"select?new?Foo(f.id,?f.name)?from?Foo?f";

          //?use?map?
          String?hql?=?"select?new?map(f.id,?f.name)?from?Foo?f";

          //?use?Object[]
          String?hql?=?"select?f.id,?f.name?from?Foo?f";

          //?use?list
          String?"select?new?list(f.id,?f.name)?from?Foo?f";
          不支持嵌套的對象, 不爽, 如
          String?hql?=?"select?new?Foo(f.id,?new?Bar(f.bar.id,?f.bar.name))?from?Foo?f";


          以上兩種方法在實際應用中都不是很理想, 但那種from Pojo的方式太浪費內存, 遇到blob字段更可怕, 有其他更好方法的請告知

          posted @ 2006-04-10 20:28 waterye 閱讀(2017) | 評論 (1)編輯 收藏

          剛換了電腦, 人腦又出問題了, 麻煩

          前幾個星期剛換電腦的主機, 但這幾天人腦又出問題(偏頭痛).

          電腦壞了可以再買, 人腦壞了, 麻煩.

          posted @ 2006-03-30 19:57 waterye 閱讀(717) | 評論 (2)編輯 收藏

          Grails 0.1 released

          Grails終于發布0.1版

          http://docs.codehaus.org/display/GRAILS/2006/03/29/Groovy+on+Rails+%28Grails%29+0.1+Released

          posted @ 2006-03-30 09:10 waterye 閱讀(723) | 評論 (2)編輯 收藏

          僅列出標題
          共18頁: First 上一頁 3 4 5 6 7 8 9 10 11 下一頁 Last 
          主站蜘蛛池模板: 龙川县| 葫芦岛市| 余庆县| 瓮安县| 通辽市| 内江市| 柘荣县| 禹城市| 乐业县| 山西省| 宜春市| 长白| 赣州市| 华池县| 藁城市| 马鞍山市| 衡阳县| 陇西县| 鹿泉市| 二连浩特市| 昌黎县| 长宁县| 全椒县| 大丰市| 宝应县| 青铜峡市| 乐业县| 岢岚县| 会泽县| 镇赉县| 平乡县| 江北区| 吉林市| 昌邑市| 陇南市| 玉龙| 玉山县| 佛山市| 民勤县| 河津市| 蒙阴县|