#
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文檔
yahoo的郵箱容量已經增加至3.5G, 好大啊. 不過還是喜歡gmail.
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
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;
}
Intel Mac能夠運行OS X和XP,還是有誘惑力的,但兩萬塊左右MacBook Pro對于普通老百姓來說太貴了.
FlyakiteOSX, 讓我的xp變成mac os x, 爽

用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即可。
IDEA Struts Plugin: Struts Assistant
1.?安裝: 在idea plugins下載并安裝
2. 配置: 指定struts解壓包的路徑
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字段更可怕, 有其他更好方法的請告知
前幾個星期剛換電腦的主機, 但這幾天人腦又出問題(偏頭痛).
電腦壞了可以再買, 人腦壞了, 麻煩.