2011年12月30日 星期五

db2cc: line 26: db2javit:命令找不到 解決方式

./opt/ibm/db2/V9.7/bin/db2cc: line 26: db2javit:命令找不到
/opt/ibm/db2/V9.7/bin/db2cc: line 26: db2javit: command not found

在CentOS 6安裝DB2 Express 9.7一直遇到此問題
今天研究一天,看到下面這篇文章
,總算是可以正常執行db2cc,把控制中心叫出來
http://www.linuxso.com/linuxpeixun/11337.html

步驟:
1. 以root執行 xhost +
2. 以root執行 env, 看一下DISPLAY 值是啥, 如 1:1
3. su db2inst1
4. export DISPLAY=
   同root下使用env指令所查到的值
5. xhost +
6. db2cc

解除安裝您的 DB2 資料庫產品(Linux 及 UNIX)

http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=%2Fcom.ibm.db2.luw.qb.server.doc%2Fdoc%2Ft0007439.html

db2 get admin cfg

[root@localhost bin]# pwd
/home/db2inst1/sqllib/bin

[root@localhost bin]# ./db2 get admin cfg

                        管理伺服器配置

 鑑別    類型 DAS                       (AUTHENTICATION) = SERVER_ENCRYPT

 DAS 管理權限群組名稱                     (DASADM_GROUP) = dasadm1

 DAS 探索模式                                 (DISCOVER) = SEARCH
 DB2 伺服器系統名稱                          (DB2SYSTEM) = LOCALHOST

 Java Development Kit 安裝路徑 DAS            (JDK_PATH) = AUTOMATIC (/home/dasusr1/das/java/jdk)
 Java Development Kit 安裝路徑 DAS   (JDK_64_PATH) = AUTOMATIC (/home/dasusr1/das/java/jdk)

 DAS 字碼頁                               (DAS_CODEPAGE) = 0
 DAS 專屬區                              (DAS_TERRITORY) = 0

 聯絡人清單的位置                         (CONTACT_HOST) =
 執行過期作業                            (EXEC_EXP_TASK) = NO
 排程程式模式                             (SCHED_ENABLE) = OFF
 SMTP 伺服器                               (SMTP_SERVER) = localhost.localdomain
 工具目錄資料庫                            (TOOLSCAT_DB) =
 工具目錄資料庫實例                      (TOOLSCAT_INST) =
 工具目錄資料庫綱目                    (TOOLSCAT_SCHEMA) =
 排程程式使用者 ID                                       =

 診斷錯誤擷取層次                            (DIAGLEVEL) = 3

[root@localhost bin]#

新增db2profile

vi /root/.bash_profile

加入以下此行
. /home/db2inst1/sqllib/db2profile

建立用於 DB2 UDB 安裝的群組與使用者 ID (UNIX)

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/start/t0006742.htm

表 11. 必要的使用者和群組
必要的使用者 範例使用者名稱 範例群組名稱
實例擁有者 db2inst1 db2iadm1
隔離使用者 db2fenc1 db2fadm1
DB2 管理伺服器使用者 dasusr1 dasadm1
  • 實例擁有者起始目錄是將建立 DB2 實例之處。
  • 隔離使用者是用來在 DB2 資料庫所使用的位址空間外,執行使用者定義的函數 (UDF) 及儲存程序。
  • DB2 管理伺服器使用者 是用來在您的系統上執行 DB2 管理伺服器。

db2admin路徑

/opt/ibm/db2/V9.7/das/bin/db2admin

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/t0005170.htm
 To start the DAS use the db2admin command:
db2admin start
Stop the DAS using the db2admin command as follows:
db2admin stop

使用身分:dasusr1 (或root)

p.s.開啟控制中心必須先啟動DAS

DB2 root 安裝與非 root 安裝之間的差異

http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=%2Fcom.ibm.db2.luw.qb.server.doc%2Fdoc%2Fr0024443.html

準則 Root 安裝 非 root 安裝
使用者可以選取安裝目錄 否。DB2 產品安裝在使用者的起始目錄下。
容許的 DB2 實例數 多個 一個
安裝期間部署的檔案 僅程式檔案。必須在安裝之後建立實例。 程式檔案及實例檔案。可在安裝之後立即使用DB2 產品。

預設 root 安裝之後 DB2 物件的位置

http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=%2Fcom.ibm.db2.luw.qb.server.doc%2Fdoc%2Fr0024443.html


表 1. 預設 root 安裝之後 DB2 物件的位置
DB2 物件 位置
DAS 起始目錄 home/dasusr1
DAS 資訊 home/dasusr1/das
資料庫配置檔 SQLDBCON home/db2inst1/db2inst1/NODE0000/SQL00001
資料庫目錄
包含下列項目所需的檔案:
  • 緩衝池資訊
  • 歷程資訊
  • 日誌控制檔
  • 儲存體路徑資訊
  • 表格空間資訊
