﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-wueddie-随笔分类-Java</title><link>http://www.blogjava.net/wueddie/category/3483.html</link><description /><language>zh-cn</language><lastBuildDate>Mon, 20 Feb 2017 01:59:42 GMT</lastBuildDate><pubDate>Mon, 20 Feb 2017 01:59:42 GMT</pubDate><ttl>60</ttl><item><title>java.sql.BatchUpdateException: IO Error: Connection reset</title><link>http://www.blogjava.net/wueddie/archive/2017/02/20/432322.html</link><dc:creator>InPractice</dc:creator><author>InPractice</author><pubDate>Mon, 20 Feb 2017 01:28:00 GMT</pubDate><guid>http://www.blogjava.net/wueddie/archive/2017/02/20/432322.html</guid><wfw:comment>http://www.blogjava.net/wueddie/comments/432322.html</wfw:comment><comments>http://www.blogjava.net/wueddie/archive/2017/02/20/432322.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wueddie/comments/commentRss/432322.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wueddie/services/trackbacks/432322.html</trackback:ping><description><![CDATA[during analysis of "IO Error: Connection reset", many articles mentioned that it could be caused by java security code (accessing /dev/random) used in JDBC connection. However it is not the root cause in my case.


In my environment, Java already use /dev/urandom.


 1. $JAVA_HOME/jre/lib/security/java.security 


securerandom.source=file:/dev/./urandom


2. check with strace.
only -Djava.security.egd=file:/dev/../dev/urandom will trigger system call (read on /dev/urandom)
all other other path format like below are OK.
-Djava.security.egd=file:/dev/./urandom
-Djava.security.egd=file:///dev/urandom


3. Keep checking the retropy size, I have never seen it is exhaused.
while [ 1 ];
do
cat /proc/sys/kernel/random/entropy_avail
sleep 1
done
usually the avail is in the range from 1000 to 3000.

so far, there is no clue about the root cause of "IO Error: Connection reset".  <img src ="http://www.blogjava.net/wueddie/aggbug/432322.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wueddie/" target="_blank">InPractice</a> 2017-02-20 09:28 <a href="http://www.blogjava.net/wueddie/archive/2017/02/20/432322.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Lessons learned - Oracle GI and Database Installation on SUSE 12</title><link>http://www.blogjava.net/wueddie/archive/2016/07/28/431361.html</link><dc:creator>InPractice</dc:creator><author>InPractice</author><pubDate>Thu, 28 Jul 2016 08:55:00 GMT</pubDate><guid>http://www.blogjava.net/wueddie/archive/2016/07/28/431361.html</guid><wfw:comment>http://www.blogjava.net/wueddie/comments/431361.html</wfw:comment><comments>http://www.blogjava.net/wueddie/archive/2016/07/28/431361.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wueddie/comments/commentRss/431361.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wueddie/services/trackbacks/431361.html</trackback:ping><description><![CDATA[I encountered many issue during installation of Oracle Grid Infrastructure(GI) and Database;
with the help of ariticle and documents found through Google search engine, 
I finally made it. for records, here is the details issues encountered and solutions applied.

Major issues were encountered during GI installation.

Pre-installation tasks.

Issue 1: swapspace is not big enough; (1.3.1 Verify System Requirements)
grep MemTotal /proc/meminfo
264G

grep SwapTotal /proc/meminfo
2G  

during OS installation, I take default option and swap space is only 2G.
Oracle recommend to have more than 16G swap space in case of more that 32G RAM.

dd if=/dev/zero of=/home/swapfile bs=1024 count=33554432
33554432+0 records in
33554432+0 records out
34359738368 bytes (34 GB) copied

mkswap /home/swapfile
mkswap /home/swapfile
chmod 0600 /home/swapfile

lessons learned: setup swap space properly according to DB requirement when installing OS.

Issue 2: cannot find oracleasm-kmp-default from Oracle site.
(1.3.6 Prepare Storage for Oracle Automatic Storage Management)

