วิธีการ setup ของแต่ละวิธีก็แตกต่างกันไป
วิธีที่ 1 ผ่าน ODBC
1. เพิ่ม DSN ลงไปใน /opt/Ascential/DataStage/DSEngine/.odbc.ini โดยการ copy ตัวอย่าง DSN ที่ DataStage ให้มา เลือกตัวอย่างให้ตรงกับ Database ที่เราต้องการ เช่น DB2 หรือ Oracle เป็นต้น ตัวอย่างนี้เป็นตัวอย่างการเพิ่ม DSN สำหรับ DB2
[DB2_eComp] --> ชื่อ DSN2. แก้ไฟล์ /opt/Ascential/DataStage/Projects/<ProjectName>/ uvodbc.config โดยการเพิ่มชื่อ DSN ลงไปในไฟล์นี้
Driver=/opt/Ascential/DataStage/branded_odbc/lib/VMdb220.so
Description=DataDirect 5.00 DB2 Wire Protocol Driver
AddStringToCreateTable=
AlternateID=
Database=ecomp
DynamicSections=100
GrantAuthid=PUBLIC
GrantExecute=1
IpAddress=192.168.1.200
IsolationLevel=CURSOR_STABILITY
LogonID=db2inst1
Password=db2inst1
Package=db2inst1
PackageOwner=db2inst1
TcpPort=50001
WithHold=1
<DB2_eComp>ข้อควรระวัง ต้องมี space หน้าและหลังเครื่องหมาย = เสมอ
DBMSTYPE = ODBC
3. ทดสอบว่าสร้าง connection สำเร็จหรือไม่โดย
3.1 เปิด DataStage manager
3.2 Import > Table Definitions > ODBC Table Definitions > OK
3.3 Click pull down box ชื่อ DSN
3.4 ถ้าปรากฏชื่อ DSN ที่เราเพิ่งสร้างไปก็เป็นอันเรียบร้อย
วิธีที่ 2 ผ่าน Native Connection
1. export parameter ของ DB2 เพิ่มเติมลงในไฟล์ /usr/dsadm/Ascential/DataStage/DSEngine/dsenv
DB2DIR=/opt/IBM/db2/V9.1; export DB2DIR DB2INSTANCE=dbinst91; export DB2INSTANCE INSTHOME=/home/dbinst91; export INSTHOME LIBPATH=$DB2DIR/lib32:$INSTHOME/sqllib/lib32:$LIBPATH; export LIBPATH LANG=th_TH; export LANG2. catalog database บน ETL Server
To catalog the DB2 server node, enter the following command:
db2 catalog tcpip node db2node remote hostname server service_namewhere db2node is the name of the system where the DB2 client is installed (which must be unique in your node directory list), hostname is the fully qualified name of the system where the DB2 server is installed, and service_name is the connection port name as defined in the services file.
To catalog a remote database, enter the following command:
db2 catalog database db_name as alias_name at node db2nodewhere db_name is the name of the remote database, alias_name is the name of the client instance, and db2node is the name of the system where the DB2 client is installed.
3. ทดสอบว่าสร้าง connection สำเร็จหรือไม่โดย
3.1 เปิด DataStage manager
3.2 Import > Table Definitions > Plug-in Meta Data Definitions > DSDB2 > OK
3.3 เลือก Database ที่ต้องการ Import
3.4 กรอก user name และ password > เลือก Tables และ Fully Qualified Table Names > Next
3.5 ถ้าไม่ปรกฏ error ใดๆ และแสดงชื่อ table ขึ้นมาแสดงว่า config เรียบร้อย
No comments:
Post a Comment