IDS_IDT_LOAD_ANY_ENTITY.CMD
The following sample SQL script can be used for incremental data load.
Note: Use this file for Microsoft Windows.
@echo off
REM ************************************************************************
REM * *
REM * 1. Change informaticaHome to point to your IIR installation folder *
REM * 2. Change initLoadScripts to point to your Initial Load scripts *
REM * *
REM ************************************************************************
if %1.==. goto Error
if %2.==. goto Error
if %3.==. goto Error
NOT %4.==. goto GIvenBatchOnly
REM ************************************************************************
REM * *
REM * Setting parameters *
REM * *
REM ************************************************************************
set current=%1
set workdir=%2
set dbcredentials=%3
set machineName=%computername%
set informaticaHome=C:\InformaticaIR
set initLoadScripts=C:\InformaticaIR\InitLoadScripts
REM ************************************************************************
REM * *
REM * Find the number of batches in the current Entity records snapshot *
REM * *
REM ************************************************************************
FOR /F "usebackq delims=!" %%i IN (`sqlplus -s %dbcredentials% @GetBatchCount%1`) DO set
xresult=%%i
set /a NumBatches=%xresult%
echo %NumBatches%
del /s/f/q %workdir%\*
setlocal enabledelayedexpansion
set /a counter=1
REM ************************************************************************
REM * *
REM * Loop through all the batches *
REM * *
REM ************************************************************************
for /l %%a in (2, 1, !NumBatches!) do (
set /a counter += 1
(echo counter=!counter!)
sqlplus %dbcredentials% @%initLoadScripts%\SetBatchNumber.sql !counter!
cd /d %informaticaHome%\bin
idsbatch -h%machineName%:1669 -i%initLoadScripts%\idt_%current%_load.txt -
1%workdir%\idt_%current%_load!counter!.log -2%workdir%\idt_%current%_load!counter!.err
-3%workdir%\idt_%current%_load!counter!.dbg
)
goto DONE
:GivenBatchOnly
echo Processing Batch %4....
sqlplus %dbcredentials% @%initLoadScripts%\SetBatchNumber.sql %4
cd /d %informaticaHome%\bin
idsbatch -h%machineName%:1669 -i%initLoadScripts%\idt_%current%_load.txt -
1%workdir%\idt_%current%_load%4.log -2%workdir%\idt_%current%_load%4.err -
3%workdir%\idt_%current%_load%4.dbg
goto DONE
:Error
ECHO Insufficient parameters
echo usage "IDS_IDT_LOAD_ANY_ENTITY.CMD <Object_Name> <Work_Dir> <DBUser/
DBPassword@TNS_Entry_Name> [Optional Batch Number]"
ECHO
echo e.g. IDS_IDT_LOAD_ANY_ENTITY.CMD ACCOUNT C:\InformaticaIR\InitLoadScripts
ora1234/ora1234@ora_db
GOTO END
:DONE
Echo Process completed. Please examine error and log files in %workdir%
OFF
set /a errorcount = 0
%%R in (*.err) do if %%~zR neq 0 set /a errorcount += 1
error Count =%errorcount%
if %errorcount% neq 0 goto batcherror
GOTO END
:batcherror
echo %errorcount% batch/es have failed. Please check the following batches:
for %%R in (*.err) do if %%~zR neq 0 echo %%R
goto DONE
:END