Command Reference > pmrep Command Reference > Using pmrep
  

Using pmrep

pmrep is a command line program that you use to update repository information and perform repository functions. pmrep is installed in the PowerCenter Client and PowerCenter Services bin directories.
Use pmrep to perform repository administration tasks such as listing repository objects, creating and editing groups, restoring and deleting repositories, and updating session-related parameters and security information in the PowerCenter repository.
When you use pmrep, you can enter commands in the following modes:
You can use environment variables to set user names and passwords for pmrep. Before you use pmrep, configure these variables. The environment variables apply to pmrep commands that run on the node.
All pmrep commands require a connection to the repository except for the following commands:
Use the pmrep Connect command to connect to the repository before using other pmrep commands.

Running Commands in Command Line Mode

Command line mode invokes and exits pmrep each time you issue a command. Command line mode is useful if you want to run pmrep commands through batch files, scripts, or other programs.
To run pmrep commands in command line mode:
    1. At the command prompt, change to the directory where the pmrep executable is located.
    2. Enter pmrep followed by the command name and its options and arguments:
    pmrep command_name [-option1] argument_1 [-option2] argument_2...

Running Commands in Interactive Mode

Interactive mode invokes pmrep. You can issue a series of commands from a pmrep prompt without exiting after each command.
To run pmrep commands in interactive mode:
    1. At the command prompt, enter pmrepto invoke interactive mode.
    This starts pmrep in interactive mode and displays a pmrep> prompt. You do not have to type pmrep before each command in interactive mode.
    2. Enter a command and its options and arguments.
    At the prompt, enter:

    command_name [-option1] argument_1 [-option2] argument_2...
    pmrep runs the command and displays the prompt again.
    3. Type exit to end an interactive session.

Running Commands in Normal Mode and Exclusive Mode

The Repository Service runs in normal or exclusive mode. Run the Repository Service in exclusive mode to perform tasks that permit only one user connection to the repository.
Run the Repository Service in exclusive mode to use the following pmrep commands:
You can use the Administrator tool or infacmd to run the Repository Service in exclusive mode.

pmrep Return Codes

pmrep indicates the success or failure of a command with a return code. Return code “0” indicates that the command succeeded. Return code “1” indicates that the command failed. Some commands perform multiple operations. For example, AddToDeploymentgroup adds multiple objects to a deployment group. In these cases, a Return code “0” indicates that the command was executed successfully even if only some of the objects were deployed successfully.
Enter one of the following DOS or UNIX echo commands immediately after running the pmrep command:

Using Native Connect Strings

Some pmrep commands, such as CreateConnection and Restore, require a native connect string.
The following table describes the native connect string syntax for each supported repository database:
Database
Connect String Syntax
Example
IBM DB2
dbname
mydatabase
Microsoft SQL Server
servername@dbname
sqlserver@mydatabase
Oracle
dbname.world (same as TNSNAMES entry)
oracle.world
Sybase ASE
servername@dbname
sambrown@mydatabase

Scripting pmrep Commands

When you use pmrep, you might use some commands with specific options and arguments on a regular basis. For example, you might use pmrep to perform a daily backup of a production repository. In this case, you can create a script file to call one or more pmrep commands including its options and arguments.
For example, the following Windows batch file, backupproduction.bat, connects to and backs up a repository called Production:
backupproduction.bat
REM This batch file uses pmrep to connect to and back up the repository Production on the server ServerName
@echo off
echo Connecting to repository Production...
c:\PowerCenter\pmrep\pmrep connect -r Production -n Administrator -x Adminpwd -d MyDomain -h Machine -o 8080
echo Backing up repository Production...
c:\PowerCenter\pmrep\pmrep backup -o c:\backup\Production_backup.rep
You can run script files from the command interface. You cannot run pmrep batch files in interactive mode.

Tips for Scripting pmrep Commands

Use the following tips when you create and run pmrep scripts: