2019年1月28日 星期一

[Tech Topic] DB2 Performance (Row Lock & Table Lock)

 db2set -info DB2_EVALUNCOMMITTED

https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0002025.html

Db2 registry and environment variables
https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.admin.regvars.doc/doc/c0007340.html

Setting registry and environment variables
https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.admin.regvars.doc/doc/t0004954.html

db2top -d PGW
http://www.bigdatalyn.com/2016/02/24/DB2-db2top/
https://datageek.blog/2014/08/26/db2-basics-db2top/

SELECT s.coord_member,s.application_handle,s.application_name,s.session_auth_id,s.client_applname,s.elapsed_time_sec,agent.event_state, agent.event_object || ':' || agent.event_type event_type, s.activity_state, s.activity_type, s.total_cpu_time,(s.total_cpu_time/1000) total_cpu_time_ml, s.rows_read, s.rows_returned, s.query_cost_estimate, s.direct_reads, s.direct_writes, substr(s.stmt_text,1,5000) stmt_text
FROM sysibmadm.mon_current_sql s,
TABLE(WLM_GET_SERVICE_CLASS_AGENTS('', '',CAST(NULL AS BIGINT),-2)) AS agent
WHERE s.application_handle = agent.application_handle


TRANSACTION ISOLATION LEVEL
https://ithelp.ithome.com.tw/articles/10194749

TRANSACTION ISOLATION LEVEL 大致上可以分成四種:

READ UNCOMMITTED
寬鬆級別:A 交易更新但未確認資料,B交易不能更新只能讀取(直到A交易提交後),確保交易更新資料不會有問題。

READ COMMITTED
比較嚴格一些:A 交易更新並確認資料前,其他交易不能讀取該資料

官網說明:READ COMMITTED 隨著 READ_COMMITTED_SNAPSHOT 設定而異,請參考最下方餐可考資料

REPEATABLE READ
更嚴格一點的限制:讀取中資料會被鎖定,確保同一筆交易中的讀取資料必須相同

SERIALIZABLE
最嚴謹的限制:A 交易讀取時,B交易更新要排隊;A交易更新時,B交易讀取與更新都需要排隊


Determine the effective isolation level in DB2 for Linux, UNIX, and Windows
https://www.ibm.com/developerworks/data/library/techarticle/dm-1107db2isolationlevel/index.html

==============

SQL Trace
https://www.ibm.com/developerworks/data/library/techarticle/dm-1401sqltrace/index.html

2019年1月21日 星期一

[Tech Topic] Client and Server Certificates

 


what-is-the-difference-between-client-and-server-certificates

client-certificate-vs-server-certificate-simplifying-the-difference/


Server Certificates are basically used to identify a server.
The server certificates serve the rationale of encrypting and decrypting the content.

Client certificates as the name implies are clearly used to identify a client to a respective user, which means authenticating the client to the server.

The client certificate is not at all used for data encryption or decryption because it is for user’s identity

Both SSL certificate (server) and client certificate encompass the “Issued to” section. Here, for SSL certificate the “Issued to” section’s value will be the hostname for which it has to be issued and for the client certificate, it will be the user identity or the user name.

it is clear that both server and client certificates are different as the earlier identifies the server and the later identifies the user

they both have keys named as public and private keys. Server and client certificate both contain a public and a private key.

Tech Topic - Tokenization

 


關於 Apple Pay ,你需要知道的幾件事

Visa Checkout Guide

Apple Pay JS API

Visa Token Service

Samsung Tokenization


Visa Tokenization

Token Service Provider

Tokenization技術在不同產業的創新應用


file:///C:/Users/jerry_c/Desktop/evolution-of-payment-tokenization.pdf

2019年1月19日 星期六

[Tech Topic] IBM Performance Test

 





package customcode;

import com.ibm.rational.test.lt.kernel.services.ITestExecutionServices;


/**
 @author unknown
 */
public class HTMLEncode implements
              com.ibm.rational.test.lt.kernel.custom.ICustomCode2 {

       /**
        * Instances of this will be created using the no-arg constructor.
        */
       public HTMLEncode() {
       }

       /**
        * For javadoc of ICustomCode2 and ITestExecutionServices interfaces, select 'Help Contents' in the
        * Help menu and select 'Extending Rational Performance Tester functionality' -> 'Extending test execution with custom code'
        */
       public String exec(ITestExecutionServices tes, String[] args) {
              String _wresult = args[0];
              String decodedString =  _wresult.replaceAll("&""&");
              decodedString =  decodedString.replaceAll(""""\"");
              decodedString =  decodedString.replaceAll("&lt;""<");
              decodedString =  decodedString.replaceAll("&gt;"">");
              //tes.setValue("wresult",ITestExecutionServices.STORAGE_USER,decodedString);
             
              return decodedString;
       }

}


package customcode;

import com.ibm.rational.test.lt.kernel.services.ITestExecutionServices;

/**
 @author unknown
 */
public class UnescapeHex implements
              com.ibm.rational.test.lt.kernel.custom.ICustomCode2 {

       /**
        * Instances of this will be created using the no-arg constructor.
        */
       public UnescapeHex() {
       }

       /**
        * For javadoc of ICustomCode2 and ITestExecutionServices interfaces, select 'Help Contents' in the
        * Help menu and select 'Extending Rational Performance Tester functionality' -> 'Extending test execution with custom code'
        */
       public String exec(ITestExecutionServices tes, String[] args) {
              String strInput = args[0];
              String strHex;
              String strHexValue;
              int intDecimal;
              char charDec;
              while (strInput.indexOf("\\x") >= 0) {
                     strHex = strInput.substring(strInput.indexOf("\\x"), strInput.indexOf("\\x")+4);
                     strHexValue = strHex.replace("\\x""");
                     intDecimal = Integer.parseInt(strHexValue, 16);
                     charDec = (char)intDecimal;
                     strInput = strInput.replace(strHex, String.valueOf(charDec));
              }
              return strInput;
       }

}


