The session task

In the previous chapter, we discussed the basic properties of the session task.

The Session task is used to execute a mapping. It is the most widely used task among all the tasks of Workflow Manager. As you must have seen earlier, there are lots of properties that we can define in the session task. In the previous chapter, we discussed some of these properties, for example, the Mapping tab of the Session task. We learned how to provide the source, target, and lookup transformation details required to move the data. We will discuss the remaining properties in this chapter.

Tabs of the session task

Double-click on the session task to see the various tabs, as shown in the following screenshot:

Tabs of the session task

The various tabs of the session task are as follows:

  • General: As discussed in the preceding section, you can define the session name, rename the session name, and mention the description and other tasks related properties, as shown in the preceding section. We have discussed the General tab properties in the preceding section.
  • Properties: You can define the session log's filename, commit interval, test load setting, recovery settings, and other performance-related properties. The following screenshot shows you the General Options properties that can be defined under the Properties tab:
    Tabs of the session task

The description of the property shown in the preceding screenshot is as follows:

Property

Description

Write Backward Compatible Session Log File

You can select this option if you wish to write the generated session logs to a file. If you select this option, Informatica PowerCenter creates a log file, else it generates a normal session log file.

Session Log File Name

With this, you can define the session log filename. The default session log filename is SESSION_NAME.log. You can also define the parameters in this option. We will discuss the parameter file in detail later in the chapter. When you define the parameter, pass the value from the parameter file.

Session Log File Directory

With this, you can define the session log file directory. You can also define the parameters in this option. When you define the parameter, pass the value from the parameter file.

Parameter Filename

If you use the parameters and variables in your code, you need to pass the values from the parameter file. You can define the parameters' filename and path here.

Enable Test Load

You can select this option to allow only a few records to pass through the mapping. This option is useful when you are in the testing phase of your project.

Number of rows to test

When you select the Enable Test Load option, you can define the number of records you wish to flow from Mapping. Suppose you have 10,000 records to process. You can check the Enable Test Load option and mention the number of records you wish to test. So, if you define 100 records, Informatica will only process 100 records out of the 10,000 records.

$Source connection value

You can define the Database Connection value here. Consider that your database connection's name is ORACLE. If you define ORACLE at this place, you can select $Source in the Mapping tab for the source connection.

$Target connection value

You can define the Database Connection value here. Consider that your database connection's name is ORACLE. If you define ORACLE at this place, you can select $Target in the Mapping tab for the target connection.

Treat source rows as

This property allows you to treat records as INSERT, UPDATE, DELETE, or DATA DRIVEN for the records that come from a source. The default property is INSERT, which indicates all the records that come from a source will be inserted into the target.

The DATA DRIVEN property is selected when you use the update strategy transformation in Mapping. We will talk about the update strategy transformation in Chapter 7, The Lifeline of Informatica – Transformations.

Commit Type

You can select either a source-based or a target-based commit type. The default property is the target-based commit type.

If you select a source-based commit type, Informatica commits the data into the target-based commit type for commit interval and flush latency intervals. Flush latency is the time interval for which you wish to commit the data. If you define the flush latency as 5 seconds and the commit interval as 10,000, Informatica will commit the data to the target-based commit type for whichever interval it reached first. Flush latency is a property defined by the Informatica PowerCenter administrator. So, you need not be worried about how to set up this property. In most cases, data is committed based on the commit interval, so we don't use the flush latency property frequently.

If you select the target-based commit type, Informatica commits the data based on the commit interval.

Commit On End Of File

This option is selected by default. This property indicates that the records will be committed to the target. If the file contains a smaller number of records, then the commit interval is defined.

Rollback Transactions on Errors

When you select this option, Informatica will roll back the records at the next commit interval. This only happens if there is a nonfatal error.

Recovery Strategy

Using this property, you can recover the session task if the session happens to fail. Various options are available in this property, which you can select based on your requirement:

  • Fail session and continue the workflow: If you select this option, you cannot recover your session task. The session will fail if it encounters an error but will continue the workflow.
  • Restart Task: If you select this option, the session task restarts when the workflow is recovered after a failure.
  • Resume from last checkpoint: If you select this option, Informatica saves the start of the session task and resumes the session from the last checkpoint.

Java Classpath

Use this option if you wish to use different types of Java packages in a Java transformation.

The following screenshot shows you the Performance properties that can be defined under the Properties tab:

Tabs of the session task

The description of the properties shown in the preceding screenshot is as follows:

Property

Description

DTM buffer size

This indicates how much memory you wish to assign for the DTM processes. When you create a session, Informatica assigns a specific value for the DTM. You can make the value Auto, so Informatica keeps on increasing the value automatically, if required.

Collect performance data

If you select this option, Informatica collects the performance data as it runs the session. Usually, you do not select this option unless you really need to find the performance. This option can actually hamper your performance in some way, because it takes some time to collect the performance details. So, unless it's very important, do not check this option.

Write performance data to repository

You can save the performance collected for the session run to the repository so that you can check the details later. This again hampers the performance, so unless required, do not check this option.

