2012年4月15日 星期日

ibmdefaultbp

db2預設的bufferpool,預設的pagesize是4K

DB2預設的Codeset

V9.5之前:不指定是根據系統的Locale
V9.5之後(含V9.5):UTF-8

p.s.1.UTF-8的Codepage是1208;BIG5的Codepage是950
p.s.2.Database建立後無法更改Codeset
p.s.3.Group分為single-byte ("S")、 double-byte ("D")和neutral ("N"),同Group的Codepage可以互相轉換。S及D可以轉為N;N不一定能轉成S及D。1208屬於N組;950是D組。

DB2 Tablespace 大小限制

V8:pagesize 32K => 256 GB
V9:pagesize 32K => 16 TB

2012年4月14日 星期六

WebLogic 預設的Socket Reader

3個
1個執行輪詢功能,另2個用於處理請求
Cluster架構可能會用到更多Socket Reader
利用ThreadPoolPercentSocketReaders屬性控制

2012年4月13日 星期五

Jmap -dump

C:\Users\Java>Jmap -dump:format=b,file=f1.dat 5364
Dumping heap to C:\Users\Rex\f1.txt ...
Heap dump file created

-----
5364是pid
可以用jps查到
用jhat去分析
或用eclipse mat去分析

WebLogic 10.3.1 升級到 Spring 2.5.6出錯

WebLogic的RegistryDocumentBuilderFactory和JAVA的xml.parsers.DocumentBuilderFactory發生衝突

解決方式:
移掉wstx-asl-3.2.0.jar和xml-apis-1.0.b2.jar

p.s.wls 10.3支援Spring 2.5.x
      wls 10.0支援Spring 2.0.x
      wls 9.2支援支援Spring 1.2.8、2.0.x、2.5.x

2012年4月7日 星期六

String的getBytes()

原來沒指定引數是使用OS的CodePage去Encoding
我們又沒有在log4j設定檔設定log編碼,怪不得我們的LOG沒辦法顯示難字
log4j的設定檔可以在append區塊加入encoding為UTF-8
用Notepad++打開LOG時編碼要選UTF-8

p.s.1.
可以使用-Dfile.encoding=UTF8設定JVM的encoding
可以使用Charset.defaultCharset()去取得JVM的charset

p.s.2.作業系統查看Code Page指令:
Linux:locale
Windows:chcp

ref:
http://www.360doc.com/content/08/1015/09/61497_1765862.shtml

http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#getBytes%28%29

public byte[] getBytes()
Encodes this String into a sequence of bytes using the platform's default charset, storing the result into a new byte array.



The behavior of this method when this string cannot be encoded in the default charset is unspecified. The CharsetEncoder class should be used when more control over the encoding process is required.



Returns:

The resultant byte array

Since:

JDK1.1

Tuning GlassFish for Production (The Aquarium)

https://blogs.oracle.com/theaquarium/entry/tuning_glassfish_for_production

2012年4月4日 星期三

Application code page not determined, using ANSI codepage 950

db2set DB2CODEPAGE=1208
db2move dbname import