managing connection objects

18
Managing Connection Objects By PenchalaRaju.Yanamala This chapter includes the following topics: Managing Connection Objects Overview Working with Connection Objects Configuring Session Connections Overriding Connection Attributes Configuring Connection Object Permissions Relational Database Connections FTP Connections External Loader Connections HTTP Connections PowerChannel Relational Database Connections PowerExchange Connections Managing Connection Objects Overview Before using the Workflow Manager to create workflows and sessions, you must configure connections in the Workflow Manager. You can configure the following connection information in the Workflow Manager: Create relational database connections. Create connections to each source, target, Lookup transformation, and Stored Procedure transformation database. You must create connections to a database before you can create a session that accesses the database. For more information, see Relational Database Connections . Create FTP connections. Create a File Transfer Protocol (FTP) connection object in the Workflow Manager and configure the connection properties. For more information, see FTP Connections . Create external loader connections. Create an external loader connection to load information directly from a file or pipe rather than running the SQL commands to insert the same data into the database. For more information, see External Loader Connections . Create queue connections. Create database connections for message queues. For more information, see PowerExchange for WebSphere MQ Connections and PowerExchange for MSMQ Connections . Create source and target application connections. Create

Upload: ypraju

Post on 18-Nov-2014

287 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Managing Connection Objects

Managing Connection Objects

By PenchalaRaju.Yanamala

This chapter includes the following topics:

Managing Connection Objects OverviewWorking with Connection ObjectsConfiguring Session ConnectionsOverriding Connection AttributesConfiguring Connection Object PermissionsRelational Database ConnectionsFTP ConnectionsExternal Loader ConnectionsHTTP ConnectionsPowerChannel Relational Database ConnectionsPowerExchange Connections

Managing Connection Objects Overview

Before using the Workflow Manager to create workflows and sessions, you must configure connections in the Workflow Manager.

You can configure the following connection information in the Workflow Manager:

Create relational database connections. Create connections to each source, target, Lookup transformation, and Stored Procedure transformation database. You must create connections to a database before you can create a session that accesses the database. For more information, see Relational Database Connections.Create FTP connections. Create a File Transfer Protocol (FTP) connection object in the Workflow Manager and configure the connection properties. For more information, see FTP Connections.Create external loader connections. Create an external loader connection to load information directly from a file or pipe rather than running the SQL commands to insert the same data into the database. For more information, see External Loader Connections.Create queue connections. Create database connections for message queues. For more information, see PowerExchange for WebSphere MQ Connections and PowerExchange for MSMQ Connections.Create source and target application connections. Create connections to source and target applications. When you create or modify a session that reads from or writes to an application, you can select configured source and target application connections. When you create a connection, the connection properties you need depends on the application. For more information, Working with Connection Objects

A connection object is a global object that defines a connection in the repository. You create and modify connection objects in the Workflow Manager. When you create a connection object, you define values for the connection properties. The properties vary depending on the type of connection you create.

You can create, edit, and delete connection objects. You can also assign permissions to connection objects. For relational database connections, you

Page 2: Managing Connection Objects

can also copy and replace connection objects.

Connection Object Code Pages

Code pages must be compatible for accurate data movement. You must select a code page for most types of connection objects. The code page of a database connection must be compatible with the database client code page. If the code pages are not compatible, sessions may hang, data may become inconsistent, or you might receive a database error, such as:

ORA-00911: Invalid character specified.

The Workflow Manager filters the list of code pages for connections to ensure that the code page for the connection is a subset of the code page for the repository. It lists the five code pages you have most recently selected. Then it lists all remaining code pages in alphabetical order.

If you configure the Integration Service for data code page validation, the Integration Service enforces code page compatibility at session runtime. The Integration Service ensures that the target database code page is a superset of the source database code page.

When you change the code page in a connection object, you must choose one that is compatible with the previous code page. If the code pages are incompatible, the Workflow Manager invalidates all sessions using that connection.

If you configure the PowerCenter Client and Integration Service for relaxed code page validation, you can select any supported code page for source and target connections. If you are familiar with the data and are confident that it will convert safely from one code page to another, you can run sessions with incompatible source and target data code pages. It is your responsibility to ensure your data will convert properly.

