Vous êtes sur la page 1sur 2

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:
\server\infa_shared\Backup

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.
Conclusion

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.

Vous aimerez peut-être aussi