Oct 09

Generate command list for all instance’s Dbs

-) Step 1 : this scrip is an example to prune all logs and backup of a db.

#################### prune.sh
db2 connect to $1
db2 PRUNE HISTORY 20131007 AND DELETE

 

-) Step 2 : generate a command list to prune object for all Dbs in the instance

db2 list database directory | grep alias | awk ‘{print “./prune.sh ” $4}’ > cmdlist

Share in top social networks!

Sep 04

Solve problem with mysql closed pool by server

This configuration solve problem with following error:


org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.RecoverableDataAccessException: PreparedStatementCallback; SQL XXXXXXXXXXXXXXXXXX; Communications link failure

The last packet successfully received from the server was 30,184,929 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 30,184,929 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

<Resource auth="Container1"
          driverClassName="com.mysql.jdbc.Driver"
          maxActive="20"
          maxIdle="10"
          maxWait="120"
          testWhileIdle="true"
          validationQuery="select 1"
          name="jdbc/myapp"
          password="passwd" 
          type="javax.sql.DataSource"
          url="jdbc:mysql://127.0.0.1/mydb?autoReconnect=true&amp;useOldAliasMetadataBehavior=true"
          username="user"/>

In detail this lines validate connections before use and eliminates closed ones:

maxActive=”20″
maxIdle=”10″
maxWait=”120″
testWhileIdle=”true”
validationQuery=”select 1″

Share in top social networks!

Older posts «