LoginSignup
1
1

More than 5 years have passed since last update.

(db2Export.bat) DB2 IFX形式でデータをダウンロード

Last updated at Posted at 2012-09-20
db2Export.bat
REM db2Export.bat
REM----------------------------
REM DB2データ抽出バッチ
REM----------------------------

REM----------------------------
REM 環境設定
REM----------------------------
SET AIX_USER=userid
SET AIX_PASS=password
SET DB_ID=DB_ID
SET DB_SCHEMA=DB_SCHEMA
SET LOG_FILE=C:\logs\EXPORT.log
SET EXPORT_PATH=C:\export\data\
SET DB2PATH=C:\Program Files\IBM\SQLLIB
SET DB2CLP=-1206113057

REM----------------------------
REM 開始ログ出力
REM----------------------------
echo 処理開始時間: >> %LOGFILE%


REM----------------------------
REM DB2との接続、スキーマ設定
REM----------------------------
db2 -vz %LOG_FILE% "CONNECT TO " %DB_ID% " USER " %AIX_USER% " USING " %AIX_PASS%
db2 -vz %LOG_FILE% "SET CURRENT SCHEMA = " %DB_SCHEMA%

REM----------------------------
REM データ抽出
REM----------------------------
db2 -vz %LOG_FILE% EXPORT TO %EXPORT_PATH%TableName.ixf OF IXF modified by codepage=1208 "SELECT * FROM TableName FOR READ ONLY WITH UR"


REM----------------------------
REM DB2との接続を切断
REM----------------------------
db2 -vz %LOG_FILE% CONNECT RESET

REM----------------------------
REM 終了ログ出力
REM----------------------------
echo 処理終了時間: >> %LOG_FILE%
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1