Wednesday, January 18, 2012

Working with Deployment Groups in Informatica

Deployment Groups

For versioned repositories, the use of Deployment Groups for migrations between distributed environments allows the most flexibility and convenience. With Deployment Groups, you can migrate individual objects as you would in an object copy migration, but can also have the convenience of a repository- or folder-level migration as all objects are deployed at once. The objects included in a deployment group have no restrictions and can come from one or multiple folders. Additionally, for additional convenience, you can set up a dynamic deployment group that allows the objects in the deployment group to be defined by a repository query, rather than being added to the deployment group manually. Lastly, because deployment groups are available on versioned repositories, they also have the ability to be rolled back, reverting to the previous versions of the objects, when necessary.

Advantages of Using Deployment Groups

Ø Backup and restore of the Repository needs to be performed only once.

Ø Copying a Folder replaces the previous copy.

Ø Copying a Mapping allows for different names to be used for the same object.

Ø Uses for Deployment Groups

o Deployment Groups are containers that hold references to objects that need to be migrated.

o Allows for version-based object migration.

o Faster and more flexible than folder moves for incremental changes.

o Allows for migration “rollbacks”

o Allows specifying individual objects to copy, rather than the entire contents of a folder.

Types of Deployment Groups

Ø Static

o Contain direct references to versions of objects that need to be moved.

o Users explicitly add the version of the object to be migrated to the deployment group.

Ø Dynamic

o Contain a query that is executed at the time of deployment.

o The results of the query (i.e. object versions in the repository) are then selected and copied to the target repository

Pre-Requisites

Create required folders in the Target Repository

Ø Creating Labels

o A label is a versioning object that you can associate with any versioned object or group of versioned objects in a repository.

Ø Advantages

o Tracks versioned objects during development.

o Improves query results.

o Associates groups of objects for deployment.

o Associates groups of objects for import and export.

Ø Create label

o Create labels through the Repository Manager.

o After creating the labels, go to edit mode and lock them.

o The "Lock" option is used to prevent other users from editing or applying the label.

o This option can be enabled only when the label is edited.

o Some Standard Label examples are:

o Development

o Deploy Test

o Test

o Deploy Production

o Production

Ø Apply Label

o Create a query to identify the objects that are needed to be queried.

o Run the query and apply the labels.

Note: By default, the latest version of the object gets labeled.

Queries

A query is an object used to search for versioned objects in the repository that meet specific conditions.

Ø Advantages

o Tracks objects during development

o Associates a query with a deployment group

o Finds deleted objects you want to recover

o Finds groups of invalidated objects you want to validate

Ø Create a query

o The Query Browser allows you to create, edit, run, or delete object queries

Ø Execute a query

o Execute through Query Browser

o EXECUTE QUERY: ExecuteQuery -q query_name -t query_type -u persistent_output_file_name -a append -c column_separator -r end-of-record_separator -l end-oflisting_indicator -b verbose

Creating a Deployment Group

Follow these steps to create a deployment group:

1. Launch the Repository Manager client tool and log in to the source repository.

2. Expand the repository, right-click on “Deployment Groups” and choose “New Group.”

3. In the dialog window, give the deployment group a name, and choose whether it should be static or dynamic. In this example, we are creating a static deployment group. Click OK.

Adding Objects to a Static Deployment Group

Follow these steps to add objects to a static deployment group:

1. In Designer, Workflow Manager, or Repository Manger, right-click an object that you want to add to the deployment group and choose “Versioning” -> “View History.” The “View History” window appears.

2. In the “View History” window, right-click the object and choose “Add to Deployment Group.”

3. In the Deployment Group dialog window, choose the deployment group that you want to add the object to, and click OK.

4. In the final dialog window, choose whether you want to add dependent objects. In most cases, you will want to add dependent objects to the deployment group so that they will be migrated as well. Click OK.

NOTE: The “All Dependencies” option should be used for any new code that is migrating forward. However, this option can cause issues when moving existing code forward because “All Dependencies” also flags shortcuts. During the deployment, Power Center tries to re-insert or replace the shortcuts. This does not work, and causes the deployment to fail.

The object will be added to the deployment group at this time.

Although the deployment group allows the most flexibility, the task of adding each object to the deployment group is similar to the effort required for an object copy migration. To make deployment groups easier to use, Power Center allows the capability to create dynamic deployment groups.

Adding Objects to a Dynamic Deployment Group

Dynamic Deployment groups are similar in function to static deployment groups, but differ in the way that objects are added. In a static deployment group, objects are manually added one by one. In a dynamic deployment group, the contents of the deployment group are defined by a repository query. Don’t worry about the complexity of writing a repository query, it is quite simple and aided by the PowerCenter GUI interface.