Creating Connection Objects

You use the Connection Browser to create connection objects. Open the Connection Browser dialog box for the connection object. For example, click Connections > Relational to open the Connection Browser dialog box for a relational database connection.

To create a connection object:

1. In the Workflow Manager, click Connections and select the type of connection you want to create.

Select one of the following connection types:Relational. For information about creating relational database connections, see Relational Database Connections or PowerExchange Interfaces for PowerCenter.FTP. For information about creating FTP connections, see FTP Connections.Loader. For information about creating loader connections, see External Loader Connections.Queue. For information about creating queue connections, see

Page 3: Managing Connection Objects

PowerExchange for WebSphere MQ Connections and PowerExchange for MSMQ Connections.Application. For information about creating application connections, see the appropriate PowerExchange application section in this chapter or PowerExchange Interfaces for PowerCenter.

The Connection Browser dialog box appears, listing all the source and target connections available for the selected connection type.

2. Click New.If you selected FTP as the connection type, the Connection Object dialog box appears. Go to step 5.If you selected Relational, Queue, Application, or Loader connection type, the Select Subtype dialog box appears.

3. In the Select Subtype dialog box, select the type of database connection you want to create.

4. Click OK.5. Enter the properties for the type of connection object you want to create.The Connection Object Definition dialog box displays different properties depending on the type of connection object you create. For more information about connection object properties, see the section for each specific connection type in this chapter.6. Click OK.The new database connection appears in the Connection Browser list.7. To add more database connections, repeat steps 3 to 6. 8. Click OK to save all changes.

Editing a Connection Object

You can change connection information at any time. If you edit a connection object used by a workflow, the Integration Service uses the updated connection information the next time the workflow runs. You might use this functionality when moving from test to production.

To edit a connection object:

1.

Open the Connection Browser dialog box for the connection object. For example, click Connections > Relational to open the Connection Browser dialog box for a relational database connection.

2. Click Edit.The Connection Object Definition dialog box appears.3. Enter the values for the properties you want to modify.The connection properties vary depending on the type of connection you select. For more information about connection properties, see the section for each specific connection type in this chapter.4. Click OK.

Deleting a Connection Object

When you delete a connection object, the Workflow Manager invalidates all sessions that use these connections. To make the sessions valid, you must edit them and replace the missing connections.

To delete a connection object:

Page 4: Managing Connection Objects

1.

Open the Connection Browser dialog box for the connection object. For example, click Connections > Relational to open the Connection Browser dialog box for a relational database connection.

2. Select the connection object you want to delete in the Connection Browser dialog box.

Tip: Hold the shift key to select more than one connection to delete.

3. Click Delete, and then click Yes.

Configuring Session Connections

When you configure a mapping, you can choose the connection type and select a connection to you. You can also override the connection attributes for the session or create a connection.

Setting the Connection Type

You can set the connection type from the Mapping tab for each object. Connection types include application, queue, external loader, and FTP.

Note: A relational connection type appears as the connection type for all relational sources, targets, and transformations such as Lookup and Stored Procedure transformations. You cannot change the relational connection type.

Application

Select this connection type to access PowerExchange and Teradata FastExport sources and targets. You can also access transformations such as HTTP, Salesforce Lookup, and BAPI/RFC transformations.

Queue

Select this connection type to access an MSMQ or WebSphere MQ source, or if you want to write messages to a WebSphere MQ message queue. If you select this option, select a configured MQ connection in the value column. For static WebSphere MQ targets, set the connection type to FTP or Queue. For dynamic MQSeries targets, set the connection type to Queue.

External Loader

Select this connection type to use the External Loader to load output files to Teradata, Oracle, DB2, or Sybase IQ databases. If you select this option, select a configured loader connection in the Value column.

To use this option, you must use a mapping with a relational target definition and choose File as the writer type on the Writers tab for the relational target instance. As the Integration Service completes the session, it uses an external loader to load target files to the Oracle, Sybase IQ, IBM DB2, or Teradata database. You cannot choose external loader for flat file or XML target definitions in the mapping.

Related Topics: External Loading

Page 5: Managing Connection Objects

FTP

