Documente Academic
Documente Profesional
Documente Cultură
By PenchalaRaju.Yanamala
Workflow recovery allows you to continue processing the workflow and workflow
tasks from the point of interruption. You can recover a workflow if the Integration
Service can access the workflow state of operation. The workflow state of
operation includes the status of tasks in the workflow and workflow variable
values. The Integration Service stores the state in memory or on disk, based on
how you configure the workflow:
Enable recovery. When you enable a workflow for recovery, the Integration
Service saves the workflow state of operation in a shared location. You can
recover the workflow if it terminates, stops, or aborts. The workflow does not
have to be running.
Suspend. When you configure a workflow to suspend on error, the Integration
Service stores the workflow state of operation in memory. You can recover the
suspended workflow if a task fails. You can fix the task error and recover the
workflow.
The Integration Service recovers tasks in the workflow based on the recovery
strategy of the task. By default, the recovery strategy for Session and Command
tasks is to fail the task and continue running the workflow. You can configure the
recovery strategy for Session and Command tasks. The strategy for all other
tasks is to restart the task.
When the Integration Service runs in safe mode, it stores the state of operation
for workflows configured for recovery. If the workflow fails the Integration Service
fails over to a backup node, the Integration Service does not automatically
recover the workflow. You can manually recover the workflow if you have the
appropriate privileges on the Integration Service.
State of Operation
When you recover a workflow or session, the Integration Service restores the
workflow or session state of operation to determine where to begin recovery
processing. The Integration Service stores the workflow state of operation in
memory or on disk based on the way you configure the workflow. The Integration
Service stores the session state of operation based on the way you configure the
session.
The Integration Service stores the workflow state of operation when you enable
the workflow for recovery or for suspension. When the workflow is suspended,
the state of operation is in memory.
When you enable a workflow for recovery, the Integration Service stores the
workflow state of operation in the shared location, $PMStorageDir. The
Integration Service can restore the state of operation to recover a stopped,
aborted, or terminated workflow. When it performs recovery, it restores the state
of operation to recover the workflow from the point of interruption. When the
workflow completes, the Integration Service removes the workflow state of
operation from the shared folder.
When you run concurrent workflows, the Integration Service appends the
instance name or the workflow run ID to the workflow recovery storage file in
$PMStorageDir.
When you enable a workflow for recovery the Integration Service does not store
the session state of operation by default. You can configure the session recovery
strategy to save the session state of operation.
When you configure the session recovery strategy to resume from the last
checkpoint, the Integration Service stores the session state of operation in the
shared location, $PMStorageDir. The Integration Service also saves relational
target recovery information in target database tables. When the Integration
Service performs recovery, it restores the state of operation to recover the
session from the point of interruption. It uses the target recovery data to
determine how to recover the target tables.
You can configure the session to save the session state of operation even if you
do not save the workflow state of operation. You can recover the session, or you
can recover the workflow from the session.
Source. If the output from a source is not deterministic and repeatable, the
Integration Service saves the result from the SQL query to a shared storage file
in $PMStorageDir. The Integration Service saves the result from the SQL query
to a shared storage file in $PMStorageDir.
Transformation. The Integration Service creates checkpoints in $PMStorageDir
to determine where to start processing the pipeline when it runs a recovery
session.
When you run a session with an incremental Aggregator transformation, the
Integration Service creates a backup of the Aggregator cache files in
$PMCacheDir at the beginning of a session run. The Integration Service
promotes the backup cache to the initial cache at the beginning of a session
recovery run.
Relational target recovery data. The Integration Service writes recovery
information to recovery tables in the target database to determine the last row
committed to the target when the session was interrupted.
Related Topics:
Working with Repeatable Data
When the Integration Service runs a session that has a resume recovery
strategy, it writes to recovery tables on the target database system. When the
Integration Service recovers the session, it uses information in the recovery
tables to determine where to begin loading data to target tables.
If you want the Integration Service to create the recovery tables, grant table
creation privilege to the database user name configured in the target database
connection. If you do not want the Integration Service to create the recovery
tables, create the recovery tables manually.
The Integration Service creates the following recovery tables in the target
database:
PM_RECOVERY. Contains target load information for the session run. The
Integration Service removes the information from this table after each
successful session and initializes the information at the beginning of subsequent
sessions.
PM_TGT_RUN_ID. Contains information the Integration Service uses to identify
each target on the database. The information remains in the table between
session runs. If you manually create this table, you must create a row and enter
a value other than zero for LAST_TGT_RUN_ID to ensure that the session
recovers successfully.
PM_REC_STATE. Contains information the Integration Service uses to
determine if it needs to write messages to the target table during recovery for a
real-time session.
If you edit or drop the recovery tables before you recover a session, the
Integration Service cannot recover the session. If you disable recovery, the
Integration Service does not remove the recovery tables from the target
database. You must manually remove the recovery tables.
Note: When concurrent recovery sessions write to the same target database, the
Integration Service may encounter a deadlock on PM_RECOVERY. To retry
writing to PM_RECOVERY on deadlock, you can configure the Session Retry on
Deadlock option to retry the deadlock for the session.
Related Topics:
Deadlock Retry
PM_REC_STATE Table
You can manually create the target recovery tables. Informatica provides SQL
scripts in the following directory:
<PowerCenter installation_dir>\server\bin\RecoverySQL
Run one of the following scripts to create the recovery tables in the target
database:
Script Database
create_schema_db2.sql IBM DB2
create_schema_inf.sql Informix
create_schema_ora.sql Oracle
create_schema_sql.sql Microsoft SQL Server
create_schema_syb.sql Sybase
create_schema_ter.sql Teradata
Recovery Options
To perform recovery, you must configure the mapping, workflow tasks, and the
workflow for recovery.
Table 13-4 describes the options that you can configure for recovery:
To configure a workflow for recovery, you must enable the workflow for recovery
or configure the workflow to suspend on task error. When the workflow is
configured for recovery, you can recover it if it stops, aborts, terminates, or
suspends.
For more information about workflow status, Workflow and Task Status.
When you enable a workflow for recovery, the Integration Service saves the
workflow state of operation to a file during the workflow run. You can recover a
stopped, terminated, or aborted workflow. Enable recovery on the Properties tab
of the workflow.
You can also configure the workflow to send an email when a task suspends.
When you enable workflow recovery, you can recover a task that you abort or
stop. You can recover a task that terminates due to network or service process
failures. When you configure a workflow to suspend on error, you can recover a
failed task when you recover the workflow.
Each task in a workflow has a recovery strategy. When the Integration Service
recovers a workflow, it recovers tasks based on the recovery strategy:
Restart task. When the Integration Service recovers a workflow, it restarts each
recoverable task that is configured with a restart strategy. You can configure
Session and Command tasks with a restart recovery strategy. All other tasks
have a restart recovery strategy by default.
Fail task and continue workflow. When the Integration Service recovers a
workflow, it does not recover the task. The task status becomes failed, and the
Integration Service continues running the workflow.
Configure a fail recovery strategy if you want to complete the workflow, but you
do not want to recover the task. You can configure Session and Command tasks
with the fail task and continue workflow recovery strategy.
Resume from the last checkpoint. The Integration Service recovers a
stopped, aborted, or terminated session from the last checkpoint. You can
configure a Session task with a resume strategy.
Table 13-7 describes the recovery strategy for each task type:
When you configure a Command task, you can choose a recovery strategy to
restart or fail:
Fail task and continue workflow. If you want to suspend the workflow on
Command task error, you must configure the task with a fail strategy. If the
Command task has more than one command, and you configure a fail strategy,
you need to configure the task to fail if any command fails.
Restart task. When the Integration Service recovers a workflow, it restarts a
Command task that is configured with a restart strategy.
Configure the recovery strategy on the Properties page of the Command task.
Related Topics:
Working with the Command Task
When you configure a session for recovery, you can recover the session when
you recover a workflow, or you can recover the session without running the rest
of the workflow.
When you configure a session, you can choose a recovery strategy of fail,
restart, or resume:
Resume from the last checkpoint. The Integration Service saves the session
state of operation and maintains target recovery tables. If the session aborts,
stops, or terminates, the Integration Service uses the saved recovery
information to resume the session from the point of interruption.
Restart task. The Integration Service runs the session again when it recovers
the workflow. When you recover with restart task, you might need to remove the
partially loaded data in the target or design a mapping to skip the duplicate
rows.
Fail task and continue workflow. When the Integration Service recovers a
workflow, it does not recover the session. The session status becomes failed,
and the Integration Service continues running the workflow.
Configure the recovery strategy on the Properties page of the Session task.
When you have the high availability option, you can configure automatic recovery
of terminated tasks. When you enable automatic task recovery, the Integration
Service recovers terminated Session and Command tasks without user
intervention if the workflow is still running. You configure the number of times the
Integration Service attempts to recover the task. Enable automatic task recovery
in the workflow properties.
Resuming Sessions
When you configure session recovery to resume from the last checkpoint, the
Integration Service creates checkpoints in $PMStorageDir to determine where to
start processing session recovery. When the Integration Service resumes a
session, it restores the session state of operation, including the state of each
source, target, and transformation. The Integration Service determines how much
of the source data it needs to process.
When the Integration Service resumes a session, the recovery session must
produce the same data as the original session. The session is not valid if you
configure recovery to resume from the last checkpoint, but the session cannot
produce repeatable data.
The Integration Service can recover flat file sources including FTP sources. It can
truncate or append to flat file and FTP targets.
When you recover a session from the last checkpoint, the Integration Service
restores the session state of operation to determine the type of recovery it can
perform:
Table 13-8 describes when the Integration Service performs incremental or full
recovery, depending on the session configuration:
When you configure recovery to resume from the last checkpoint, the recovery
session must be able to produce the same data in the same order as the original
session.
When you validate a session, the Workflow Manager verifies that the
transformations are configured to produce repeatable and deterministic data. The
session is not valid if you configure recovery to resume from the last checkpoint,
but the transformations are not configured for repeatable and deterministic data.
Session data is repeatable when all targets receive repeatable data from the
following mapping objects:
Source. The output data from the source is repeatable between the original run
and the recovery run. For more information, see Source Repeatability.
Transformation. The output data from each transformation to the target is
repeatable. For more information, see Transformation Repeatability.
Source Repeatability
You can resume a session from the last checkpoint when each source generates
the same set of data and the order of the output is repeatable between runs.
Source data is repeatable based on the type of source in the session.
Relational Source
A relational source might produce data that is not the same or in the same order
between workflow runs. When you configure recovery to resume from the last
checkpoint, the Integration Service stores the SQL result in a cache file to
guarantee the output order for recovery.
If you know the SQL result will be the same between workflow runs, you can
configure the source qualifier to indicate that the data is repeatable and
deterministic. When the relational source output is deterministic and the output is
always repeatable, the Integration Service does not store the SQL result in a
cache file. When the relational output is not repeatable, the Integration Service
can skip creating the cache file if a transformation in the mapping always
produces ordered data.
SDK Source
A flat file does not change between session and recovery runs. If you change a
source file before you recover a session, the recovery session might produce
unexpected results.
Transformation Repeatability
You can configure a session to resume from the last checkpoint when
transformations in the session produce the same data between the session and
recovery run. All transformations have properties that determine if the
transformation can produce repeatable data. A transformation can produce the
same data between a session and recovery run if the output is deterministic and
the output is repeatable.
Output is Deterministic
Output is Repeatable
Always. The order of the output data is consistent between session runs even if
the order of the input data is inconsistent between session runs.
Based on input order. The transformation produces repeatable data between
session runs when the order of the input data from all input groups is consistent
between session runs. If the input data from any input group is not ordered, then
the output is not ordered.
When a transformation generates repeatable data based on input order, during
session validation, the Workflow Manager validates the mapping to determine if
the transformation can produce repeatable data. For example, an Expression
transformation produces repeatable data only if it receives repeatable data.
Never. The order of the output data is inconsistent between session runs.
You can recover a workflow if you configure the workflow for recovery. You can
recover a session when you configure a session recovery strategy. When you
configure a session recovery strategy, you do not have to enable workflow
recovery to recover a session.
You can use one of the following methods to recover a workflow or task:
Recover a workflow. Continue processing the workflow from the point of
interruption.
Recover a session. Recover a session but not the rest of the workflow.
Recover a workflow from a session. Recover a session and continue
processing a workflow.
If the Integration Service uses operating system profiles, recover the session or
workflow using the same operating system profile that the Integration Service
used to run the session or workflow.
If you want to restart a workflow or task without recovery, you can restart the
workflow or task in cold start mode. Recovery behavior for real-time sessions
varies depending on the real-time source.
Related Topics:
Restarting and Recovering Real-time Sessions
Restarting a Task or Workflow Without Recovery
Recovering a Workflow
When you recover a workflow, the Integration Service restores the workflow state
of operation and continues processing from the point of failure. The Integration
Service uses the task recovery strategy to recover the task that failed.
You can recover a workflow using the Workflow Manager, the Workflow Monitor,
or pmcmd.
Select the workflow in the Navigator or open the workflow in the Workflow
1.Designer workspace.
2.Right-click the workflow and choose Recover Workflow.
The Integration Service recovers the interrupted tasks and runs the rest of the
workflow.
You can also use the pmcmd recoverworkflow command to recover a workflow.
Recovering a Session
Double-click the workflow in the Workflow Monitor to expand it and display the
1.task.
2.Right-click the session and choose Recover Task.
The Integration Service recovers the failed session according to the recovery
strategy.
You can also use the pmcmd starttask with the -recover option to recover a
session.
Related Topics:
Task Recovery Strategies
If a session stops, aborts, or terminates and the workflow does not complete, you
can recover the workflow from a session if you configured a session recovery
strategy. When you recover the session, the Integration Service uses the
recovery strategy to recover the session and continue the workflow. You can
recover a session even if you do not suspend the workflow or enable workflow
recovery.
Double-click the workflow in the Workflow Monitor to expand it and display the
1.session.
2.Right-click the session and choose Recover Workflow from Task.
The Integration Service recovers the failed session according to the recovery
strategy.
You can use the pmcmd startworkflow with the -recover option to recover a
workflow from a session.
Note: To recover a session within a worklet, expand the worklet and then choose
to recover the task.
The Integration Service creates a new session log when it runs a recovery
session.
A session reports performance statistics for the last successful run.
You can recover a session containing a transformation that uses the random
number generator (RAND) function if you provide a seed parameter.
Configuring Recovery to Resume from the Last Checkpoint
Use the following rules and guidelines when configuring recovery to resume from
last checkpoint:
In some cases, the Integration Service cannot recover a workflow or task. You
cannot recover a workflow or task under the following circumstances:
You change the number of partitions. If you change the number of partitions
after a session fails, the recovery session fails.
The interrupted task has a fail recovery strategy. If you configure a
Command or Session recovery to fail and continue the workflow recovery, the
task is not recoverable.
Recovery storage file is missing. The Integration Service fails the recovery
session or workflow if the recovery storage file is missing from $PMStorageDir
or if the definition of $PMStorageDir changes between the original and recovery
run.
Recovery table is empty or missing from the target database. The
Integration Service fails a recovery session under the following circumstances:
-
You deleted the table after the Integration Service created it.
-The session enabled for recovery failed immediately after the Integration Service
removed the recovery information from the table.
You might get inconsistent data if you perform recovery under the following
circumstances:
The sources or targets change after the initial session. If you drop or create
indexes or edit data in the source or target tables before recovering a session,
the Integration Service may return missing or repeat rows.
The source or target code pages change after the initial session failure. If
you change the source or target code page, the Integration Service might return
incorrect data. You can perform recovery if the code pages are two-way
compatible with the original code pages.