Follow these steps to add objects to a dynamic deployment group:

1. First, create a deployment group, just as you did for a static deployment group, but in this case, choose the dynamic option. Also, select the “Queries” button.

2. The “Query Browser” window appears. Choose “New” to create a query for the dynamic deployment group.

3. In the Query Editor window, provide a name and query type (Shared). Define criteria for the objects that should be migrated. The drop-down list of parameters lets you choose from 23 predefined metadata categories. In this case, the developers have assigned the “RELEASE_20050130” label to all objects that need to be migrated, so the query is defined as “Label Is Equal To ‘RELEASE_20050130’”. The creation and application of labels are discussed in Using Power Center Labels.

4. Save the Query and exit the Query Editor. Click OK on the Query Browser window, and close the Deployment Group editor window.

Executing a Deployment Group Migration

A Deployment Group migration can be executed through the Repository Manager client tool, or through the pmrep command line utility. With the client tool, you simply drag the deployment group from the source repository and drop it on the destination repository. This opens the Copy Deployment Group Wizard, which guides you through the step-by-step options for executing the deployment group.

Rolling Back a Deployment

To roll back a deployment, you must first locate the Deployment via the TARGET Repositories menu bar (i.e., Deployments -> History -> View History -> Rollback).

Automated Deployments

For the optimal migration method, you can set up a UNIX shell or Windows batch script that calls the pmrep DeployDeploymentGroup command, which can execute a deployment group migration without human intervention. This is ideal since the deployment group allows ultimate flexibility and convenience as the script can be scheduled to run overnight, thereby causing minimal impact on developers and the Power Center administrator. You can also use the pmrep utility to automate importing objects via XML.

Recommendations

Informatica recommends using the following process when running in a three-tiered environment with development, test, and production servers.

Non-Versioned Repositories

For migrating from development into test, Informatica recommends using the Object Copy method. This method gives you total granular control over the objects that are being moved. It also ensures that the latest development mappings can be moved over manually as they are completed. For recommendations on performing this copy procedure correctly, see the steps listed in the Object Copy section.

Versioned Repositories

For versioned repositories, Informatica recommends using the Deployment Groups method for repository migration in a distributed repository environment. This method provides the greatest flexibility in that you can promote any object from within a development repository (even across folders) into any destination repository. Also, by using labels, dynamic deployment groups, and the enhanced pmrep command line utility, the use of the deployment group migration method results in automated migrations that can be executed without manual intervention.

Third-Party Versioning

Some organizations have standardized on third-party version control software. Power Center’s XML import/export functionality offers integration with such software and provides a means to migrate objects. This method is most useful in a distributed environment because objects can be exported into an XML file from one repository and imported into the destination repository.

The XML Object Copy Process allows you to copy nearly all repository objects, including sources, targets, reusable transformations, mappings, mapplets, workflows, worklets, and tasks. Beginning with Power Center 7 and later versions, the export/import functionality allows the export/import of multiple objects to a single XML file. This can significantly cut down on the work associated with object level XML import/export.

The following steps outline the process of exporting the objects from source repository and importing them into the destination repository:

Exporting

1. From Designer or Workflow Manager, login to the source repository. Open the folder and highlight the object to be exported.

2. Select Repository -> Export Objects

3. The system prompts you to select a directory location on the local workstation. Choose the directory to save the file. Using the default name for the XML file is generally recommended.

4. Open Windows Explorer and go to the C:\Program Files\Informatica Power Center 7 and later versions x\Client directory. (This may vary depending on where you installed the client tools.)

5. Find the powrmart.dtd file, make a copy of it, and paste the copy into the directory where you saved the XML file.

6. Together, these files are now ready to be added to the version control software

Importing

Log into Designer or the Workflow Manager client tool and login to the destination repository. Open the folder where the object is to be imported.

1. Select Repository -> Import Objects.

2. The system prompts you to select a directory location and file to import into the repository.

3. The following screen appears with the steps for importing the object. Select the mapping and add it to the Objects to Import list.

4. Click "Next", and then click "Import". Since the shortcuts have been added to the folder, the mapping will now point to the new shortcuts and their parent folder.

5. It is important to note that the pmrep command line utility was greatly enhanced in Power Center 7 and later versions, allowing the activities associated with XML import/export to be automated through pmrep.

6. Click on the destination repository service on the left pane and choose the “Action drop-down list box “ -> “Restore.” Remember, if the destination repository has content, it has to be deleted prior to restoring).

2 comments:

Juan Rios said...

Awesome explanation...

Did you know how we can create users and groups easy way... Such like batch scripts...

Do you have a set of examples about the deployment group?

That would be really appreciated.

Regards

Unknown said...

excellent...!!!!!!!!