Select this connection type to use FTP to access the source or target directory for flat file and XML sources or targets. If you want to extract or load data from or to a flat file or XML source or target using FTP, you must specify an FTP connection when you configure source or target options. If you select this option, select a configured FTP connection in the Value column. FTP connections must be defined in the Workflow Manager prior to configuring sessions.

Related Topics: Using FTP

None

Select None when you want to read or write from a local flat file or XML file, or if you use an associated source for a WebSphere MQ session.

Setting the $Source and $Target Connection Values

Enter the database connection you want the Integration Service to use for the $Source and $Target connection variables. You can select a connection object, or you can use the $DBConnectionName or $AppConnectionName session parameter if you want to define the connection value in a parameter file.

Use the $Source or $Target variable in Lookup and Stored Procedure transformations to specify the database location for the lookup table or stored procedure. For more information about specifying connection information for Lookup or Stored Procedure transformations, see the PowerCenter Transformation Guide. You can also use the $Source variable to specify the source connection for relational sources and the $Target variable to specify the target connection for relational targets in the session properties.

If you use $Source or $Target in a Lookup or Stored Procedure transformation, you can specify the database location in the $Source Connection Value or $Target Connection Value field to ensure the Integration Service uses the correct database connection to run the session. If you use $Source or $Target in a mapping, but do not specify a database connection in one of these fields, the Integration Service determines which database connection to use when it runs the session.

The following list describes how the Integration Service determines the value of $Source or $Target when you do not specify the $Source Connection Value or $Target Connection Value in the session properties:

When you use $Source and the pipeline contains one source, the Integration Service uses the database connection you specify for the source.When you use $Source and the pipeline contains multiple sources joined by a Joiner transformation, the Integration Service determines the database connections based on the location of the Lookup or Stored Procedure transformation in the pipeline:

- When the transformation is after the Joiner transformation, the Integration Service uses the database connection for the detail table.

Page 6: Managing Connection Objects

-

When the transformation is before the Joiner transformation, the Integration Service uses the database connection for the source connected to the transformation.When you use $Target and the pipeline contains one target, the Integration Service uses the database connection you specify for the target.When you use $Target and the pipeline contains multiple relational targets, the session fails.When you use $Source or $Target in an unconnected Lookup or Stored Procedure transformation, the session fails.

You can enter values for the $Source and $Target connection variables on the Properties tab of the session properties, or on the Mapping tab, Connections node.

To enter the database connection for the $Source and $Target connection variables:

1. In the session properties, select the Properties tab or the Mapping tab, Connections node.

2. Click the Open button in $Source Connection Value or $Target Connection Value field.

The Connection Browser dialog box appears.

3. Select a connection object or variable:

Use Connection Object. Select a relational or application connection object. You can also create a connection object and select it.Use Connection Variable. Use a connection variable or session parameter. You can enter either the $Source or $Target connection variable, or the $DBConnectionName or $AppConnectionName session parameter. If you enter a session parameter, define the parameter in the parameter file. If you do not define a value for the session parameter, the Integration Service determines which database connection to use when it runs the session.

4. Click OK.see PowerExchange Interfaces for PowerCenter or one of the following PowerExchange sections in this chapter:

- PowerExchange for JMS Connections- PowerExchange for MSMQ Connections- PowerExchange for PeopleSoft Connections- PowerExchange for Salesforce Connections- PowerExchange for SAP NetWeaver BI Connections- PowerExchange for SAP NetWeaver Connections- PowerExchange for Siebel Connections- PowerExchange for TIBCO Connections- PowerExchange for Web Services Connections- PowerExchange for webMethods Connections- PowerExchange for WebSphere MQ Connections

Overriding Connection Attributes

Before you can configure a session to use a connection, you must create a connection object in the Workflow Manager and configure the connection

Page 7: Managing Connection Objects

attributes. For example, to configure a session to use FTP, create an FTP connection object and configure the connection attributes.

After you create a connection object, you configure source and target instances in a session to use the object. When you configure the source and target instances, you can override connection attributes and define some attributes that are not in the connection object. You can override connection attributes based on how you configure the source or target instances.

You can override connection attributes when you configure the source or target session properties in the following ways:

You use an FTP, queue, external loader, or application connection for a non-relational source or target instance.You use an FTP, queue, or external loader connection for a relational target instance.You use an application connection for a relational source instance.

