Using SFTP in PowerCenter
Using SFTP in PowerCenter
Applies to:
Informatica PowerCenter
Summary
This article briefs about how to push/pull files using SFTP program in Informatica PowerCenter.
Author Bio
Author(s): Sukumar Balasubramanian Company: CIBC Created on: February 02, 2010 Sukumar Balasubramanian is an experienced Informatica ETL Consultant working with CIBC, Canada. He has good exposure to Data Integration/Data Warehousing Projects. He is also a key contributor in informatica-l group of ITtoolbox.
http://technet.informatica.com 1
Table of Contents
INTRODUCTION ................................................................................................................................................ 3 WHAT IS SFTP, AND HOW DO I USE IT TO TRANSFER FILES? .................................................................. 3 PREREQUISITES ............................................................................................................................................... 3 SFTP for UNIX ................................................................................................................................................ 3 SFTP for Windows .......................................................................................................................................... 3 HOW SFTP Works .............................................................................................................................................. 3 INFORMATICA SFTP CONNECTOR ................................................................................................................ 4 SHELL SCRIPT IN INFORMATICA .................................................................................................................... 5 SAMPLE SHELL SCRIPT................................................................................................................................... 6 FILE TRANSFER SPEED, SCP VS SFTP ......................................................................................................... 6 Disclaimer and Liability notice ............................................................................................................................ 7
http://technet.informatica.com 2
INTRODUCTION
This article briefs about how to push/pull files using SFTP program in Informatica PowerCenter
PREREQUISITES
SFTP for UNIX 1. By default all the UNIX environment have SSH pre installed. SFTP for Windows 1. You need to configure Windows to use SSH protocol. 2. There are many free wares like WINSCP, OpenSSH and Putty. You need to install this on your windows machine. 3. Most of the free wares have GUI but you must choose the one that has the command line execution.
http://technet.informatica.com 3
You need to create a ssh keys on the informatica server using ssh keygen command in Unix Share the public key with the team that maintains your SFTP server and ask them to register this public key on the SFTP server. Execute the sftp <command> very first time it will create a finger key print between the Informatica Server and the SFTP server. Subsequently you can just issue SFTP or SCP file1 file2. You need not specify any password.
To connect to an SFTP server, create an FTP connection and enable SFTP. SFTP uses the SSH2 authentication protocol. Configure the authentication properties to use the SFTP connection. You can configure publickey or password authentication. The Integration Service connects to the SFTP server with the authentication properties you configure. If the authentication does not succeed, the session fails The following table describes the key properties that you configure for an SFTP: Host Name If you enable SFTP, specify a host name or port number for an SFTP server. If you do not specify a port number, the Integration Service uses 22 by default. Default Remote Directory Default directory on the FTP host used by the Integration Service. Do not enclose the directory in quotation marks. You can enter a parameter or variable for the directory. Use any parameter or variable type that you can define in the parameter file. Depending on the FTP server you use, you may have limited options to enter FTP directories. For details, see the FTP server documentation. In the session, when you enter a file name without a directory, the Integration Service appends the file name to this directory. This path must contain the appropriate trailing delimiter. For example, if you enter c:\staging\
http://technet.informatica.com 4
and specify data.out in the session, the Integration Service reads the path and file name as c:\staging\data.out. Public Key File Name Public key file path and file name. Required if the SFTP server uses publickey authentication. Enabled for SFTP. Private Key File Name Private key file path and file name. Required if the SFTP server uses publickey authentication. Enabled for SFTP. Private Key File Password Private key file password used to decrypt the private key file. Required if the SFTP server uses public key authentication and the private key is encrypted. Enabled for SFTP.
After the Informatica SFTP connector is configured we can use this connector in the session properties and just provide the name of the file that we like to push/pull from the SFTP server. Your session will directly read or write from/to the SFTP server.
http://technet.informatica.com 5
Example:
scp username@ host:Sourcefile Destinationfile if [ $? = 0 ] then echo "Connected and copied the file else echo "ERROR in copying the file using SCP " fi
http://technet.informatica.com 6
http://technet.informatica.com 7