顯示具有 informix 標籤的文章。 顯示所有文章
顯示具有 informix 標籤的文章。 顯示所有文章

2012年8月21日 星期二

Symbol resolution failed for /usr/lib/libc_r.a[aio_64.o] 解法


症狀:
root@p550/home/root>oninit -v
exec(): 0509-036 Cannot load program oninit because of the following errors:
        0509-130 Symbol resolution failed for /usr/lib/libc_r.a[aio_64.o] because:
        0509-136   Symbol kaio_rdwr64 (number 1) is not exported from
                   dependent module /unix.
        0509-136   Symbol listio64 (number 2) is not exported from
                   dependent module /unix.
        0509-136   Symbol acancel64 (number 3) is not exported from
                   dependent module /unix.
        0509-136   Symbol iosuspend64 (number 4) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait (number 5) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait64 (number 6) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait_timeout (number 7) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait_timeout64 (number 8) is not exported from
                   dependent module /unix.
        0509-026 System error: Error 0
        0509-192 Examine .loader section symbols with the
                 'dump -Tv' command.

解法:
ibm官網給的指令直接照用,不需修改
詳見http://www-01.ibm.com/support/docview.wss?uid=swg21291083
說是AIO裝置沒啟用(not having Asynchronous IO (AIO) device enabled (loaded) in the server.)......
設定完需重啟server

root@p550/home/root>/usr/sbin/chdev -l aio0 -a autoconfig=available
aio0 changed
root@p550/home/root>/usr/sbin/mkdev -l aio0
aio0 Available
root@p550/home/root>shutdown -Fr

2012年8月17日 星期五

如何在排程crontab中執行informix dbaccess指令


作業系統 AIX 5.3

原本把這shell寫成可執行檔(xxx.sh)是可以執行並且正常輸出
結果放在排程(crontab)裡就無法輸出執行結果
氣死我了
google了很久,才知道在排程中執行informix dbaccess指令需要一併設定環境變數
在排程中是吃不到informix環境變數的,所以crontab裡的job就會失敗
dbaccess這個指令也加上絕對路徑來下

最後改好能順利放在crontab的程式(xxx.sh)長這樣:
=============================

#!/bin/ksh
./.profile
INFORMIXSERVER=test
export INFORMIXSERVER
INFORMIXDIR=/usr/informix
export INFORMIXDIR
ONCONFIG=/usr/informix/etc/onconfig
export ONCONFIG


echo "***** `date '+%m/%d %H:%M:%S'`  *****" >> /home/informix/checkuser.log
/usr/informix/bin/dbaccess  test /home/informix/cu.sql

=============================
(寫得不好請見諒 因為我很菜 也是copy網路來改 只求能跑 不求精美)

上面的環境變數的值,記得改成自家的

最重要的一行彩色字,簡單說明一下:

/usr/informix/bin/dbaccess →加了絕對路徑就無敵的dbaccess
test          →DB名稱
/home/informix/cu.sql →這是我要執行的sql查詢句,看倌們可以任意替換路徑和檔名


註:

研究兩三天,最後打成網誌就這麼一丁點

真他奶奶的

shared memory not initialized for INFORMIXSERVER解法

作業系統AIX 5.3

症狀:
$ onstat -
shared memory not initialized for INFORMIXSERVER 'online'
$ onmode -ky
shared memory not initialized for INFORMIXSERVER 'online'
$ oninit -v
Your evaluation license will expire on 2007-10-30 00:00:00
Checking group membership to determine server run mode...succeeded
Reading configuration file '/opt/informix/etc/onconfig'...succeeded
Creating /INFORMIXTMP/.infxdirs...succeeded
Creating infos file "/opt/informix/etc/.infos.informixserver"...succeeded
Linking conf file "/opt/informix/etc/.conf.informixserver"...succeeded
Writing to infos file...succeeded
Checking config parameters...succeeded

WARNING: If you intend to use J/Foundation with this Server instance, please make sure that your SHMBASE value specifies in onconfig is 0x700000010000000 or above. Other
wise you will have problems while dynamimically adding virtual shared memory segments. Please refer to Server machine notes for more information.

Allocating and attaching to shared memory...FAILED
oninit: Fatal error in shared memory creation

解法:
下env指令,檢查INFORMIX相關的環境變數是否正確
以及檢查sqlhost、/etc/hosts…等等


一般來說環境變數有:
INFORMIXDIR=/usr/informix
INFORMIXSERVER=test
有的還會把ONCONFIG編進去 (可是我的server原本就沒編)

結果發現INFORMIXSERVER這個環境變數設錯了

informix本身的環境變數放在此路徑:/usr/informix/.profile

我這次遇到的神奇狀況是…
informix下的.profile這個檔案的INFORMIXSERVER是對的
但root使用的 /.profile(在根目錄)下的INFORMIXSERVER設錯,因為我中途先su 成root,env吃到root的設定,於是造成變數錯誤的問題
不知道哪個前人從別台亂copy過來,真他奶奶的
所以,最後修正root的profile後,重啟informix就OK了(這算是特例吧= =)


另外,我下oninit -v以後,雖然有出現一行很長的Warning如下:
WARNING: If you intend to use J/Foundation with this Server instance, please make sure that your SHMBASE value specifies in onconfig is 0x700000010000000 or above.
但我照著改onconfig中的SHMBASE值後還是不能啟動informix=.= 所以…是一個無效的建議


附錄 - 重啟informix指令:
onmode -ky → 關掉informix
oninit -v → 啟動informix並檢視過程,會逐項報告success or fail



註:
google了一下,通常一般人遇到是其它地方,比如說sqlhost設錯之類的
可參考:http://bbs.chinaunix.net/thread-915528-1-1.html