For example, for an FTP target connection, you can override the remote file name, whether the target file is staged, and the transfer mode. For a Teradata FastExport source connection, you can override attributes such as TDPID, tenacity, and block size.

When you configure a session, you can override connection attributes for a connection object or you can use a session parameter and override the attributes in the parameter file.

Working with Connection ObjectsOverriding Connection Attributes in the SessionOverriding Connection Attributes in the Parameter File

Page 8: Managing Connection Objects

Overriding Connection Attributes in the Session

You can override the source and target connection attributes in the session properties.

To override connection attributes in the session:

1. On the Mapping tab, select the source or target instance in the Connections node.

2. Select the connection type.3. Click the Open button in the value field to select a connection object.4. Choose the connection object.5. Click Override.

7. Click OK.

Overriding Connection Attributes in the Parameter File

If you use a session parameter to define a connection for a source or target, you can override the connection attributes in the parameter file. Use the $FTPConnectionName, $QueueConnectionName, $LoaderConnectionName, or $AppConnectionName session parameter.

When you define a connection in the parameter file, the Integration Service searches for specific, user-defined session parameters that define the connection attributes. For example, you create a Message Queue connection parameter called $QueueConnectionMyMQ and define it in the “[s_MySession]” section in the parameter file. The Integration Service searches this section of the parameter file for the “rows per message” parameter, $Param_QueueConnectionMyMQ_Rows_Per_Message.

Page 9: Managing Connection Objects

When you install PowerCenter, the installation program creates a template file named ConnectionParam.prm that lists the connection attributes you can override for FTP, queue, loader, and application connections. The ConnectionParam.prm file is located in the following directory:

<PowerCenter Installation Directory>/server/bin

When you define a connection in the parameter file, copy the template for the appropriate connection type and paste it into the parameter file. Then supply the parameter values.

For example, to override connection attributes for an FTP connection in the parameter file, perform the following steps:

1. Configure the session or workflow to run with a parameter file. For more information, see Configuring the Parameter File Name and Location.

2. In the session properties Mapping tab, select the source or target instance in the Connections node.

3.

Click the Open button in the value field and configure the connection to use a session parameter. For example, use $FTPConnectionMyFTPConn for an FTP connection.

4.

Open the ConnectionParam.prm template file in a text editor and scroll down to the section for the connection type whose attributes you want to override. For example, for an FTP connection, locate the “Connection Type: FTP” section:

                    Connection Type : FTP                    ---------------------

...

Template====================$FTPConnection<VariableName>=$Param_FTPConnection<VariableName>_Remote_Filename=$Param_FTPConnection<VariableName>_Is_Staged=$Param_FTPConnection<VariableName>_Is_Transfer_Mode_ASCII=

5.

Copy the template text for the connection attributes you want to override. For example, to override the “Remote File Name” and “Is Staged” attributes, copy the following lines:

$FTPConnection<VariableName>=$Param_FTPConnection<VariableName>_Remote_Filename=$Param_FTPConnection<VariableName>_Is_Staged=

6. Paste the text into the parameter file. Replace <VariableName> with the connection name, and supply the parameter values. For example:

[MyFolder.WF:wf_MyWorkflow.ST:s_MySession]

$FTPConnectionMyFTPConn=FTP_Conn1$Param_FTPConnectionMyFTPConn_Remote_Filename=ftp_src.txt$Param_FTPConnectionMyFTPConn_Is_Staged=YES

Page 10: Managing Connection Objects

Note: The Integration Service interprets spaces or quotation marks before or after the equals sign as part of the parameter name or value.

If you do not define a value for an attribute, the Integration Service uses the value defined for the connection object.

FTP Connections

Before you can configure a session to use FTP or SFTP, you must create and configure the FTP connection properties in the Workflow Manager. The Integration Service uses the FTP connection properties to create an SFTP or FTP connection.

To create an FTP connection:

1. In the Workflow Manager, connect to a repository.2. Click Connections > FTP. The FTP Connection Browser appears.3. Click New.4. Enter the properties for the FTP connection.Table 2-3 describes the properties that you configure for an FTP connection:

Table 2-3. FTP Connection Properties