Incremental Aggregation

If you wish to make use of incremental aggregation, check this option.

We will discuss this in more detail later in the chapter.

Reinitialize aggregate cache

If you are using incremental aggregation, you can use this option. When you use incremental aggregation, Informatica stores the data of the previous run in the cache memory. If you wish to reinitialize the value, select this option.

We will discuss this in more detail later in the chapter.

Enable high precision

If you select this option, Informatica processes the decimal data to a precision of 28. Usually, you leave this option unchecked.

Session retry on deadlock

If you select this option, Informatica tries to load the data into target if it finds the deadlock. So, instead of giving an error, it tries to load the data again.

This option is available only for normal load and not for bulk load setting.

Allow Temporary View for Pushdown

If you select this option, Informatica creates a temporary view in the database when you use the Pushdown feature.

Pushdown optimization is a feature that we will discuss with performance in the next chapter.

Allow Temporary Sequence for Pushdown

If you select this option, Informatica creates a temporary sequence in the database when you use the Pushdown feature.

Allow Pushdown for User Incompatible Connections

This property indicates that the user through which you are accessing the database used in the session has read permission. If the user does not have the read permission, the session task fails.

Session Sort Order

You can select the sort order for your session. The default sort order is binary.

In the Config Object tab, you can select the Advanced setting, Log Options, the Error handling properties, and Partitioning Options.

The advanced settings under the Config Object tab are shown in the following screenshot:

Tabs of the session task

The description of the properties shown in the preceding screenshot is as follows:

Property

Description

Constraint based load ordering

If you check this option, the data is loaded into the target based on the relationship between the primary key and the foreign key wherever possible.

Cache LOOKUP() function

This property is related to the lookup transformation functionality. By default, lookup transformation performs a row-by-row operation. If you check this option, Informatica overrides mapping level lookup settings.

Default buffer block size

This option specifies the size of the buffer block you wish to assign for the data cache and index cache movement from the source to the target. By default, it is set to Auto, so the size is automatically increased as required.

Line Sequential Buffer Length

This property is related to the number of bytes in an individual record in a flat file. The default value is 1024 bytes. If your records have a larger byte length, increase the value as per the requirement.

Maximum Memory Allowed For Auto Memory Attributes

This setting is related to the amount of memory allocated to the session cache at runtime.

Maximum Percentage of Total Memory Allowed for Auto Memory Attributes

This setting is related to the percentage of memory allocated to the session cache at runtime.

Additional Concurrent Pipelines for Lookup Cache Creation

This setting is related to the creation of concurrent caches by creating an additional pipeline for the lookup transformation. By default, the value is set to Auto, which indicates that the value will be decided at runtime.

Informatica caches the data either concurrently or sequentially. If you set this property to 0, Informatica processes the lookup cache sequentially.

Custom Properties

You can customize some of the default properties for the session. Usually, we need not change the settings.

The Log Options setting under the Config Object tab is shown in the following screenshot:

Tabs of the session task

The description of the property shown in the preceding screenshot is as follows:

Property

Description

Save session log by

You have the option to save the session log file by either session runs or timestamp.

When you set the option as a session run, Informatica saves a specific number of session log files. You can set the number of log files to be saved in the Save Session Log for These Runs option.

When you set the option as Timestamp, Informatica saves the session log file by appending the timestamp to the log filename.

When you save the history of session log files, you can use the files to compare the files in case of any errors.

Save session log for these runs

This option allows you to define the number of session log files you wish to save in order to maintain the history of log files. By default, the session log files are overwritten. The maximum number of history you can maintain is 2,147,483,647.

Session Log File Max Size

With this, you can define the maximum size of the session log file. If the log file size exceeds the value defined in this property, a new log file is created. The default value is 0.

Session Log File Max Time Period

With this, you can define the maximum number of hours for which the information is written for a session log file. If the maximum time exceeds the value defined in this property, a new log file is created. The default value is 0.

Maximum Partial Session Log Files

With this, you can define the maximum number of log files to be saved. If the number of files exceeds the value defined in this property, the oldest file is overwritten.

Writer Commit Statistics Log Frequency

With this, you can define the frequency at which the commit statistics are written to the session log. The default value is 1.

Writer Commit Statistics Log Interval

With this, you can define the time interval at which the commit statistics are written to the session log. The time is defined in minutes.

The Error handling properties under the Config Object tab is shown in the following screenshot:

Tabs of the session task

The description of the property shown in the preceding screenshot is as follows:

Property

Description

Stop on errors

This option defines the number of errors till you do not wish to fail the workflow. If you set this as 5, Informatica will keep on running till it encounters 5 error rows. On sixth error record, Informatica will fail the workflow.

Override tracing

You can override the tracing level set in the mapping. If you defined the tracing level as Terse in Mapping and you selected the Normal Tracing level in Session, Informatica will take the tracing level as normal and reject the setting in the mapping. Various options that are available are None, Terse, Normal, Verbose Initialization, and Verbose Data.

On Stored Procedure error