install oracleasmlib and oracleasm-support is easy, just download them from Oracle and install them;
Originally oracleasm kernel is provided by Oracle, but now I cannot find it from Oracle; finally I 
realized that oracleasm kernel is now provided by OS vendor; 
In my case, it should be installed from SUSE disk;

a. to get its name oracleasm-kmp-default
   zypper se oracle
b. map dvd and install 
   zypper in oracleasm-kmp-default

rpm -qa|grep oracleasm
oracleasm-kmp-default-2.0.8_k3.12.49_11-3.20.x86_64
oracleasm-support-2.1.8-1.SLE12.x86_64
oracleasmlib-2.0.12-1.SLE12.x86_64

asm configure -i
asm createdisk DATA  /dev/<...>
asm listdisks
--DATA

ls /dev/oracleasm/disks


Installation tasks:

Issue 3: always failed due to user equivalence check after starting installer OUI with user oracle.

however if I manully check with runcluvfy, no issue found at all.
./runcluvfy.sh stage -pre crsinst -n <node1>,<node1> -verbose

I worked around it by using another user to replace user oracle. but it triggered next issue.


Issue 4: cannot see ASM disks in OUI. no matter how I change the disk dicovery path. the disk list is empty.

but I can find disk manully.
/usr/sbin/oracleasm-discover 'ORCL:*'
Discovered disk: ORCL:DATA

Root cause is that the ASM is configured and created with user oracle. and I aming installing GI
with different user other than oracle; so I cannot see the Disk created.

change owner of disk device file solved the issue.
ls /dev/oracleasm/disks
chown <new_user:oinstall> /dev/oracleasm/disks -R


Issue 5: root.sh execution failed.

Failed to create keys in the OLR, rc = 127, Message:
clscfg.bin: error while loading shared libraries: libcap.so.1: 
cannot open shared object file: No such file or directory

fixed the issue with command below:
zypper in libcap1



ohasd failed to start
Failed to start the Clusterware. Last 20 lines of the alert log follow:
2016-07-24 23:10:28.502:
[client(1119)]CRS-2101:The OLR was formatted using version 3.


I found a good document from SUSE, 
Oracle RAC 11.2.0.4.0 on SUSE Linux Enterprise Server 12 - x86_64,
it make it clear that SUSE 12 is supported by Oracle GI 11.2.0.4, it also mentioned
Patch 18370031.

"During the Oracle Grid Infrastructure installation, 
you must apply patch 18370031 before configuring the software that is installed. "

The patch 18370031 is actually mentioned in "Oracle quick installation guide on Linux",
but not mentioned in "Oracle quick installation guide on Linux". I majored followed up
with later one and missed Patch 18370031.

issue disappeared after I installed the patch 18370031.
./OPatch/opatch napply -oh <grid_home> -local <path_to_patch>/18370031


Errors in file :
ORA-27091: unable to queue I/O
ORA-15081: failed to submit an I/O operation to a disk
ORA-06512: at line 4

solved by change owner of disk DATA related file
ls -l /dev/oracleasm/iid
chown on folder /dev/oracleasm/iid and some .* hidden file.



Issue during DB installation

Issue 6: report error: in invoking target 'agent nmhs' 

vi $ORACLE_HOME/sysman/lib/ins_emagent.mk
Search for the line 
$(MK_EMAGENT_NMECTL)
Change it to:
$(MK_EMAGENT_NMECTL) -lnnz11