Property DescriptionName Connection name used by the Workflow Manager.User Name User name necessary to access the host machine. Must be in 7-bit

ASCII only. Required to connect to an SFTP server with password based authentication.To define the user name in the parameter file, enter session parameter $ParamName as the user name, and define the value in the session or workflow parameter file. The Integration Service interprets user names that start with $Param as session parameters.

Use Parameter in Password

Indicates the password for the user name is a session parameter, $ParamName. If you enable this option, define the password in the workflow or session parameter file, and encrypt it using the pmpasswd CRYPT_DATA option. Default is disabled.

Password Password for the user name. Must be in 7-bit ASCII only. Required to connect to an SFTP server with password based authentication.

Host Name Host name or dotted IP address of the FTP connection.Optionally, you can specify a port number between 1 and 65535, inclusive. If you do not specify a port number, the Integration Service uses 21 by default. Use the following syntax to specify the host name:hostname:port_number-or-IP address:port_numberWhen you specify a port number, enable that port number for FTP on the host machine.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

Page 11: Managing Connection Objects

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\ and specify data.out in the session, the Integration Service reads the path and file name as c:\staging\data.out.For SAP, you can leave this value blank. SAP sessions use the Source File Directory session property for the FTP remote directory. If you enter a value, the Source File Directory session property overrides it.

Retry Period Number of seconds the Integration Service attempts to reconnect to the FTP host if the connection fails. If the Integration Service cannot reconnect to the FTP host in the retry period, the session fails.Default value is 0 and indicates an infinite retry period.

Use SFTP Enables SFTP.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.

5. Click OK.

Using an SFTP Connection

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. For more information about SFTP authentication properties, see Table   2-3 .

Rules and Guidelines for Mainframes

Use the following guidelines when creating an FTP connection to a mainframe machine:

If you enter a mainframe file name in the default directory for a source or target, enter the closing quote. For example, if the file is located in the following default remote directory:

‘staging.

To access the file data from the default mainframe directory, enter the following in the Remote file name field:

data’

When the Integration Service begins or ends the session, it connects to the mainframe host and looks for the following directory and file name:

Page 12: Managing Connection Objects

‘staging.data’

If you want to use a file in a different directory, enter the directory and file name in the Remote file name field. For example, you might enter the following file name and directory:

‘overridedir.filename’

External Loader Connections

You configure external loader properties in the Workflow Manager when you create an external loader connection. You can also override the external loader connection in the session properties. The Integration Service uses external loader properties to create an external loader connection.

When you configure external loader settings, you might need to consult the database documentation for more information.

To create an external loader connection:

1. Click Connections > Loader in the Workflow Manager.The Loader Connection Browser dialog box appears.2. Click New. 3. Select an external loader type, and then click OK.The Loader Connection Editor dialog box appears.4. Enter the properties for the external loader connection:

Property DescriptionName Connection name used by the Workflow Manager. Connection name

cannot contain spaces or other special characters, except for the underscore.

User Name

Database user name with the appropriate read and write database permissions to access the database. If you use Oracle OS Authentication or IBM DB2 client authentication, enter PmNullUser. PowerCenter uses Oracle OS Authentication when the connection user name is PmNullUser and the connection is to an Oracle database. PowerCenter uses IBM DB2 client authentication when the connection user name is PmNullUser and the connection is to an IBM DB2 database.To define the user name in the parameter file, enter session parameter $ParamName as the user name, and define the value in the session or workflow parameter file. The Integration Service interprets user names that start with $Param as session parameters.

Use Parameter in Password

Indicates the password for the database user name is a session parameter, $ParamName. If you enable this option, define the password in the workflow or session parameter file, and encrypt it using the pmpasswd CRYPT_DATA option. Default is disabled.

Password Password for the database user name. For Oracle OS Authentication or IBM DB2 client authentication, enter PmNullPassword. For Teradata connections, you can enter PmNullPasswd to prevent the password from appearing in the control file. Instead, the Integration Service writes an empty string for the password in the control file.Passwords must be in 7-bit ASCII.

Connect Connect string used to communicate with the database. For syntax,

Page 13: Managing Connection Objects

String see Database Connect Strings. 5. Enter the loader connection attributes.6. Click OK.