home/db2inst1/db2inst1/NODE0000/SQL00001
資料庫管理程式配置檔 db2systm home/db2inst1/sqllib
DB2 指令 /opt/IBM/db2/V9.5/bin
DB2 錯誤訊息檔案 db2diag.log home/db2inst1/sqllib/db2dump
DB2 安裝路徑 /opt/IBM/db2/V9.5
事件監視器資料的目錄 home/db2inst1/db2inst1/NODE0000/SQL00001/db2event
交易日誌檔的目錄 home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR
安裝日誌檔 db2install.history /opt/IBM/db2/V9.5/install/logs
實例主目錄 home/db2inst1
實例資訊 home/db2inst1/sqllib
實例的本端資料庫目錄 home/db2inst1/db2inst1/NODE0000/sqldbdir
分割的資料庫環境檔案 db2nodes.cfg home/db2inst1/sqllib
系統資料庫目錄 home/db2inst1/sqllib/sqldbdir

Examples of DB2 system commands

http://www.ibm.com/developerworks/data/library/techarticle/0307fierros/0307fierros.html

Examples of DB2 system commands

Command Description
db2audit DB2 provides an audit facility to assist in the detection of unknown or unanticipated access to data. This utility can be used to automate security auditing as described in Scripting scenarios.
db2batch Reads SQL statements from either a flat file or standard input, dynamically prepares and describes the statements, and returns an answer set. This DB2 command can be used within a script designed for benchmarking different instance and database configuration parameters. You will want to restart the instance and capture system information such as DB2 registry, instance, and database configurations before invoking this utility.
db2exfmt Formats the contents of the explain tables. This DB2 command can be used within a script designed for SQL tuning because you can use it to automate the explaining, extraction, and formatting of SQL statement. Scripting this DB2 command allows a large number of SQL statements to be explained, extracted, and formatted for review at a later time.
db2chkbk This utility can be used to test the integrity of a backup image and to determine whether or not the image can be restored. This utility can be very useful at the end of a database backup script to generate a backup completion report.
db2flsn Returns the name of the database transaction log file that contains the log record identified by a specified log sequence number (LSN). This utility can be very useful as part of a database transaction log pruning script when log retain is enabled for recovery and you are running data replication and need to determine where to start pruning transaction logs.

DB2 GUI tool和Command對照

http://www.redbooks.ibm.com/abstracts/tips0142.html?Open


DB2 GUI tool Command
Control Center db2cc
Command Center db2cmdctr
Configuration Assistance db2ca
Health Center db2hc
Task Center db2tc
Development Center db2dc
Command Widow (command line processor) db2cmd
Journal db2journal
Memory Visualizer db2memvis
Information Center db2ic
Replication Center db2rc

2011年12月27日 星期二

IE 7及IE8 Session

IE 7:同一SESSION,後蓋前
IE8以上:不管開幾個視窗或Tab都是同個Session

ref:
http://blog.darkthread.net/post-2009-04-08-ie8-nomerge.aspx

2011年12月21日 星期三

最後還是用了TrueCrypt

工作上難免有些機敏性資料
怕硬體不見,怕硬碟format後仍然可以被找出來
一直在用TrueCrypt
但是有看到一些小八掛
本來想找替代方案
但是PGP DISK在8.0後已經不是免費軟體
Win 7專業版以上可用EFS也很虛
BitLocker要買Win 7企業版@.@
目前看到能跨Win、Linux、Mac的只有TrueCrypt和PGP
再研究看看
等換硬碟再用Disk Wipe
應該就滿安全了



ref:
http://en.wikipedia.org/wiki/Comparison_of_disk_encryption_software
http://www.phy.bnl.gov/computing/index.php/Disk_Encryption

2011年12月17日 星期六

Windows 7 的「備份與還原」

在PxHome買了WAU卡
把家用進階升級成專業版
結果還原回去又變家用進階版~~~@.@
還是弄成VM備份比較方便

Acer電腦還原

Alt+F10

2011年12月4日 星期日

兩款安全插座

R35912:使用保險絲

R31320:機制不詳

http://civil.bsmi.gov.tw/bsmi_pqn/do/pqn5890/form

p.s.UL 94

2011年12月1日 星期四

log4j

http://logging.apache.org/log4j/1.2/manual.html
http://wiki.apache.org/logging-log4j/Log4jXmlFormat

Access Plan Graph

http://www.webcool.cn/html=Display_Info=3712=1.html

http://etutorials.org/Misc/advanced+dba+certification+guide+and+reference/Chapter+6.+The+DB2+Optimizer/Understanding+DB2+Query+Access+Plans/

http://www.devx.com/gethelpon/10minutesolution/16567/1954

cf:
db2 graphic timeron

Explain Facility Tools

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/c0005755.htm

Using DB2 UDB OLAP functions

http://www.ibm.com/developerworks/data/library/techarticle/dm-0401kuznetsov/index.html

Visual Explain operators

http://publib.boulder.ibm.com/infocenter/db2luw/v9r8/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.explain.doc%2Fdoc%2Fr0021335.html

FFDC

First Failure Data Collection

IBM i 中国开发团队 Blog:利用服务监控器(Service Monitor)自动报告软件问题

Automated Problem Reporting With Service Monitor

com.ibm.db2.jcc

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.dc.doc/dc/r_jdbcdrivers.htm

當您新增連線到專案時,您可以指定適當的驅動程式,以連接您想要在其中建置物件的資料庫。 在大多數情況中,IBM DB2 驅動程式非常適合用於連接您的 DB2 資料庫伺服器。不過,建議您在用戶端使用 IBM Universal Type 4 驅動程式,並在伺服器上使用 IBM Universal Type 2 驅動程式。