You are on page 1of 38

BMC Software Professional Services

Cap Schneider : " Control-M Project"


CAPG070612A V 1.0

Date :

18/07/2007

Version :

V 1.0
The information in this document is the property of BMC
Software Services and is provided on a confidential and
restricted basis. This information shall not be disclosed
outside customer organization and shall not be duplicated,
used or disclosed in whole or in part for any purpose other
than to evaluate this Statement of Work from BMC Software.
BMC Software and the BMC Software logo are registered
trademarks or trademarks of BMC Software, Inc.
Copyright 2003, BMC Software, Inc.

BMC Software Professional Services

Page 1/38

18/07/2007, CAPG070612A V 1.0

Admin-CTM

Contents
1 Introduction.......................................................................................................5
2

CONTROL-M administration...........................................................................6
2.1

Stop and Start .................................................................................................6

2.1.1

Start........................................................................................................................ 6

2.1.2

Stop ....................................................................................................................... 7

2.2

Backup and restoration....................................................................................8

2.3

CONTROL-M maintenance..............................................................................9

2.3.1

User Daily .............................................................................................................. 9

2.3.2

Purge of CONTROL-M logs...................................................................................9

2.3.3

Proclog Management .......................................................................................... 10

2.3.4

Manual condition Management.............................................................................11

2.3.5

Cleaning of the Conditions...................................................................................13

2.3.6

Statistics................................................................................................................ 14

2.3.7

Job plan list........................................................................................................... 15

2.3.8

Size of the database............................................................................................. 16

2.3.9

Agents list............................................................................................................ 19

3 CONTROL-M/EM Administration...................................................................21
3.1

3.1.1

Start...................................................................................................................... 21

3.1.2

Stop...................................................................................................................... 22

3.2

Stop and Start.................................................................................................21

Backup and restoration..................................................................................24

CONTROL-M/EM standard gestion..............................................................25


4.1

Alerts ............................................................................................................. 25

4.2

Users .............................................................................................................26

4.3

Check of the database....................................................................................26

4.4

Logs ..............................................................................................................27

CONTROL-M /Agent administration.............................................................29


5.1

Sysouts..........................................................................................................29

5.2

Agent backup and restoration.........................................................................30

6 Cluster............................................................................................................31
6.1

Scripts ............................................................................................................31

6.1.1

Start CTM.............................................................................................................. 31

6.1.2

Start EM................................................................................................................ 33

6.1.3

Stop EM............................................................................................................... 35

6.1.4

Stop CTM.............................................................................................................. 37

BMC Software Professional Services

Page 2/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

BMC Software Professional Services

Page 3/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

History of rvisions
Version

Date

Author

Commentary

1.0

18/072007

Emanuel Kwedi

Creation of the document

1.2

24/09/2007

Karim Mansouri

Traduction

Diffusion list
Name

Company

Title

Thierry Hareng

Cap Gemini

Project manager

Stephane Marioni

BMC

PS Manager

BMC Software Professional Services

Page 4/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

1 Introduction
The goal of this document is to have a concrete reference for the administration
of the environment Control-MR. It deals with administration task of the different
components.
The objective is to have a good performance of the product with an optimal use of the
resources.
To achieve this task, the responsibilities for the administrator can be defined as follows:
Make a backup of the data base Control-M./Server, and directories of Control-M. to
ensure a complete restoration in the event of crash of the machine or crash of the data
base.
To plan the tasks to be put in production.
To carry out the tasks of maintenance of the base
to purge the log periodically
to purge the conditions,
to check the integrity of the base,
To define levels of authorizations for the users of Control-M.

BMC Software Professional Services

Page 5/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

2 CONTROL-M administration
The current administration tasks of the server Control-M. are:
Back up.
Purging SQL data Base message log
Purging of the directories proclog
Check the size of the database
Check the good performance of the product

2.1 Stop and Start


Control M is never stopped in practise . Except particular operation or request
express .Control-M server . Should not be stop.
A stop of the Serve do not entrain a loss of data of the plan of work in progress.

2.1.1 Start

1. Database
Connect as oractm and execute
>Sqlplus /nolog
>Connect /as sysdba
>startup
1

sqlplus /nolog
SQL*Plus: Release 10.2.0.2.0 - Production on Tue Jul 17 13:43:13 2007
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1258291200 bytes
Fixed Size

