- The restore_host_config script can be found on both Control-M/Enterprise Manager or Control-M/Server. - Following is the functional description of the Restore host configuration script, restore_host_config, script: - Only the following options are available on Control-M/server (-dr, -reconf_db, -remove_secondary) “Restore_host_config” script description under "Control-M/EM_utilities" in CTM Utilities guide should be updated as follows, in order to provide a clear scenario definition for each service (switch): 1. Restoring host name and configuration data during Disaster Recovery (DR): (see Video below) When a Stand-By EM or CTM/Server installation exists and takes over at disaster scenarios, this additional environment database contains replicated data. Although all production and user data are up-to-date in these cases, the host and environment configuration data refers to the original environment, which is not in use at recovery time. This data contains the original machine's host name in various database tables and it should be reverted to the post installation values of the stand-by machine. For example: - Original (in disaster) environment machine name: "ORIG_HOST" - Stand-by (for recovery) environment machine name: "STDBY_HOST" The "INSTALL_HOST" field in CONFIG_HA table in database contains these values according to the following events: a. In the original environment, the value is "ORIG_HOST" at all times. b. Before replication, in the stand-by environment, the value is "STDBY_HOST", therefore the installation is functional. c. After replication, in the stand-by environment, the value is "ORIG_HOST", hence the installation is not functional. d. At recovery time, the value in the stand-by environment should be reset to "STDBY_HOST", in order to function and fully take over. There are more tables/fields in EM database containing this value and they all should be updated accordingly. The script usage, to accomplish the above goal is as follows: Usage: <restore_host_config> [-silent] -dr [[-old_host <old (Site A) host name>] or [-primary/secondary]] [[-password <dbo password>] or [-password_file [<file_path>]]] * <old (Site A) host name> is the host name of the disaster site that is being recovered * {[-primary] or [-secondary] may be used alternatively (instead of \"-old_host\"). Note: For the Control-M Server you do not use -primary only primary (no -) in case the script cannot detect the old configuration in the template file}. This is a rare case usage.} The "-old_host" flag is not needed in the following configurations: a. There is only one single EM environment installed on a single machine. b. There is one main environment (primary) and an HA environment (secondary) installed on two different machines. c. There is only one single additional environment (distributed) installed on a different machine. The "-old_host" flag should be used in the following configuration: - There are more than one additional environments (distributed) installed on several different machines. - When the "restore_host_config" command is used together with "-dr" and "-silent" option. The script should be executed according to the above usage, on all different installations (primary/secondary/distributed), always starting with the primary installation, given the fact that all different environments are cloned in the stand-by (DR) zone. 2. Replacing the local host name data in database and configuration files, when the Control-M/EM installation host name is modified (rehost): When the physical hostname of the EM installation machine is modified by the system administrator for technical/maintenance reasons, EM may become dysfunctional, due to inconsistency with the host name configuration values in the database. This only applies to the EM/Server and is not supported for the Control-M/Server or Full Installation (One Install). For example: - Host name at installation time: "OLD_NAME" - Modified host name: "NEW_NAME" Note that, in this scenario, the installation is not moved to any other physical box. The "INSTALL_HOST" field in CONFIG_HA table in database should be updated, to have the value "NEW_NAME". There are more tables/fields in EM database containing this value and they all should be updated accordingly. There are also some configuration files in EM installation, such as CONFIG_HA.INI, that need to be modified as well, accordingly. The script usage, to accomplish the above goal is as follows: Usage: <restore_host_config> -rehost [-silent] [[-old_host <old host name>] or [-rename_remote_main_data]] [-db_host <main installation host name>] [[-password <dbo password>] or [-password_file [<file_path>]]] * <old host name> is the original host name of the modified site. In case there are more than a single EM environment. * \"-rename_remote_main_data\" flag specifies only to update the main installation parameters, such as Naming Server host data, etc... on a distributed or secondary installation environment's configuration files, after moving the main installation to a different host. * <main installation host name> should be given when running on distributed or secondary installations, in case, the database server is local to the main installation host (such as dedicated Postgres, etc...) The following scenarios/configurations are served by the above usages: a. When there is only a single main installation, there is no need to specify any optional flag. The script will run and configure according to the default values. b. In case the database is dedicated to the local installation, running at the same host (such as PostgreSQL database installed with EM or One-Install), the script updates all database connection configuration for a continuous functionality, accordingly. c. In cases there are additional (secondary/distributed) installation on different machines, and the main (primary) machine host name is modified, by running the above option, the script should be executed with "-rehost" option on all secondary/distributed installations with the additional flag "-rename_remote_main_data", to update the primary host name in configuration files (such as config.xml of Corba). d. In cases there are additional (secondary/distributed) installation on different machines, and the main (primary) machine host name is modified, if the database is local to the primary installation (such as dedicated Postgres), in addition to the flags specified in the previous option, "-db_host <main installation host name>" flag is needed, to connect to the database, using the new primary host name. e. In case the host name of the HA (secondary) or of the single distributed installation is modified, "-rehost" option should be executed on these installations, with no optional flag. f. In case there are multiple distributed installations and any host name in one of these installations is modified, "-rehost" option should be executed on the specific installation with the addition of "-old_host <old host name>" flag. 3. Adding an interface host name configuration: For environments having a different interface for access by remote machines, specifically relevant for cloud machines. Cloud machine often switch published host (interface) name after being recycled. The new interface name value should be updated in configuration files, such as CONFIG_HA.INI and in the database tables such as CONFREG. Usage: <restore_host_config> -interface_name [-silent] [-name <interface host name>] [[-password <dbo password>] or [-password_file [<file_path>]]] "-name <interface host name>" may be specified to define a customized interface (published) host name, in case it is not available to the software. The script should be executed with this option on each HA/distributed installation that its interface name is modified. 4. Setting a virtual or alternative interface host name configuration, for environments having a different interface for access than the local host name, specifically relevant for cluster configurations. This configuration utilizes the environment variable "BMC_EM_PROFILE_NAME". To utilize cluster functionality for EM, this option should be used, in order to configure a logical host name set by the BMC_EM_PROFILE_NAME environment variable. The script updates all host name configuration in EM database and configuration files with this value. Usage: <restore_host_config> -profile_name [-silent] [-name <alternative host name>] [-internal_only] "-name <alternative host name>" is specified for the customized value assigned to BMC_EM_PROFILE_NAME. If the variable already exists, it may not be specified, "-internal_only" flag specifies not to update host name data for accessing outside of the environment (such as remote Corba clients etc...). 5. Reconfiguring database server connection data in configuration files and database: When the database server host is modified, such as moving the database server to a replicated server running on a different machine, this option modifies the database connection data in configuration files (such as DBU_params.dat file), enabling EM processes to connect to the new server. - The script also updates this data stored in EM database, in case the connection parameters data are still of the old database. This status can be reached if EM data import has been executed in the new database storing the old server connection data. The script supports all Database server vendor types (Postgres, Oracle, Mssql) that can be connected by EM. For example: - Original Oracle database server details: Host name: OLD_ORA_HOST Port: 1234 Service name: OLD_ORA_SRV Schema (Tablespace) name: OLD_EM_DB DB owner login name: OLD_EM_USER Data file location: PATH_TO_OLD_DATA_LOCATION - New Oracle database server details: Host name: NEW_ORA_HOST Port: 5678 Service name: NEW_ORA_SRV Schema (Tablespace) name: NEW_EM_DB DB owner login name: NEW_EM_USER DB owner login password: NEW_EM_USER_PWD Data file location: PATH_TO_OLD_DATA_LOCATION The script usage, to accomplish the above goal is as follows: Usage: <restore_host_config> -reconf_db [-silent] [-host <new db host name>] [-port <new db port number>] [-service <new db service name>] [-dbname <new db schema name>] [-pg_existing_server <y/n>]
[-owner <new db owner name>] [-data_file_location <full path to new data file location>] [-log_file_location <full path to new db log file location>] [[-password <dbo password>] or [-password_file [<file_path>]]] [-always_on <y/n>] * "-data_file_location" is to be used for Oracle and MSSQL databases. * "-log_file_location" is to be used only for MSSQL databases. * "-pg_existing_server" is to be used for PostgreSQL databases. Value of "y" specifies that the database server cannot be administered by the installation ("Existing" mode). Value of "n" specifies that the database server can be administered by the installation ("Dedicated" mode). * "-always_on" may be used for MSSQL databases. Value of "y" specifies to set Always-On configuration. Value of "n" specifies to unset Always-On configuration. The script should be executed on all HA and distributed installations connected to the same database. NOTE: If you intention is simply to change the port number on the local system specifically for Postgres used by Control-M/Server, and only in a dedicated installation, then follow the steps in article 000139218 This does not apply if Postgres is also used by Control-M/Enterprise Manager. NOTE 2: This Usage gives the general usage with all available parameters, but some parameters may not apply for certain environments. It is recommended to run restore_host_config -reconf_db -help to get the help with the parameters that apply to the current environment. For example when running "restore_host_config -reconf_db -help" on a Control-M/Server environment with MSSQL, the output will not show an option for a hostname parameter, and instead will show "SERVICE_NAME". The SERVICE_NAME value can contain hostname only or can contain hostname with instance (SERVICE_NAME=<hostname>\<instance>). 6. Updating a Control-M/Server host name communication data in Control-M/EM database: The script should be used when the host name of a connected Control-M/Server host name is changed due to being moved to a different host. Renaming a Control-M/Server host name on a machine where the Control-M/Server is already installed is currently not supported. In these cases, the script should be executed to update the CTM/Server host name data in EM database (for example COMM table). Usage: <restore_host_config> -rehost_ctm [-silent] [-old_host <old host name>] [-new_name <new host name>] [[-password <dbo password>] or [-password_file [<file_path>]]] * "-old_host" is to be used to provide the existing (old) host name of the CTM/Server datacenter, in case there are multiple datacenters connected to EM. * "-new_name" is to be used to provide the new host name of the CTM/Server datacenter. 7. Remove the secondary (inactive) high-availability installation component data in Control-M/EM database. In case a High-Availability secondary (stand-by) environment is uninstalled, its data in EM database, such as the CONFIG_HA table, should be removed. This can be done by the following usage. Usage: <restore_host_config> -remove_secondary [-silent] [-switch_primary_to_secondary] [[-password <dbo password>] or [-password_file [<file_path>]]] * \"-switch_primary_to_secondary" flag should be specified if the secondary environment is the active one. * If the primary environment is not active and \"-switch_primary_to_secondary" is not given, the script exits without removing, with an error message. 8. Help, display this page on command line Usage: <restore_host_config> -help 9. Can I use restore_host_config with -pg_existing_server y/n option to move from dedicated to external PG? yes, this flag is intended to allow you to reconfigure database properties to point from local PG to external PG.
e.g. restore_host_config -reconf_db .... -pg_existing_server Y Notes: ------ * The restore_host_config utility for Control-M/Enterprise Manager was introduced in Control-M/Enterprise Manager 9.0.00 fix pack 5 (Please make sure EM 9.0.00 Patch 512 is installed). * The restore_host_config utility for Control-M/Server was introduced in Control-M/Server 9.0.00 fix pack 4. * <restore_host_config> command syntax: On Unix, it is "em restore_host_config". On Windows, it is "<EM_HOME\bin\restore_host_config.exe>". * The script can be silently executed by specifying "-silent" flag. * The script accepts "-password_file" flag instead of "-password" flag, reading a password file content for the password value. If an optional value of file path "<file_path>" is given, this file is read for password value, otherwise, the default path is read from. The default password file path on Unix/Linux is: "HOME/ctm_em/data/restore_host_config.dat" The default password file path on Windows is: "EM_HOME\Data\restore_host_config.dat" * If silent run is asked for, and all required parameters are not given in command-line, the script stops with a proper message. * If silent run is not requested, the required parameters are interactively asked for, during script execution. * In silent mode, DBO password parameter is exceptionally asked for interactively, if not given by the "-password" flag. * In case distributed or high-availability (secondary) installations exist, the script should be executed on all installations. * In case distributed or high-availability (secondary) installations exist, the script should first be executed on the main active (primary or secondary) installation, and only afterwards in the non-active (secondary or primary) and/or distributed installations. ------------------------------------------------------------------------------------------------------------------------------------------------------------- Video for Option 1: "Restoring host name and configuration data during Disaster Recovery (DR):" |