A Script For Informatica Repository Backups

Summary:   This tip will show you how to augment the pmrep command's backup function with environment variables to dynamically create the backup file names.  I've included a visual basic script that can be used to delete old backup files from any folder.  The result is a script you can schedule on your Windows server for unattended repository backups.

  • An example backup script and the visual basic script to delete files based on age can be downloaded here.
  • To fully utilize my example script you should be using the techniques described in my post about using Server Environment Variables
Getting Started
Using the PowerCenter command pmrep to backup repository contents is a relatively simple task.   First you connect to the repository and then execute the "backup" function of the pmrep command.

Here are a few suggestions to make your backup script more functional:

  • Use the PowerCenter repository name and system date as part of the backup file's name 
  • Schedule the backup to run nightly
  • Delete or archive old backups
Using Repository Name and System Date As The Back File Name
First let's review the pmrep backup function's syntax:

pmrep backup -o file_name.rep
In its simplest form the only option you have to supply the backup function is the file name for the backup (it is a good idea to include the .rep extension in the file name).  If you do not specify a path in the file name, the output defaults to folder:

To make your backup files easily identifiable, you can include the name of the repository and the current date as the backup file name.  If you are using a server environment variable to store your repository name, simply use that variable.

For maximum clarity in naming your backup files, combine the repository name environment variable with a variable containing the date.  This simple line of script will create a variable containing the system date in year, month, day format:

for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set yyyymmdd=%%k_%%i_%%j
When specifying a name for the backup file, combine your repository name variable and date variable as shown in this example:

pmrep backup %INFA_REPOSITORY%_%yyyymmdd%.rep
Using an effective naming convention as the one I've demonstrated helps you organize your backups and removes any guessing when a file is needed for restoration.

Schedule the Backup to Run Nightly
Once you have a working script, you should schedule it to run as often as required, nightly, weekly, etc.  Your company's job scheduler of choice should be sufficient to do the job.

Whatever job schedule you use, after a few weeks of running repository backups you will soon notice an abundant number of backup files accumulating on your server.  You can automate the archiving (or deletion) of these old files.

Deleting Old Backups
The examples file for this tip also contains a visual basic script that can delete (or archive) files in any folder. The script was taken from example code found on this Windows scripting website.

The script accepts two parameters, the name of the folder and the number of days used in the comparison of the file create date and the current date.

Run this script over the folder where your backup files stored as part of your backup process.

Creating a script to run the repository backup is just one example of combining environment variables and Informatica commands.

Please leave a comment if this tip is something you can use or if you have your own example.

Thank you for your support
 or  PayPal

IMPORTANT,  YOU are responsible for backing up your systems before trying or implementing any suggestions from this blog. I do not guarantee 100% accuracy of any code examples. I do not presume to know your system environment(s) or Security requirements; all code examples from this blog should be thoroughly tested before any attempted use on a production system.

8 Response to "A Script For Informatica Repository Backups"

  1. LakshmiNarasu 8/5/10, 2:57 AM
    Hi Kinzer,
    When I clicked on the download link, it says:

    "Sorry, the page (or document) you have requested is not available.

    Please check the address and try again."

    Kindly check this

  2. J. Kinzer 8/8/10, 3:22 PM
    Thank you Lakshminarasu. I have reposted the link please try the download again and let me know.

  3. Anonymous 5/3/13, 2:32 AM
    Thnks a lot and it's very useful for Infa users....

  4. Anonymous 1/28/15, 9:34 AM
    Hi Jeff, I'm unable to download the doc. Get the following error...

    403. That’s an error.

    We're sorry, but you do not have access to this page. That’s all we know.
  5. Irene Hynes 5/12/18, 3:56 AM

    Nice to be visiting your blog again, it has been months for me. Well this article that i’ve been waited for so long.

    Is there any other study content beyond the information provided by the courses?
    I"m about to schedule my exam (section 4 in the CDI certification), but wanted to ensure (or find out) if the exam will cover more then what is in the course content.

    But nice Article Mate! Great Information! Keep up the good work!

    Many Thanks,
    Irene Hynes
  6. Morgan lee 5/28/18, 4:31 AM
    Hi Kinzer,

    You make learning and reading addictive. All eyes fixed on you. Thank you being such a good and trust worthy guide.
    I started using Informatica IDQ training USA blog for my training practice.

    could you please check the link again that you've sent? I only get an error message that a Sharepoint error had occurred.

    As of my understanding the PowerExchange products cannot be used with PowerCenter Express (PCX). PCX does provide quite a few connectivity options, so if you can find some ODBC or JDBC driver to access SFDC you might be able to get your job done. Otherwise I fear you will have to switch to one of the full-fledged PowerCenter or Informatica Data Quality products.

    But great job man, do keep posted with the new updates.

    Best Regards,
  7. Ganesh Ponna 5/28/18, 5:03 AM

    Great info! I recently came across your blog and have been reading along.
    I thought I would leave my first comment. I don’t know what to say except that I have

    Please see, if you have all the required pre-requisites ready before creating the domain.
    Hope the Informatica setup is done with an admin user.

    This error has occurred while running the key encryption process of domain creation.
    Its possible Informatica IDQ training USA

    the required configuration to run the generateEncryptionKey command is missing or not accessible.

    Great effort, I wish I saw it earlier. Would have saved my day :)


  8. Kevin Lee 5/28/18, 5:16 AM
    Hi Kinzer,

    Hip Hip Hooray! I was always told that slightly slow in the head, a slow learner. Not anymore! It’s like you have my back. I can’t tell you how much I’ve learnt here and how easily! Thank you for blessing me with this effortlessly ingestible digestible content.

    It ensures validating and improving address information, profiling, and cleansing business data, or implementing a data governance practice, and other data quality requirements Informatica IDQ training USA.

    Do you know how I should configure connection to database in this situation?
    I am trying to install MDM V10.2 on my laptop . I am stuck at postinstallation setup step.
    SIPERIAM-MRM.EAR delployement failed Not sure what exactly the issue is. Can anyone please help.
    Some of the details: OS: Windows*10
    JBoss: JBoss EAP 6.4

    Very useful article, if I run into challenges along the way, I will share them here.

    Thank you,

Post a Comment