Often as an Informatica Administrator you require to restart specific service in the informatica domain. You can do it from user interface by using an Admin Console; However if you want to write script or you prefer command line over GUI then you can use informatica infacmd command line tool. Below we will learn how to use infacmd's
DisableService command to start and stop the services in informatica domain with the help of Example.
Verify Availability of INFACMD Executable
Before we get started with these commands, it is assumed that you have infacmd installed on your server or machine from which you are executing the command. By default informatica will keep infacmd executable file at following location :
EnableService and DisableService - Required Options and Values
|-Gateway||-hp||Informatica gateway hostname and port where services are running separated by colon. |
|-DomainName||-dn||Informatica domain name where service is set up..|
|-UserName||-un||Domain username of informatica user with administrator access using which command will be executed.|
|-Password||-pd||Password of the domain user in plain text. |
This flag is not needed if encrypted domain password is set in environment variable
|-ServiceName||-sn||Name of the service which has to be started or stopped.|
|-Mode||-mo||Only required for DisableService |
It specifies how the service should be disabled and takes either of following value.
|-SecurityDomain||-sdn||This is an Optional parameter and required only If LDAP is enabled for authentication. By default checks user authentication against Native security domain.|
Informatica - EnableService and DisableService Examples
Infacmd Enable Service
$INFA_HOME/server/bin/infacmd.sh EnableService -Gateway example.com:8888 -DomainName MY_INFA_DOMAIN -ServiceName MY_INFA_SVC -UserName MY_USERNAME -Password MyStr0ngP#d
Infacmd Disable Service
$INFA_HOME/server/bin/infacmd.sh DisableService -Gateway example.com:8888 -DomainName MY_INFA_DOMAIN -ServiceName MY_INFA_SVC -UserName MY_USERNAME -Password MyStr0ngP#d -Mode Stop
Checking command execution status
On unix like operating system you can check the success or failure of above command using last exit status code. Non zero status code would indicate failure while 0 will indicate success. This will be useful when you want to use above commands inside script to automate service startup or shutdown.
echo $? 0
Infacmd with Encrypted Password
As you can see the password in above commands is passed in the plaintext and could cause security issues. To avoid this use encrypted password in infacmd commands.
DisableService command we have learned to start and stop informatica service from command line. Using the same utility we can schedule startup and shutdown of the service with the shell script.