refer to 
https://community.oracle.com/thread/1093616?tstart=0



 <img src ="http://www.blogjava.net/wueddie/aggbug/431361.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wueddie/" target="_blank">InPractice</a> 2016-07-28 16:55 <a href="http://www.blogjava.net/wueddie/archive/2016/07/28/431361.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>包结构命名的新方法</title><link>http://www.blogjava.net/wueddie/archive/2006/04/01/38580.html</link><dc:creator>InPractice</dc:creator><author>InPractice</author><pubDate>Sat, 01 Apr 2006 01:26:00 GMT</pubDate><guid>http://www.blogjava.net/wueddie/archive/2006/04/01/38580.html</guid><wfw:comment>http://www.blogjava.net/wueddie/comments/38580.html</wfw:comment><comments>http://www.blogjava.net/wueddie/archive/2006/04/01/38580.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wueddie/comments/commentRss/38580.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wueddie/services/trackbacks/38580.html</trackback:ping><description><![CDATA[J2EE项目中基本都是遵循分层架构的，自然包结构也是基于分层的。DAO层有DAO package。service 层有service package。在这些包下面再根据模块划分子包。<br /><br />我觉得另一种可行的方案是根据模块划分包，如果包比较复杂，比如有超过十个的类，再根据层来划分子包。一般的模块比较简单，无需划分子包。<br /><br />从高内聚，低偶合的原则来说，这样划分具有更高的内聚性。如果按层划分。其实同层的类并入多大的关系。考虑一下DAO层。这些DAO之间有多少联系？ <br /><br />新划分方法的好处是如果需要修改某个模块，修改的地方相对集中。因为都位于一个包内。<br /><br />现在分层架构已经非常普遍，没有必要在包的划分上体现分层架构。在类名上体现分层架构即可。就是说分层架构无需通过包结构来体现。<br /><br />新的划分方案可能有一个问题。各个模块之间可能有实现上的冗余。如果采用这个方案，需要在这点上采取预防措施。<br /><br />当然这还是想法，没有在项目中实践。希望大家能指出这个方法可能带来的问题。<br /><img src ="http://www.blogjava.net/wueddie/aggbug/38580.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wueddie/" target="_blank">InPractice</a> 2006-04-01 09:26 <a href="http://www.blogjava.net/wueddie/archive/2006/04/01/38580.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何减少软件的BUG？</title><link>http://www.blogjava.net/wueddie/archive/2006/02/19/31522.html</link><dc:creator>InPractice</dc:creator><author>InPractice</author><pubDate>Sun, 19 Feb 2006 10:01:00 GMT</pubDate><guid>http://www.blogjava.net/wueddie/archive/2006/02/19/31522.html</guid><wfw:comment>http://www.blogjava.net/wueddie/comments/31522.html</wfw:comment><comments>http://www.blogjava.net/wueddie/archive/2006/02/19/31522.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wueddie/comments/commentRss/31522.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wueddie/services/trackbacks/31522.html</trackback:ping><description><![CDATA[
		<p>
				<font style="background-color: rgb(192, 192, 192);">每次项目结束，都会发现有一堆的Bug。如何分析这些Bug，避免重蹈覆辙。<br /><br />有两种分析方法， 根据Developer在修复Bug时选择的CommonCause，选择比重最大的CommonCause，<br /><br />然后从各个方面分析RootcCause。总结出可以改进的地方。<br /><br />我很难理解这种方法，主要是觉得每次都是泛泛而谈，对减少BUG没有真正的帮助。</font>
		</p>
		<p>
				<br />
		</p>
		<p>
				<font style="background-color: rgb(192, 192, 192);">(我确信这种分析方法没有太大的意义,因为缺乏对底层原因的了解. 而且Developer在选择common Cause的时候完全可能没有合适的而任选一个.经常看到的一个例子是缺乏UT. 这个就不一定是真正的原因,事实往往是做了UT却没有发现出Bug.这种分析方法是典型的不深入实际的浮夸作风, 依赖统计的数据而没有看到统计数据事实上可能存在问题. 这样的工作肯定效率不高. )</font>
		</p>
		<p>
				<font style="background-color: rgb(192, 192, 192);">
						<br />
				</font>
		</p>
		<p>
				<font style="background-color: rgb(192, 192, 192);">下面是我的一些思考。<br />分析的基础应该是Bug，而不是commonCause。直接从CommonCause开始分析，至少可能遗漏一下重要有价值的发现。<br />有些Bug是有可能避免的。而有些bug可以说没有什么好的对策。我们应该集中分析有可能避免的Bug。<br />至于如何分析具体Bug是否能避免，首先应该是造成该Bug的Developer自己分析，让大家知道Bug是如何形成的，然后由大家集体决定。（这样做的风险是大家能否接受。）<br />其次根据Bug引入的时间，和最终测试出的时间，总结有没有可以改进的大方。<br />能够由developer改进而消除的Bug。是最有希望避免再次发生的。<br />比如，有些bug是打字错误造成界面上显示的内容有瑕疵，一个可行的改进是每次都从需求文档拷贝。<br />注意必须要有措施能保证该经验能被所有Developer知道。<br />另一个例子是，我有一次，是的，我有一次再修正bug是没有清除彻底。在总结的时候我掌握了全局查找、替换的技巧。有效地避免了类似的错误再次发生。<br /><br />并非所有错误都能由devloper来消除，有一些只能由Tester来消除。比如，一般来说，Tester总是比Developer对界面敏感，更能发现界面bug。<br />我觉得随着单元测试的进步，现在对Developer的测试水平的要求也提高了。这也许不尽合理。developer对实现花了很多精力，他不可能在测试上达到同样的水准。<br /></font>
		</p>