package customcode;
import com.ibm.rational.test.lt.kernel.services.ITestExecutionServices;
import com.ibm.rational.test.lt.execution.http.cookie.IHTTPVirtualUserInfo;
import com.ibm.rational.test.lt.execution.http.cookie.ICookie;
import com.ibm.rational.test.lt.kernel.IDataArea;
import java.text.ParseException;

/**
 * @author unknown
 */
public class ModifyCookie implements
                                com.ibm.rational.test.lt.kernel.custom.ICustomCode2 {

                /**
                 * Instances of this will be created using the no-arg constructor.
                 */
                public ModifyCookie() {
                }

                /**
                 * For javadoc of ICustomCode2 and ITestExecutionServices interfaces, select 'Help Contents' in the
                 * Help menu and select 'Extending Rational Performance Tester functionality' -> 'Extending test execution with custom code'
                 */
                public String exec(ITestExecutionServices tes, String[] args) {
        String cookieName = args[0];
        String cookieValue = args[1];
        String newCookie;
    IDataArea dataArea = tes.findDataArea(IDataArea.VIRTUALUSER);
    IHTTPVirtualUserInfo httpInfo =
        (IHTTPVirtualUserInfo)dataArea.get(IHTTPVirtualUserInfo.KEY);
    ICookie serverSuppliedCookie[] = httpInfo.getCookieCache().getCookieByName(cookieName);

if (serverSuppliedCookie.length != 1)
{
        if (serverSuppliedCookie.length == 0)
                tes.getTestLogManager().reportMessage("Cannot find existing Cookie named " + cookieName);
        else
                tes.getTestLogManager().reportMessage("Found more than 1 cookie named " + cookieName);
        return "Problem";
}
      
newCookie = cookieName + "=" + cookieValue + ";Path=/;Domain=" +
        serverSuppliedCookie[0].getDomain();
try {
    httpInfo.getCookieCache().setCookie(newCookie);
} catch (ParseException e) {
    tes.getTestLogManager().reportMessage("ERROR: Can't parse Cookie string: " + newCookie);
}
return "Success";
                }

}


package customcode;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.ibm.rational.test.lt.kernel.services.ITestExecutionServices;

/**
 * @author unknown
 */
public class GetCurrentDate implements
                                com.ibm.rational.test.lt.kernel.custom.ICustomCode2 {

                /**
                 * Instances of this will be created using the no-arg constructor.
                 */
                public GetCurrentDate() {
                }

                /**
                 * For javadoc of ICustomCode2 and ITestExecutionServices interfaces, select 'Help Contents' in the
                 * Help menu and select 'Extending Rational Performance Tester functionality' -> 'Extending test execution with custom code'
                 */
                public String exec(ITestExecutionServices tes, String[] args) {
                                DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
                                String strDate = df.format(new Date());
                                return strDate;
                }

}


package customcode;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import com.ibm.rational.test.lt.kernel.services.ITestExecutionServices;

/**
 * @author unknown
 */
public class GetCampaignEndDate implements
                                com.ibm.rational.test.lt.kernel.custom.ICustomCode2 {

                /**
                 * Instances of this will be created using the no-arg constructor.
                 */
                public GetCampaignEndDate() {
                }

                /**
                 * For javadoc of ICustomCode2 and ITestExecutionServices interfaces, select 'Help Contents' in the
                 * Help menu and select 'Extending Rational Performance Tester functionality' -> 'Extending test execution with custom code'
                 */
                public String exec(ITestExecutionServices tes, String[] args) {
                                DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
                                Calendar cal = Calendar.getInstance();
                                cal.add(Calendar.MONTH, 1);
                                String strDate = df.format(cal.getTime());
                                return strDate;
                }

}

[Tech Topic] WebSphere Application Server Ebooks

 


WebSphere Application Server V8.5 Administration and Configuration Guide for the Full Profile


WebSphere Application Server V8.5 Concepts, Planning, and Design Guide

IT Knowledge Map

https://docs.google.com/spreadsheets/d/1ZmN7G1unUAEpTPp5ObDnlAUtILLwwvluy-KHumMPEUU/edit#gid=0