20071017
------------------------
查看表空间SQL,这个脚本可以查Temp表空间。
sql 代码
- select t.*
- from (SELECT D.TABLESPACE_NAME,
- SPACE "SUM_SPACE(M)",
- BLOCKS SUM_BLOCKS,
- SPACE - NVL(FREE_SPACE, 0) "USED_SPACE(M)",
- ROUND((1 - NVL(FREE_SPACE, 0) / SPACE) * 100, 2) "USED_RATE(%)",
- FREE_SPACE "FREE_SPACE(M)"
- FROM (SELECT TABLESPACE_NAME,
- ROUND(SUM(BYTES) / (1024 * 1024), 2) SPACE,
- SUM(BLOCKS) BLOCKS
- FROM DBA_DATA_FILES
- GROUP BY TABLESPACE_NAME) D,
- (SELECT TABLESPACE_NAME,
- ROUND(SUM(BYTES) / (1024 * 1024), 2) FREE_SPACE
- FROM DBA_FREE_SPACE
- GROUP BY TABLESPACE_NAME) F
- WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME(+)
- UNION ALL
- SELECT D.TABLESPACE_NAME,
- SPACE "SUM_SPACE(M)",
- BLOCKS SUM_BLOCKS,
- USED_SPACE "USED_SPACE(M)",
- ROUND(NVL(USED_SPACE, 0) / SPACE * 100, 2) "USED_RATE(%)",
- SPACE - USED_SPACE "FREE_SPACE(M)"
- FROM (SELECT TABLESPACE_NAME,
- ROUND(SUM(BYTES) / (1024 * 1024), 2) SPACE,
- SUM(BLOCKS) BLOCKS
- FROM DBA_TEMP_FILES
- GROUP BY TABLESPACE_NAME) D,
- (SELECT TABLESPACE,
- ROUND(SUM(BLOCKS * 8192) / (1024 * 1024), 2) USED_SPACE
- FROM V$SORT_USAGE
- GROUP BY TABLESPACE) F
- WHERE D.TABLESPACE_NAME = F.TABLESPACE(+)) t
- order by "USED_RATE(%)" desc;
20071018
中文乱码弄了一天,问题总算得到解决,总结一下:
我的乱码问题比较怪,同为request.getCharacterEncodeing()为“GBK”
在weblogic下request.getParameter("para")方式可以正确显示,在tomcat下却是乱码
尽管request.getCharacterEncodeing()为GBK,但是却要用
new String(request.getParameter("para").getBytes("ISO-8859-1","GBK")才能正确显示
还好,世界除了上帝,还有google!:-)
一位大侠总结的:
------------------------------
form传送参数方式有2种
1.get方式的解决方法是:
xml 代码
- <Connector port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75 enableLookups="false" redirectPort="8443"
- acceptCount="100" debug="0" connectionTimeout="20000" disableUploadTimeout="true" URIEncoding='GBK' />
-
最后那加入URIEncoding='GBK' 就可以了。
2.加入过滤器能够解决的问题,针对post提交有效
在%Tomcat 5.0\webapps\servlets-examples\WEB-INF\classes\filters下找到
SetCharacterEncodingFilter.java ,之后在你的工程中建一个名filters的包,包里就放SetCharacterEncodingFilter.java,之后在Web.XML中,加入
xml 代码
- <filter>
- <filter-name>Set Character Encodingfilter-name>
- <filter-class>com.cecp.filter.SetCharacterEncodingFilterfilter-class>
- <init-param>
- <param-name>encodingparam-name>
- <param-value>GBKparam-value>
- init-param>
- <init-param>
- <param-name>ignoreparam-name>
- <param-value>trueparam-value>
- init-param>
- filter>
-
- <filter-mapping>
- <filter-name>Set Character Encodingfilter-name>
- <url-pattern>/*url-pattern>
- filter-mapping>
---------------------------------
我属于第一种,用?传参数的时候需要对tomcat配置文件做修改
20071022
------------------------
股市又暴跌了,连跌了三天了:-(
又碰到该死的乱码问题了,这次是zip打包问题,用java.util.zip打包中文文件名会乱码,内容却不会,网上找了找用ant.jar包里的
org.apache.tools.zip.ZipOutputStream替代java.util.zip.ZipOutputStream,org.apache.tools.zip.ZipOutputStream会识别操作系统的默认的locale,如果linux的locale指定为其他字符集还是会乱码,这时需要调用 setEncoding("GBK")方法。
20071023
------------------------
统计linux文件夹下的文件个数
find . -type f -print |wc -l
20071024
java 代码
- jsf时区要加8个小时
-
xml 代码
- jsf时区要加8个小时
- <f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" timeZone="GMT+8" />
----------------------------