2070944 bytes

Variable Size

822085216 bytes

Database Buffers
Redo Buffers

419430400 bytes
14704640 bytes

Database mounted.

BMC Software Professional Services

Page 6/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

Database opened.

2. Control-M serveur
To have the controlm menu execute: ctm_menu after the option Manager Menu and
Start ControlM

2.1.2 Stop

1. Control-M serveur
Controlm server is stopped by the interactive menu ctm_menu after Manager
Menu and Stop Control-M .
You can also use the command: shut_ctm

BMC Software Professional Services

Page 7/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

2. Database
Connect as oractm and execute
> Sqlplus /nolog
>Connect /as sysdba
>shutdown immediate
1

sqlplus /nolog
SQL*Plus: Release 10.2.0.2.0 - Production on Tue Jul 17 13:33:34 2007
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
SQL> connect / as sysdba
Connected.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

2.2 Backup and restoration


This part is in charge of the system administrator who have integrate backup in the
global rescue
BMC Software Professional Services

Page 8/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

2.3 CONTROL-M maintenance


Control-M execute once per day, at one hour specific specified by the administrator
according to the beginning of the day of production, a process called New Day
procedure.
This procedure will order in the plan the jobs for the new day of production.
New day process will scann whole Scheduling tables of the Control-M database ,
(those having parameter SYSTEM) and will select the eligible jobs for the day of
production according to the various criteria of scheduling.
Daily procedure creates Jobs starting from the tables of scheduling. The first Jobs
created are Jobs containing the User Daily which will plan the remainder of the
production.
This procedure also will clean the plan of the day before (Active the Job file ),
removing:
Jobs Ended OK
Jobs in Waiting (in gray) of which the period of retention (max Wait) was exceeded.
The jobs Ended Not OK of which the period of retention (max Wait) was exceeded.
The jobs preserved at the plan are:
Jobs in executing
Jobs in Waiting (in gray) of which the period of retention (max Wait) was not
exceeded
The jobs Ended Not OK of which the period of retention (max Wait) was not exceeded
Jobs in status hold
Automatically at the end of New Day process, Control-M/EM is refreshed with the new
day of production (new Active jobfile) and with the new table of the conditions.

2.3.1 User Daily

They are batch processing, called by the utility ctmudly in the jobs ordered in the plan
by daily SYSTEM.
Each Scheduling table having the parameter associated in the command ctmudly will
be scann and the eligible jobs of this table will be placed in the plan, in Active the Job
File.
To well done the user daily jobs does not have a predecessor.

2.3.2 Purge of CONTROL-M logs

BMC Software Professional Services

Page 9/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

The database contains a table of log of activity of Control-m (including the logs of the
jobs). This table must be purged regularly. The utility ctmlog allows the purging of the
oldest messages. We purge the messages older than 10 days.
Job which can be made

JOB NAME
Ctmlog

command
AutoEdit Assignement :
%%A=%%CALCDATE %%DATE 30
%%A=%%SUBSTR %%A 3 4
%%B=%%CALCDATE %%DATE 10
%%B=%%SUBSTR %%B 3 4
Ligne de commande :
Ctmlog delete %%A %%B

This job has neither predecessor nor successor, it execute when it is ordered in the
plan.
1

2.3.3 Proclog Management

The log of the processes Control-m are written in


Following repertory:
<controlm_path>/ctm/proclog/
If Control-M Server functions in mode diagnoses a long time then will use much disk
space, the administrator must purge these files regularly.
Job which can be done

BMC Software Professional Services

Page 10/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

JOB NAME

COMMAND

proclog

find [path_ctm]/controlm/ctm/proclog/. -mtime +4 -exec rm {} \;

2.3.4 Manual condition Management.

The interdependences between jobs are ensured by conditions.


Some jobs position conditions ( condition added ) , and some others, are on standby of
condition.
The ctmldnrs utility is able, by total analysis of the AJF, to determine the list of the
conditions awaited by the planned jobs, as well as the list of the positioned conditions.
By comparison, it is able to determine the list of the conditions awaited by jobs in the
plan and which are positioned by no job in the plan.
In manual conditions all the conditions will thus appear which the control-m server can
not be able to position automatically on the faith of the contents of AJF at the moment
of analysis.
Among these conditions, one will be able to be identify:
True manual conditions, to position by an operator.
Conditions positioned by utility (ctmcontb for example).

BMC Software Professional Services

Page 11/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

Conditions, emitted by another server and forwarding by Control-M/EM.


Conditions normally positioned by predecessors absent.
Jobs wich can be done

JOB NAME

COMMAND

cond01

Sleep 120 ; ctmldnrs CALCCOND;

cond02

ctmldnrs -LOAD "AA*"; exit 0

The first job ensures the calculation of the manual conditions. To avoid any conflict with
the end of User daily, this is preceded, by precaution, of a two minutes waiting
(recommendation BMC).
The second job ensures the addition of the manual conditions resulting from the
absence of planned predecessors.
The calculation of the manual conditions supposes that the plan is entirely loaded for
the day
The job of calculation is before the job which loads the conditions.

BMC Software Professional Services

Page 12/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

2.3.5 Cleaning of the Conditions

Controlm conditions table of the old conditions must be purged. This operation is done
bye the utility ctmcontb.
Jobs which can be done :

JOB NAME
Ctmcontb

COMMAND
AutoEdit Assignement :
%%DF=%%CALCDATE %%DATE 25
%%DT=%% CALCDATE %%DATE 20
Ligne de commande :
ctmcontb -DELETEFROM "*" %%DF %%DT

The variables %%DF and %%DT determine a range of dates for the account of which
the conditions are to be removed.
This job has neither predecessor nor successor. It is executed when it is ordered.

BMC Software Professional Services

Page 13/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

2.3.6 Statistics

CONTROL-M maintains statistics of execution of the job which, are used for :
Visualization, via CONTROL-M/EM,
Alarm, by SHOUT WHEN EXECTIME.
During the flow of the production, statistical recordings are produced at a rate of one
per execution.
These instantaneous statistics can be cumulated and realised. This operation is
ensured by the utility ctmjsa.
Job which can be set up
Command ctmjsa

JOB NAME

COMMAND

ctmjsa

ctmjsa "*"

This job has neither predecessor nor successor. It is executed just when it is ordered.

BMC Software Professional Services

Page 14/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

2.3.7 Job plan list.

It is possible constantly to know the jobs are in the plan and their statute.
During the flow of the production, recordings are updated in the table containing
information of the day of planning.
Job which can be done :

Job Name
ctmpsm

Command
ctmpsm LISTALL > $home/psm.txt

This job has neither predecessor nor successor. It is carried out as of its rise in the plan
and cyclic.

BMC Software Professional Services

Page 15/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

2.3.8 Size of the database

2.3.8.1

Ctmdbspace

It is possible constantly to have information on the size of the base and the logs.
This utility returns a message failed at the time the size is higher than the given limit.
Example: ctmdbspace - limit 50%

Nom du job
ctmdbspace

Ligne de commande
ctmdbspace -limit 50%

BMC Software Professional Services

Page 16/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

2.3.8.2

Ctmdbused

Post information in utilisation ratio


Job which can be made

Nom du job
ctmdbused

Ligne de commande
ctmdbused

BMC Software Professional Services

Page 17/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

2.3.8.3

Ctmdiskspace

Post information of disk space free


Job which can be done

Nom du job
ctmdiskspace

Ligne de commande
ctmdiskspace -limit 25% -path /ctm_server/ctmuser

BMC Software Professional Services

Page 18/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

2.3.9 Agents list

Post information on the various connected agents.


Job which can be done :

Job NAME
ctm_agstat

COMMAND
ctm_agstat LIST*

BMC Software Professional Services

Page 19/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

BMC Software Professional Services

Page 20/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

3 CONTROL-M/EM Administration
The current tasks of the administration of the Control-M/EM server are:
Backup of the Oracle environment
back up of the definitions (Jobs, Scheduling groups, calendars)
Purging of the files Log
The management of alarms
The following components can be stopped/started from the Configuration Manager in
graphic mode, or by script (cli) on the Control-M/EM server.
The GUI Server
The GAS Server
The GCS Server
Gateway

3.1 Stop and Start


3.1.1 Start

Start of database of Control-M/EM


Connect as emuser in UNIX
sqlplus /nolog
SQL*Plus: Release 10.2.0.2.0 - Production on Tue Jul 17 13:43:13 2007
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1258291200 bytes
Fixed Size

2070944 bytes

Variable Size

822085216 bytes

Database Buffers
Redo Buffers

419430400 bytes
14704640 bytes

Database mounted.
Database opened.

BMC Software Professional Services

Page 21/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

Start the EM process

connect as emuser
type :
root_menu choose activation_menu
and choose start All to start :
Start of Configuration server
Start of Configuration Agent
Start of Corba

To put components UP in the Configuration Manager

The components are launched automatically during the starting of the Unix
server. In manual mode, launching is carried out by putting following
components UP in the Configuration Manager:
GUI Server
Gateways
Global Alert Server
Global Server Condition

3.1.2 Stop

To put components DOWN in the Configuration Manager

The components are launched automatically during the starting of the Unix
server. In manual mode, launching is carried out by putting following
components DOWN in the Configuration Manager:
GUI Server
Gateways
Global Alert Server
Global Server Condition

Stop the EM process

connect as emuser
type : root_menu choose activation_menu
and choose stop All to stop :

BMC Software Professional Services

Page 22/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

Stop of Configuration server


Stop of Configuration Agent
Stop of Corba

Stop of the database

Connect as oraem and execute


#Sqlplus /nolog
>Connect /as sysdba
>shutdown immediate
1

sqlplus /nolog
SQL*Plus: Release 10.2.0.2.0 - Production on Tue Jul 17 13:33:34 2007
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
SQL> connect / as sysdba
Connected.
SQL> shutdown immediate

BMC Software Professional Services

Page 23/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

Database closed.
Database dismounted.
ORACLE instance shut down.

3.2 Backup and restoration


This part is managed by the System administrators who integrated the back up in the
plan .

BMC Software Professional Services

Page 24/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

4 CONTROL-M/EM standard gestion


4.1 Alerts
A big number of messages can disturb the use of the interface Alert Log and increase
the size of the database.
Job which can be done :

JOB NAME

COMMAND

Alert
Use of autoedit to calculate the date -2

Erase alerts -U P YYYYMMDD

Purge of the alert after 2 days

BMC Software Professional Services

Page 25/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

4.2 Users

Control-M/EM has a mechanism of safety called Authorization facility.


The administrator limits the accesses of the users to the various entities of the product.
The accesses and actions can be limited on the following entities:
The Jobs which the user can see or to modify,
Resources and conditions which the user can see or modify.
The calendars and Scheduling counts. To limit the access to Sheduling table also
determines for the user the possibilit

Profil

outils

fonctions

Administrateur Control-M
Responsable Ordo

Control-M Desktop
Control-M Gui
Configuration Manager

Cration, modification, suppression des jobs,


scheduling groups calendriers.
Gestion des droits daccs
Arrt et dmarrage des produits

Expert technique
Control-M

Control-M Desktop
Control-M Gui

Cration, modification, suppression des jobs,


scheduling groups calendriers.

Oprateur

Control-M Gui

Suivi de la production, actions sur les jobs


Scheduling groups de toutes les
applications.

4.3 Check of the database


It is possible constantly to have information on the size of the base and the logs.
Job which can be done :

JOB NAME

COMMAND

dbcheck

Db_check_space

BMC Software Professional Services

Page 26/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

4.4 Logs
The logs of the processes Control-M/EM are written in the following repertory:
<controlm/em>/log/
With each stop/starting of Control-M/EM, the logs of the processes are written in this
repertory and in mode diagnoses the files log will use much disk space, the
administrator must purge these files regularly.

Job which could be done

Nom du job
log

Ligne de commande
find [path]/controlm/em/log/. -mtime +4 -exec rm {} \;

BMC Software Professional Services

Page 27/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

BMC Software Professional Services

Page 28/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

5 CONTROL-M /Agent administration

The files logs of the agents are managed by durations of retention.


The process agent on Unix is launched automatically by root when the Control-M
submit a job.

5.1 Sysouts
The sysouts created by the execution of the jobs are stored on agent directory.
The duration of retention is managed by the parameter Maximum Days to Retain
Sysout Files, specified by the utility ctmsys.
Its value is 4 days. The sysouts older than 4 days are automatically removed.

BMC Software Professional Services

Page 29/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

5.2 Agent backup and restoration


Control-M. Agent not having basic, it is preferable to make a reinstalment of the product
if any problem occurs.
However, to pay attention to the sysouts, if they are always maintained in their current
directory.

BMC Software Professional Services

Page 30/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

6 Cluster

A cluster was set up on the environments of Pre-production and Production.


In the case of a cluster, it is the tool cluster which manages Failover and not application
CONTROL-M. CONTROL-M is parameterized consequently. The functionality of the
cluster usually used is a division the data on a disc accessible by the two nodes.
(Active/Passive)
The parameter setting of Cluster for these environments was set up according to the
recommendation of CAP GEMINI.

6.1 Scripts
6.1.1 Start CTM
1

#!/bin/ksh
##################################################################
###########
##
start of CTM_serveur resource
#
07/07/2007 TOOLS TEAM
##################################################################
##########
exec >> /tmp/hacmp.out
control()
{
if [ $1 -ne 0 ]
then
echo " ${Label} Failed with Return Code $1" >> $HACMP_LOG
exit 1
fi
}
mmjjyy=`/usr/bin/date +%m/%d/%y`
hhmmss=`/usr/bin/date +%H:%M:%S`
/usr/bin/echo " *-*-*-*-*-*-*-*-*-*-*-* The begin ${mmjjyy} $
{hhmmss}*-*-*-*-*-*-*-*-*-*-*-*-*-"
#
-------------------------------------------------------------------------# variables
#
-------------------------------------------------------------------------CTM_ACC=controlm
ORACLE_DIR=/softs/oracle_ctm
CTM_DIR=/softs/controlm
ORASID=oractm
CTM_OWNER=controlm
HOSTNAME=`hostname`
AGENT_ACC=ctmagctm
AGENT_DIR=/softs/ctmagctm/ctm
HACMP_LOG=/tmp/hacpm.out
#

BMC Software Professional Services

Page 31/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

-------------------------------------------------------------------------Label="start of database Oracle for CTM server"


#
-------------------------------------------------------------------------su - $ORASID -c lsnrctl start
su - $ORASID -c sqlplus <<EOF
connect /as sysdba
startup
EOF
rc=$?
control $rc
#
-------------------------------------------------------------------------Label="start of controlm configuration agent "
#
-------------------------------------------------------------------------su - $CTM_ACC -c $CTM_DIR/ctm_server/scripts/start_ca
rc=$?
control $rc
#
-------------------------------------------------------------------------Label="start of controlm serveur "
#
-------------------------------------------------------------------------su - $CTM_ACC -c $CTM_DIR/ctm_server/scripts/start_ctm
rc=$?
control $rc
#
-------------------------------------------------------------------------Label="start of the agent for controlm iz5sch "
#
-------------------------------------------------------------------------$AGENT_DIR/scripts/start-ag -u $AGENT_ACC -p ALL
rc=$?
control $rc
/usr/bin/echo " *-*-*-*-*-*-*-*-*-*-*-* End
{hhmmss}*-*-*-*-*-*-*-*-*-*-*-*-*-"

${mmjjyy} $

exit

BMC Software Professional Services

Page 32/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

6.1.2 Start EM
1

#!/bin/ksh
##################################################################
#
Script : Start resources control-M EM
#
Date : 2007/07/05
#
Version: V2
##################################################################
#
exec >> /tmp/hacmp.out
# ------------------------------------------# condition
# ------------------------------------------control()
{
if [ $1 -ne 0 ]
then
/usr/bin/echo " ------------ > ${Label} Failed with Return
Code $1"
/usr/bin/echo " *-*-*-*-*-*-*-*-*-*-*-* End ${mmjjyy} $
{hhmmss}*-*-*-*-*-*-*-*-*-*-*-*-*-"
exit 1
else
/usr/bin/echo " ------------ > ${Label} Is OK"
fi
}
mmjjyy=`/usr/bin/date +%m/%d/%y`
hhmmss=`/usr/bin/date +%H:%M:%S`
/usr/bin/echo " *-*-*-*-*-*-*-*-*-*-*-* The begin ${mmjjyy} $
{hhmmss}*-*-*-*-*-*-*-*-*-*-*-*-*-"
# -----------------------------------------# initalisation Varriables
# -----------------------------------------HACMP_OUT=/tmp/hacpm.out
EM_ACC=emuser
ORACLE_DIR=/softs/oracle_em
EM_DIR=/softs/ctm_em
ORASID=oraem
EM_OWNER=emuser
EM_OWPD=em_adm
AGENT_ACC=ctmagem
EMDB_VNAME=iz6em
EMDB_SID=EMIZ6
HOSTNAME=`hostname`
AGENT_DIR=/softs/ctmagem/ctm
# -----------------------------------------Label="Start Oracle Database and listener"
# -----------------------------------------su - $ORASID -c lsnrctl start
su - $ORASID -c sqlplus <<EOF
connect /as sysdba
startup
EOF
rc=$?
control ${rc}

BMC Software Professional Services

Page 33/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

# -----------------------------------------Label="Modification in CONTROL-M/EM database and activation node


hostname"
# -----------------------------------------ORACLE_DIR=$EM_DIR/102_64
su - $ORASID -c "sqlplus $EM_OWNER/$EM_OWPD@$EMDB_SID" <<endit
update CONFREG set MACHINE_NAME = '${HOSTNAME}';
commit;
endit
rc=$?
control ${rc}
# -----------------------------------------Label="Start CONTROL-M EM CORBA Naming Service"
# -----------------------------------------su - $EM_ACC -c $EM_DIR/scripts/start_ns_daemon
rc=$?
control ${rc}
# -----------------------------------------Label="Start CONTROL-M Configuration Server"
# -----------------------------------------su - $EM_ACC -c "$EM_DIR/appl/bin/ecs cms -name $EMDB_VNAME" &
rc=$?
control ${rc}
# -----------------------------------------Label="Start the CONTROL-M/EM Configuration Agent and the CONTROLM/EM Server components"
# -----------------------------------------su - $EM_ACC -c $EM_DIR/scripts/start_config_agent
rc=$?
control ${rc}
#
---------------------------------------------------------------------------Label="start of the agent for EM iz6em "
#
---------------------------------------------------------------------------$AGENT_DIR/scripts/start-ag -u $AGENT_ACC -p ALL
rc=$?
control $rc
/usr/bin/echo " *-*-*-*-*-*-*-*-*-*-*-* End ${mmjjyy} ${hhmmss}**-*-*-*-*-*-*-*-*-*-*-*-"
exit

BMC Software Professional Services

Page 34/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

6.1.3 Stop EM
1

#!/bin/ksh
##################################################################
#
#
script : Stop resources CTM_EM
#
Date : 2007/07/05
#
Version : V2
#
##################################################################
exec >> /tmp/hacmp.out
# ------------------------------------------# condition
# ------------------------------------------control()
{
if [ $1 -ne 0 ]
then
/usr/bin/echo " ------------ > ${Label} Failed with Return
Code $1"
/usr/bin/echo " *-*-*-*-*-*-*-*-*-*-*-* End ${mmjjyy} $
{hhmmss}*-*-*-*-*-*-*-*-*-*-*-*-*-"
exit 1
else
/usr/bin/echo " ------------ > ${Label} Is OK"
fi
}
mmjjyy=`/usr/bin/date +%m/%d/%y`
hhmmss=`/usr/bin/date +%H:%M:%S`
/usr/bin/echo " *-*-*-*-*-*-*-*-*-*-*-* The begin ${mmjjyy} $
{hhmmss}*-*-*-*-*-*"
# -----------------------------------------# initalisation Varriables
# -----------------------------------------EM_ACC=emuser
ORACLE_DIR=/softs/oracle_em
EM_DIR=/softs/ctm_em
ORASID=oraem
EM_OWNER=emuser
AGENT_ACC=ctmagem
EM_OWPD=em_adm
EMDB_VNAME=iz6em
EMDB_SID=EMIZ6
HOSTNAME=`hostname`
PLATFORM=ibm4
AGENT_DIR=/softs/ctmagem/ctm
# -----------------------------------------Label="Stop of the CONTROL-M/EM Configuration Agent and the
CONTROL-M/EM Server components"
# -----------------------------------------su - $EM_ACC -c "$EM_DIR/appl/bin/ecs ctl -U $EM_OWNER -P $EM_OWPD
-C Config_Agent -all -cmd shutdown "
rc=$?
control ${rc}

BMC Software Professional Services

Page 35/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

# -----------------------------------------Label="Stop of CONTROL-M Configuration Server"


# -----------------------------------------su - $EM_ACC -c "$EM_DIR/appl/bin/ecs ctl -U $EM_OWNER -P
$EM_OWPD -C CMS -all -cmd stop"
rc=$?
control ${rc}
# -----------------------------------------Label="Stop of CONTROL-M EM CORBA Naming Service"
# -----------------------------------------su - $EM_ACC -c "$EM_DIR/appl/ecs/bin.$PLATFORM/orbadmin ns stop
-local"
rc=$?
control ${rc}
#
---------------------------------------------------------------------------Label="stop of the agent for controlm iz6em "
#
---------------------------------------------------------------------------$AGENT_DIR/scripts/shut-ag -u $AGENT_ACC -p ALL
rc=$?
control ${rc}
# -----------------------------------------Label="demontage de la database Oracle et arret du listener"
# -----------------------------------------su - $ORASID -c lsnrctl stop
su - $ORASID -c sqlplus <<EOF
connect /as sysdba
shutdown immediate
EOF
rc=$?
control ${rc}
/usr/bin/echo " *-*-*-*-*-*-*-*-*-*-*-* End ${mmjjyy} ${hhmmss}**-*-*-*-*-*-*-*-*-*-*-*-"
exit

BMC Software Professional Services

Page 36/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

6.1.4 Stop CTM


1

#!/bin/ksh
##################################################################
#
#
stop of CTM_serveur resource
#
07/07/2007 TOOLS TEAM
##################################################################
exec >> /tmp/hacmp.out
control()
{
if [ $1 -ne 0 ]
then
echo " ${Label} Failed with Return Code $1" >> $HACMP_LOG
exit 1
fi
}
mmjjyy=`/usr/bin/date +%m/%d/%y`
hhmmss=`/usr/bin/date +%H:%M:%S`
/usr/bin/echo " *-*-*-*-*-*-*-*-*-*-*-* The begin ${mmjjyy} $
{hhmmss}*-*-*-*-*-*-*-*-*-*-*-*-*-"
#
---------------------------------------------------------------------------# variables
#
---------------------------------------------------------------------------CTM_ACC=controlm
ORACLE_DIR=/softs/oracle_ctm
CTM_DIR=/softs/controlm
ORASID=oractm
CTM_OWNER=controlm
HOSTNAME=`hostname`
AGENT_ACC=ctmagctm
AGENT_DIR=/softs/ctmagctm/ctm
HACMP_LOG=/tmp/hacpm.out
#
---------------------------------------------------------------------------Label="stop of controlm configuration agent "
#
---------------------------------------------------------------------------su - $CTM_ACC -c $CTM_DIR/ctm_server/scripts/shut_ca
rc=$?
control $rc
#
----------------------------------------------------------------------------

BMC Software Professional Services

Page 37/38
Copyright 2007 BMC Software, Inc.

18/07/2007, CAPG070612A V 1.0

Admin-CTM

Label="stop of controlm serveur "


#
---------------------------------------------------------------------------su - $CTM_ACC -c $CTM_DIR/ctm_server/scripts/shut_ctm
rc=$?
control $rc
#
---------------------------------------------------------------------------Label="stop of the agent for controlm iz5sch "
#
---------------------------------------------------------------------------$AGENT_DIR/scripts/shut-ag -u $AGENT_ACC -p ALL
rc=$?
control $rc
#
---------------------------------------------------------------------------Label="stop of database Oracle for CTM server"
#
---------------------------------------------------------------------------su - $ORASID -c lsnrctl stop
su - $ORASID -c sqlplus <<EOF
connect /as sysdba
shutdown immediate
EOF
rc=$?
control $rc
/usr/bin/echo " *-*-*-*-*-*-*-*-*-*-*-* End
*-*-*-*-*-*-*-*-*-*-*-*-"

${mmjjyy} ${hhmmss}*-

exit

BMC Software Professional Services

Page 38/38
Copyright 2007 BMC Software, Inc.

You might also like