透過 TOR 作 SSH / MSN 跳板 ( socks4 )

要先裝好 tor , 啟動 tor 後 , 用 putty 照下面的設定就好了 這是透過 tor network 的出口點的 traceroute  8  r02-s2.tp.hinet.net (220.128.4.42)  3.919 ms r02-s2.tp.hinet.net (220.128.4.38)  3.863 ms  3.812 ms 9  r12-pa.us.hinet.net (211.72.108.193)  133.255 ms  133.232 ms * 10  r11-ny.us.hinet.net (202.39.83.105)  253.503 ms  253.630 ms  253.790 ms 11  US-NY-RI-01.chello.com (198.32.160.48)  258.488 ms  255.308 ms  259.752 ms 12  213.46.190.93 (213.46.190.93)  … Read more

Oracle , full-table-scans (FTS) problem

http://www.dba-oracle.com/t_sql_like_clause_index_usage.htm Indexing when using the SQL "like" clause can be tricky because the wildcard "%" operator can invalidate the index.  For example a last_name index would be OK with a "like ‘SMI%’" query, but unusable with "like ‘%SMI%’. Solutions to this issue of a leading wildcard can be addressed in several ways:: Oracle text indexes … Read more

Oracle hint 用法 , database 優化 tunning

常見Oracle HINT的用法: 1. /*+ALL_ROWS*/ 表明對語句塊選擇基於開銷的優化方法,並獲得最佳吞吐量,使資源消耗最小化. 例如: SELECT /*+ALL+_ROWS*/ EMP_NO,EMP_NAM,DAT_IN FROM BSEMPMS WHERE EMP_NO=’SCOTT’; 2. /*+FIRST_ROWS*/ 表明對語句塊選擇基於開銷的優化方法,並獲得最佳響應時間,使資源消耗最小化. 例如: SELECT /*+FIRST_ROWS*/ EMP_NO,EMP_NAM,DAT_IN FROM BSEMPMS WHERE EMP_NO=’SCOTT’; 3. /*+CHOOSE*/ 表明如果數據字典中有訪問表的統計資料,將基於開銷的優化方法,並獲得最佳的吞吐量; 表明如果數據字典中沒有訪問表的統計資料,將基於規則開銷的優化方法; 例如: SELECT /*+CHOOSE*/ EMP_NO,EMP_NAM,DAT_IN FROM BSEMPMS WHERE EMP_NO=’SCOTT’; 4. /*+RULE*/ 表明對語句塊選擇基於規則的優化方法. 例如: SELECT /*+ RULE */ EMP_NO,EMP_NAM,DAT_IN FROM BSEMPMS WHERE EMP_NO=’SCOTT’; 5. /*+FULL(TABLE)*/ 表明對表選擇全局掃描的方法. 例如: SELECT /*+FULL(A)*/ … Read more

sqlrelay sample code / prepare statement / bind value 寫法

include dirname(__FILE__) . ‘/local_config.php’; $__oradb=_fn_connect_sqlrelay(); $__oradb->setOption(‘portability’, DB_PORTABILITY_LOWERCASE); $sql = ‘ select g_no,ctrl_rowid,g_storage,g_img from goods_file where g_no=? ‘; foreach ( $items as $g_no => $v ) { $prepare = $__oradb->prepare($sql); $result = $__oradb->execute($prepare,$g_no); if ( $result ) { $row = $result->fetchRow(DB_FETCHMODE_ASSOC); $items[ $g_no ][‘ctrl_rowid’] = $row[‘ctrl_rowid’]; $items[ $g_no ][‘g_storage’] = $row[‘g_storage’]; $items[ $g_no ][‘g_img’] = $row[‘g_img’]; … Read more