Monster Oasis
覺得累就是進步的開始!

2010/02/04

Protected: sqlrelay server install steps

Filed under: JOB,System/Linux/Unix* — Tags: — 5:00 pm

This post is password protected. To view it please enter your password below:


Related URL:
  1. sqlrelay sample code / prepare statement / bind value 寫法
  2. Protected: sqlrelay server install / setup / SOP / 設定 / 啟動
  3. sqlrelay : install / settings / history / tunning 方法
  4. oracle/sqlrelay/php 把 field 的 name 轉成小寫 sample code

2009/06/01

sqlrelay sample code / prepare statement / bind value 寫法

Filed under: Copy_N_Paste,DATABASE,Programming/php — Tags: , — 3:08 pm

3ae0efb3712cf634d78c33a54bd460ca

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'];
    $result->free();

  } else continue;
}
$__oradb->disconnect();
Related URL:
  1. Protected: oracle 的一些 SOP command
  2. Maximum Availability Architecture – Oracle Streams Configuration Best Practices
  3. [設定/memo] PL/SQL Developer , plsql 免設 tnsname 檔的方法
  4. Protected: [memo] Streams process
  5. Protected: oracle standby SOP
  6. 使用 mysql partition table sample
  7. Protected: install oracle 11g steps
  8. Protected: oracle trigger question
  9. oracle : dbca initialization parameters 畫面 , character set 字元集 設定畫面 / plsql 免設 tnsname.ora tips
  10. 裝好 oracle 後 啟用 Enterprise Manager 後的 license 訊息畫面

2009/04/12

Protected: sqlrelay server install / setup / SOP / 設定 / 啟動

This post is password protected. To view it please enter your password below:


Related URL:
  1. Protected: emerge 不見的救法
  2. gentoo emerge command
  3. [gentoo] 排除舊的 lib 相容問題
  4. [monster] monster.tw 記錄 / memo / ubuntu / 裝 圖形介面 / GUI / gnome desktop / ip address / setting
  5. Protected: 兩個版本的 Linux ( CENTOS vs GENTOO ) 作 mysql + senna small compare
  6. gentoo linux ifconfig
  7. 查主機溫度
  8. 裝新的 www.monster.com.tw 過程記錄
  9. 在 gentoo 裝 oracle sqlplus package
  10. gentoo NFS

2009/02/07

sqlrelay : install / settings / history / tunning 方法

Filed under: JOB,Software,System/Linux/Unix* — Tags: — 1:39 pm

step1. 裝 sqlrelay 前要先裝 Rudiments 的 library , 現在抓 rudiments 0.32 版.

PATH="$PATH:/sbin" ldconfig -n /usr/local/firstworks/lib

Libraries have been installed in:
/usr/local/firstworks/lib

他有提到幾點

- add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
- use the `-Wl,–rpath -Wl,LIBDIR’ linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf’

—->解決 lib 問題 : ld.so.conf

step2. 裝 sqlrelay , 抓

  • wget http://downloads.sourceforge.net/sqlrelay/sqlrelay-0.40.tar.gz?modtime=1231398430&big_mirror=0
  • configure , make , make install
  • 檢查是否有 sql_relay.so : find / -name sql_relay.so -print
    /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613/sql_relay.so
  • gentoo 在 /etc/php 下的兩個環境 : apache2-php5 , cli-php5 目錄 裡面的 ext , ext-active 都要有這個 file : sqlrelay.ini , 內容是
    extension=sql_relay.so
  • 找安裝程式把 libsqlrclientwrapper*so* 放在哪個目錄 , 再修改 /etc/ld.so.conf 加上這個目錄 , 改完要下 ldconfig –v 讓路徑生效

Tuning SQL Relay -

http://sqlrelay.sourceforge.net/sqlrelay/tuning.html

這邊提到一些改善 SQL Relay 效能的方法, 不過這些方法也適用於一些 networked daemon 的 tunning

如 下 sysctl -a|grep timeout 看到

net.ipv4.tcp_fin_timeout = 60 設成 30 ,
echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout

tcp_tw_recycle , tcp_tw_reuse 這兩個 default 是 0 (關起來的) 設成 1 ,
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse
echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle

——–
cat /etc/sysctl.conf
net.ipv4.ip_local_port_range = “1024 65535″ —> 這個在 gentoo 好像無效
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1

Related URL:
  1. Protected: sqlrelay server install steps
  2. sqlrelay sample code / prepare statement / bind value 寫法
  3. Protected: sqlrelay server install / setup / SOP / 設定 / 啟動
  4. oracle/sqlrelay/php 把 field 的 name 轉成小寫 sample code

2008/02/15

oracle/sqlrelay/php 把 field 的 name 轉成小寫 sample code

Filed under: Copy_N_Paste,DATABASE,Programming/php — Tags: , , — 10:59 am
// $__oradb->setOption('portability', DB_PORTABILITY_LOWERCASE);
require_once "config.php";
require_once "sqlrelay.php";

unset($__config['sqlrelay_dsn']);
$__config['sqlrelay_dsn'][]="sqlrelay://xx_id:xx_pass@172.30.0.17:9000";

$sql="select aaa,bbb from xxxx t where g_close_date is null";

$__now=get_microtime();
$__oradb=_fn_connect_sqlrelay();
$__oradb->setOption('portability', DB_PORTABILITY_LOWERCASE);

$result = $__oradb->query($sql);
if (DB::isError($result)) {
  echo "db error\n";
  printf("Execution time : %s\n",get_microtime()-$__now);
  exit;
}

while ( $row=$result->fetchRow(DB_FETCHMODE_ASSOC) ) {
  // -----
  echo $row['aaa'] . ' : ' . $row['bbb'];
}

$result->free();
$__oradb->disconnect();

// 取時間 function
function get_microtime() {
    list($usec, $sec) = explode(' ',microtime() );
    return ((double)$usec + (double)$sec);
}
Related URL:
  1. Protected: oracle 的一些 SOP command
  2. Maximum Availability Architecture – Oracle Streams Configuration Best Practices
  3. [設定/memo] PL/SQL Developer , plsql 免設 tnsname 檔的方法
  4. Protected: [memo] Streams process
  5. Protected: oracle standby SOP
  6. 使用 mysql partition table sample
  7. Protected: install oracle 11g steps
  8. Protected: oracle trigger question
  9. oracle : dbca initialization parameters 畫面 , character set 字元集 設定畫面 / plsql 免設 tnsname.ora tips
  10. 裝好 oracle 後 啟用 Enterprise Manager 後的 license 訊息畫面

www.monster.com.tw , © Copyright 2008