You can select this option to define what should happen if there is any pre- or post-session stored procedure error.

If you select the Stop option, the session will fail if it encounters an error in the stored procedure.

If you select the Continue option, the session will continue even if it encounters an error in Stored Procedure.

On Pre-session command task error

You can use this option when you use the Pre-session Command task in the Session task.

If you select the Stop option, the session will fail if it encounters an error in the pre-session command.

If you select the Continue option, the session will continue even if it encounters an error in the pre-session command.

On Pre-Post SQL error

You can use this option when you use a pre- or post- SQL command in the session task.

If you select the Stop option, the session will fail if it encounters an error in the pre- or post- SQL command.

If you select the Continue option, the session will continue even if it encounters an error in the pre- or post- SQL command.

Error Log Type

You can use this option to define the type of error log to be generated. The available options are Flat File, Relational Database, or None. The default setting is set to None.

Error Log DB Connection

If you select Error Log Type as Relational Database, this option gets enabled. You can specify the Database Connection details for Error Log.

Error Log Table Name Prefix

With this, you can mention the table name you created to store the error logs.

Error Log File Directory

If you select the error log type as Flat File, this option gets enabled. You can specify the file directory details for the error log.

Error Log File Name

With this, you can mention the name of the error log file.

Log Row Data

If you select this option, you can save the row-level transformation data into the log.

Log Source Row Data

If you select this option, you can save the source-row-level data into the log. The data is not saved by default.

Data Column Delimiter

You can define the delimiters to be used when saving the row data and source row data. The default delimiter is the (|) pipeline.

The Partitioning Options property under the Config Object tab is shown in the following screenshot:

Tabs of the session task

The description of the property shown in the preceding screenshot is as follows:

Property

Description

Dynamic Partitioning

You can enable the partitioning option for which you run the process. The default setting is disabled. This is available only if you have the partitioning license available.

The various options available are Based on number of partitions, Based on number of nodes in grid, Based on source partitioning, and Based on number of CPUs.

Number of Partitions

You can define the number of partitions you wish to set.

Edit Tasks also has the following tabs:

  • Mapping: With this you can define the session, target, and lookup transformation path or connection. We discussed this tab in the previous chapter.
  • Components: With this, you can define pre- or post- Command and Email tasks. This acts as a replacement for the Command and Email tasks.

The Components tab is shown in the following screenshot:

Tabs of the session task

The description of the property shown in the preceding screenshot is as follows:

Property

Description

Pre-Session Command

You can use this option as a replacement for the command task used before the session task. You can define reusable or nonreusable types and also define the shell command you wish to mention in the command task. Informatica executes the pre-session command before it executes the session task.

We will talk about the command task in detail later in the chapter.

Post-Session Success Command

You can use this option as a replacement for the post-session success command task used after the session task. You can define reusable or nonreusable types and also define the shell command you wish to mention in the command task. Informatica executes the post-session command after the successful completion of the session task. You need not define any condition in the link.

Post-Session Failure Command

You can use this option as a replacement for the post-session failure command task used after the session task. You can define reusable or nonreusable types and also define the shell command you wish to mention in the command task. Informatica executes the post-session command if the session task fails.

On Success E-mail

You can use this option as a replacement for the post-session success Email task used after the Session task. You can define reusable or nonreusable types and also define the e-mail properties you wish to mention in the Email task. Informatica executes the Post-Session E-mail after the successful execution of the session task.

On Failure E-mail

You can use this option as a replacement for the post-session failure Email task used after the Session task. You can define reusable or nonreusable types and also define the e-mail property you wish to mention in the Email task. Informatica executes the post-session e-mail if the session task fails.

Pre-session variable assignment

You can assign values to various parameters and variables used in the mapping and session before the session is executed.

Post-session on success variable assignment

You can assign values to various parameters and variables used in the workflow and worklet after the session is executed successfully.

Post-session on failure variable assignment

You can assign values to various parameters and variables used in the workflow and worklet if the session task fails.

The Metadata Extensions tab helps define metadata-extension-related properties. Usually, we do not use this tab. It is used to define general information related to the workflow or to define the project-level information that can be used in future for reference purposes.

Creating a session task

To create a session task in Workflow Manager or Task Developer, perform the following steps:

  1. In Workflow Manager or Task Developer, navigate to Tasks | Create.
    Creating a session task

    Tip

    This step is the first step to be performed when creating any task.

  2. From the list of tasks, select the Session task and specify the name of the session task as s_TASK_NAME. For our reference, we are using the session task name as s_CONCAT_TOTAL or s_m_CONCAT_TOTAL, where m_CONCAT_TOTAL is the mapping name for which we are creating the session. Click on Create.
    Creating a session task
  3. In the next window, select the mapping you wish to associate in the session. When you run the session, it makes the data flow from the source to the target in the mapping you selected. Note that once you associate a mapping to a session, you cannot change the mapping. Click on OK, and then click on Done.
    Creating a session task

The session task appears in Workflow Manager or Task Developer. Use the Link task to connect the start task to the session task:

Creating a session task
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset