Oracle Data Integrator tools: OdiZip

Hi everyone!

Today, I will demonstrate how to use the OdiZip tool in Oracle Data Integrator. As the name suggests, the OdiZip tool is used to create ZIP files from a directory or several files.

Usage of OdiZip

OdiZip -DIR=<dir> -FILE=<file> -TOFILE=<dest_file> [-OVERWRITE=<yes|no>] [-RECURSE=<yes|no>] [-CASESENS=<yes|no>] [-ENCODING=<file_name_encoding>]

OdiZip is useful when you have files of smaller size because the zipping operation is done by an Agent and the traffic between the agent and the target directory can cause a lot of problems.

Pre-requisites: Oracle Data Integrator 11g (build version 11.1.1.7.0)

Now, let’s put this tool into practice using ODI. Open ODI Studio and create a new Package named odizip_demo in any of your existing Projects.

Drag the OdiZip tool in the vacant area. Connect it to the OdiBeep tool using an arrow.

create package

package_1

Command

OdiZip "-DIR=D:\odi_work" "-FILE=*.*" "-TOFILE=D:\odi_work\odi_work.zip" "-OVERWRITE=YES" "-RECURSE=YES" "-CASESENS=NO"

Finally, run the package. Check the status of the operation under the Operator tab. If the operation was successful, you should see your zip file in the target directory!

Output

Output

Oracle Data Integrator tools: OdiFileCopy

Hello everyone!

One of the things that continues to amaze me is Oracle Data Integrator’s collection of tools to handle basic as well as complex file operations. Today, I will talk about yet another simple and user friendly ODI tool called OdiFileCopy.

The OdiFileCopy tool copies files or a folder into files or a folder on the machine of the execution agent. One can also overwrite and detect case sensitive files while copying.

Usage of OdiFileCopy tool

OdiFileCopy -DIR=<dir> -TODIR=<dest_dir> [-OVERWRITE=<yes|no>] [-RECURSE=<yes|no>] [-CASESENS=<yes|no>]
OdiFileCopy -FILE=<file> -TOFILE=<dest_file>|-TODIR=<dest_dir> [-OVERWRITE=<yes|no>] [-RECURSE=<yes|no>] [-CASESENS=<yes|no>]

Pre-requisites: Oracle Data Integrator 11g (build version 11.1.1.7.0)

Through this post, I will copy a text file from one location to another. Create a new text file named transfer1.txt and add the following content!

D:\programs\transfer1.txt

"I have been transferred using OdiFileCopy tool"

Now,using OdiFileCopy tool I will copy this text file to location D:\odi_work and name the file as transferred.txt.

Now, let’s put this tool to practice with a short demo. Open ODI Studio. Create a new package named odifilecopy_demo and drag the OdiFileCopy tool in the vacant area. Connect it to the OdiBeep tool using an arrow.

create new package

package_1

Command

OdiFileCopy "-FILE=D:\programs\transfer1.txt" "-TOFILE=D:\odi_work\transferred.txt" "-RECURSE=YES" "-OVERWRITE=YES" "-CASESENS=NO"

Note: In order to transfer multiple files of same type (for example: .csv), you can use the following command.

Copy all *.csv files from source directory to target and overwrite.

OdiFileCopy -FILE=D:\your_source_directory\*.csv -TODIR=D:\your_target_directory -OVERWRITE=yes

Run the package. Check the status of the operation under the Operator tab. If the operation was successful, you will hear a sound due to the OdiBeep tool and your file will be copied to the specified location!

Output

That’s it for this tutorial. Thanks! 🙂

Oracle Data Integrator Tools: OdiFileWait and OdiBeep

Oracle Data Integrator contains tools (also called as commands) that are used for performing specific tasks at run-time. Some of the tasks would include sending emails, waiting for a particular file or producing a sound.

ODI tools are mainly used in packages. One can also develop his/her own tool using the Open Tool feature. Open tools are written in Java and help to extend the built in ODI features. For more information on Oracle Data Integrator tools please refer this link.

In this post, I will explain how to use the built in OdiFileWait and OdiBeep tool.

Pre-requisites: Oracle Data Integrator 11g (build version 11.1.1.7.0)

Open ODI Studio and in any of your existing Projects, create a new Package named test_1.

From the toolbox on the left pane, drag the OdiFileWait and the OdiBeep tool and connect them.

odi_tool_1

Now, click the OdiFileWait tool. Select the General tab and configure it as follows!

Configuring OdiFileWait tool

Command

OdiFileWait "-ACTION=NONE" "-DIR=D:\programs" "-PATTERN=test1.txt" "-CASESENS=NO" "-OVERWRITE=YES" "-FILECOUNT=1" "-TIMEOUT=0" "-POLLINT=1000" "-HEADER=0" "-KEEP_FIRST_HEADER=YES" "-NOFILE_ERROR=NO"

This command will tell ODI to wait for the text1.txt file present in directory D:\programs and proceed when this file is detected.

Similarly, configure the OdiBeep command and provide the input sound file to be played. The file formats supported are WAV, AIF and AU.

Configuring OdiBeep tool

Configuring OdiBeep tool

Command

OdiBeep "-FILE=D:\downloads\sample.wav"

Finally, run the package. Check the status of the operation under the Operator tab. If you have the file already present in the directory (D:\programs) mentioned above, you should hear the sound being played as soon as the Session gets started. If not, ODI will wait till you create the file and play the sound once the file is created.

Output

Output

Reference: OdiFileWait and OdiBeep