<img src ="http://www.blogjava.net/wueddie/aggbug/31522.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wueddie/" target="_blank">InPractice</a> 2006-02-19 18:01 <a href="http://www.blogjava.net/wueddie/archive/2006/02/19/31522.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Throw away unnecessary interface!</title><link>http://www.blogjava.net/wueddie/archive/2006/02/19/31494.html</link><dc:creator>InPractice</dc:creator><author>InPractice</author><pubDate>Sun, 19 Feb 2006 09:30:00 GMT</pubDate><guid>http://www.blogjava.net/wueddie/archive/2006/02/19/31494.html</guid><wfw:comment>http://www.blogjava.net/wueddie/comments/31494.html</wfw:comment><comments>http://www.blogjava.net/wueddie/archive/2006/02/19/31494.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wueddie/comments/commentRss/31494.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wueddie/services/trackbacks/31494.html</trackback:ping><description><![CDATA[Why we need Interface? The most important benefit come from the fact: The code depend on the interface no need to care about the implementaion class. and if the implementation class is changed later, the client code no need to update.<BR>This is the feature of Ploymophism of OOP, such as Java.&nbsp;<BR><BR>In some projects, the struts framework was adopted, so all the field need to be persisted is in ActionForm. In order to avoid that the Service layer /DAO layer will depends on the struts. One way is to define a interface which have getter and <BR>setter to access all the fields need to be persisted. The&nbsp;design is like this:<BR><BR>XXXActionForm --------&gt; XXXInterface &lt;--------------ServiceLayer/DAO Layer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;most of them are&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getter and setter<BR>&nbsp;<BR>I can understand this concern, it seems follow the paterns in Enterprise Application Architecture Pattern. but I can not agree this kinds of design. I believe this is misuse of interface.<BR><BR>First, in this kinds of design, if we add some fields, we need update the actionForm, them also need to update interface.<BR>It is boring, and in this case, the interface can not provide <STRONG>any abstraction</STRONG> so the interface need to evolve as the implementation changed. <BR><BR>Second, there is only one&nbsp; kind of implementaion in the system, so the interface can not provide the benifit from making use of polymorphism. <BR><BR>In a word, we can get nothing design benefit from Interface in this case, And Have burden to keep the implementaion and interface synchronized.<BR><BR><img src ="http://www.blogjava.net/wueddie/aggbug/31494.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wueddie/" target="_blank">InPractice</a> 2006-02-19 17:30 <a href="http://www.blogjava.net/wueddie/archive/2006/02/19/31494.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>