Backing up and restoring HP Systems Insight Manager data files in an HP-UX or Linux environment HOWTO Abstract... 2 Introduction... 2 Saving and restoring data files... 3 Saving and restoring files using PostgreSQL utilities... 3 Saving data files using PostgreSQL utilities... 3 Restoring data files for PostgreSQL... 5 Saving and restoring files for an Oracle database... 7 Saving data files for use with Oracle... 7 Restoring data files for use with Oracle... 8 For more information... 11 Call to action... 11
Abstract HP Systems Insight Manager (HP SIM) is a flexible management utility for an enterprise environment employing HP ProLiant, BladeSystem, StorageWorks, and/or Integrity solutions. The system database and configuration files used by HP SIM should be backed up regularly to allow recovery from a catastrophic system failure or an instance of corrupted files. This paper describes, step-by-step, how to back up the HP SIMdata files and perform a restore if a software reinstallation becomes necessary on a system running the HP-UX or Linux operating system. This paper makes the following assumptions: The reader is familiar with IT administration policies and practice. The reader is familiar with the operating system platform implemented by his/her data center. The reader has reviewed the HP SIM 5.0 Installation and User Guide and/or the HP SIM Technical Reference Guide. Introduction HP Systems Insight Manager (HP SIM) is the foundation for the HP unified infrastructure management strategy. HP SIM provides hardware-level management for HP ProLiant, HP Integrity, and HP 9000 servers; HP BladeSystems; and HP StorageWorks MSA/EVA/XP storage arrays all from a single console in the data center or in a remote location. Server and storage information for a network is kept in a database compiled by HP SIM. The system administrator should back up this database and associated configuration files regularly to allow for a smooth reinstallation or restore process if a catastrophic equipment or software failure should occur. Additional reference data is available in the form of on-line man pages, which provide quick command-line access to specific topics such as HP SIM commands and parameters. The HP SIM documents listed previously, the man pages, and additional HP SIM support documents are available at the HP SIM information library at the following URL: http://h18004.www1.hp.com/products/servers/management/hpsim/infolibrary.html NOTE: This paper describes the backup and restoration of a same system for fault insurance purposes only. It does not apply to system migration or software upgrades. For migration information, refer to the HOWTO paper at the following URL: http://h10018.www1.hp.com/wwsolutions/misc/hpsimhelpfiles/hpsim_5_migratingnewsystem.pdf 2
Saving and restoring data files HP SIM running under the HP-UX or Linux operating system can use either a PostgreSQL or Oracle database to store collected information about systems on the network. Saving and restoring files using PostgreSQL utilities These procedures describe backing up and restoring data files used with PostgreSQL utilities. Saving data files using PostgreSQL utilities Saving (backing up) the database with PostgreSQL requires changing the administrator s password and saving the database and associated files. Follow the procedure defined below. NOTE: When executing PostgreSQL commands, file pathnames depend on how and where PostgreSQL is installed. Your actual pathname may differ from those provided in the following example. 1. If HP SIM is running, enter mxstop in the command line to stop the HP SIM daemons. 2. To verify that all HP SIM mx processes have stopped, run the command ps ef grep mx. 3. Using the file management utility of your choice, save the configuration files listed in Table 1. Table 1. Configuration files to be saved Directory or file /etc/opt/mx/config/ /var/opt/mx/config/ /etc/opt/hp/sslshare/ /var/opt/mx/logs/mx.log /opt/mx/patch /opt/mx/bin/server_cert.pem /opt/mx/bin/cliclientconfig. cfg /var/opt/mx/output Description Directory of configuration files Additional configuration files Shared openssl certificate directory Audit file Program updates (required if HP SIM is to be reinstalled) Certificate used by the Command Line Interface (CLI) CLI configuration file (optional) Contains job result output. NOTE: The file permissions must be preserved during the backup process. The Tape Archive (TAR) utility preserves file permissions. 4. Save any existing user-supplied (custom) files contained in the HP SIM directory tree such as tool definition files (TDEFs), Management Information Bases (MIBs), login prompt, actions, etc. 3
5. Open the /etc/opt/mx/config/database.props file and check the property value for hp.database.username. The default PostgreSQL user for HP SIM is mxadmin. 6. The password generated by HP SIM for mxadmin must be changed before backing up the database. To change the password, at the HP SIM command line enter the following: /opt/mx/bin/mxpassword m x MxDBUserPassword=newpassword where newpassword is the new password. 7. Stop the PostgreSQL service with the stop command (full command path may vary depending on the PostgreSQL install location): For HP-UX, enter the following: /sbin/init.d/hpsmdb stop For Linux, enter the following: /etc/init.d/postgresql stop 8. Restart the PostgreSQL service with the start command (full command path may vary depending on the PostgreSQL install location): For HP-UX, enter: /sbin/init.d/hpsmdb start For Linux, enter: /etc/init.d/postgresql start NOTE: It may take up to several minutes for PostgreSQL to start. To check the status in Linux, enter the postgresql status command ( etc/init.d/postgresqlstatus ). 9. Enter the following at the command line: For HP-UX: cd /opt/hpsmdb/pqsql/bin./pg_dump h 127.0.0.1 U mxadmin p 50006 insight_v1_0 > savehpsimdb For Linux: cd /usr/bin pg_dump h 127.0.0.1 U mxadmin p 5432 insight_v1_0 > savehpsimdb where: p = port number. To find the port number, open /etc/opt/mx/config/database.props and look for the property value of hp.database.portnumber. insight_v1_0 = HP SIM database name. To find the database name, open the file /etc/opt/mx/config/database.props and look for the property value of hp.database.databasename. savehpsimdb = the filename of the saved database. 10. When prompted for a password, enter the password defined in step 6 of this procedure. End of procedure. 4
Restoring data files for PostgreSQL To restore the database from a saved copy, use the following procedure: 1. If performing a reinstallation of HP SIM, proceed as directed in the HP SIM 5.0 Installation and User Guide available at the following URL: http://docs.hp.com/en/5991-4498/?jumpid=reg_r1002_usen 2. If HP SIM is running, enter mxstop in the command line to stop the HP SIM daemons. 3. To verify that all HP SIM mx processes have stopped, run the command: ps ef grep mx For HP-UX, proceed to step 4. For Linux, proceed to step 5. 4. For HP-UX: a. Uninstall the SysMgmtDB with the following command: swremove -x enforce_dependencies=false SysMgmtDB b. Install Sys Management DB from hpsim's Depot file with the following command: swinstall -s /hpsim.depot SysMgmtDB 5. For Linux: a. To edit the pg_hba.conf file, enter: vi /var/lib/pgsql/data/pg_hba.conf and add: local insight_v1_0 mxadmin password local all all trust host insight_v1_0 root 127.0.0.1 255.255.255.255 trust host template1 postgres 127.0.0.1 255.255.255.255 trust b. Stop the PostegreSQL service with the following command: /etc/init.d/postgresql stop c. Restart the PostegreSQL service with the following command: /etc/init.d/postgresql start d. Shift the user : Login as postgres using the following command: su postgres e. To delete the database, enter: cd /usr/bin and then run the command: dropdb p 5432 h 127.0.0.1 i e insight_v1_0 6. Create database with the name insight_v1_0 using the following command: For HP-UX: cd /opt/hpsmdb/pgsql/bin./createdb -O hpsmdb -h 127.0.0.1 -p 50006 -U hpsmdb insight_v1_0 For Linux: cd /usr/bin Createdb O postgres h 127.0.0.1 p 5432 U postgres insight_v1_0 5
7. For Linux, proceed to step 8. For HP-UX, create user named mxadmin (with No permission to create DB and user) using the following command:./createuser -h 127.0.0.1 -p 50006 -U hpsmdb mxadmin 8. At the HP SIM command line, enter the following command: For HP-UX:./psql q h 127.0.0.1 U mxadmin p 50006 f savehpsimdb -d insight_v1_0 For Linux: psql q h 127.0.0.1 U mxadmin p 5432 f savehpsimdb -d insight_v1_0 where: savehpsimdb = the name of the backup file to be restored. p = port number. To find the port number, open /etc/opt/mx/config/database.props and look for the property value of hp.database.portnumber insight_v1_0 = HP SIM database name. To find the database name, open the file /etc/opt/mx/config/database.props and look for the property value of hp.database.databasename 9. When prompted, enter the password defined in the Saving data files using PostgreSQL utilities step 6. 10. Using an appropriate file management utility, restore the configuration files listed in Table 2. Table 2. Configuration files to be restored Directory or file /etc/opt/mx/config/ /var/opt/mx/config/ /etc/opt/hp/sslshare/ /var/opt/mx/logs/mx.log /opt/mx/patch /opt/mx/bin/server_cert.pem /opt/mx/bin/cliclientconfig. cfg /var/opt/mx/output Description Directory of configuration files Additional configuration files Shared openssl certificate directory Audit file Program updates (required if HP SIM is to be reinstalled) Certificate used by the Command Line Interface (CLI) CLI configuration file (optional) Contains job result output. 6
NOTE: The file permissions must be preserved during the backup process. The Tape Archive (TAR) utility preserves file permissions. 11. Restore any existing user-supplied (custom) files contained in the HP SIM directory tree such as tool definition files (TDEFs), Management Information Bases (MIBs), login prompt, and actions. 12. Initialize HP SIM by entering mxinitconfig a in the command line so that the database and the restored configuration files are updated in HP SIM. End of procedure. Saving and restoring files for an Oracle database The following procedures describe saving (backing up) and restoring data files for a system using an Oracle database with HP SIM. The backup and restore processes must be conducted by a user with Oracle DatabaseAdminstrator (DBA) privileges. Saving data files for use with Oracle To save Oracle database files, use the following procedure: 1. If HP SIM is running, enter mxstop in the command line to stop the HP SIM daemons. 2. To verify that all HP SIM mx processes have stopped, run the following command: ps ef grep mx 3. Using the file management utility of your choice, save the configuration files listed in Table 3. Table 3. Configuration files to be saved Directory or file /etc/opt/mx/config/ /var/opt/mx/config/ /etc/opt/hp/sslshare/ /var/opt/mx/logs/mx.log /opt/mx/patch /opt/mx/bin/server_cert.pem /opt/mx/bin/cliclientconfig. cfg /var/opt/mx/output Description Directory of configuration files Additional configuration files Shared openssl certificate directory Audit file Program updates (required if HP SIM is to be reinstalled) Certificate used by the Command Line Interface (CLI) CLI configuration file (optional) Contains job result output. NOTE: The file permissions must be preserved during the backup process. The Tape Archive (TAR) utility preserves file permissions. 7
4. Save any existing user-supplied (custom) files contained in the HP SIM directory tree such as tool definition files (TDEFs), Management Information Bases (MIBs), login prompt, and actions. 5. Open the /etc/opt/mx/config/database.props file and check the property value for hp.database.username. The backup and restore process must be conducted by a user with Oracle DatabaseAdminstrator (DBA) privileges. 6. Back up Oracle data files by Exporting the Database as follows, making note of the database name, DBA user name, and DBA password: a. At the Oracle server console command line, enter the following command: set ORACLE_SID=dbname and press Enter. b. Type the exp command and press Enter. Table 4 lists the Oracle parameters that will be offered and the recommended action. Table 4. Oracle database parameters Parameter Username Password Action Enter the username of dba and press Enter. Enter the password of dba-user-password and press Enter. Array fetch buffer size Press Enter to select default of 4096. Export file EXPDAT.DMP <Path\backup.dump> (1) E (ntire database) (2) U (sers) (3) T (ables) Export grants (yes/no) Export table data (yes/no) Compress extents (yes/no) Enter file name and path to dump the database and press Enter. Enter E and press Enter. After selecting the Compress extents default parameter of No, the database backup will be initialized. End of procedure. Restoring data files for use with Oracle To restore the Oracle database from a saved copy, use the following procedure: 1. If using an existing Oracle installation, delete the backed-up database on the Oracle server. This needs to be done since HPSIM requires an empty database for initialization. 2. Create a new database with the same name as that of the backed up database. 3. Install HP SIM as directed in the HP SIM 5.0 Installation and User Guide available at the following URLs: For HP-UX (Unix) http://docs.hp.com/en/418810-001/index.html For Linux http://docs.hp.com/en/418811-001/index.html 8
NOTE: The HP SIM command mxoracleconfig must be used to configure HP SIM to use an Oracle database. 4. If HP SIM is running, enter mxstop in the command line to stop the HP SIM daemons. 5. To verify that all HP SIM mx processes have stopped, run the following command: ps ef grep mx 6. Restore the configuration files listed in Table 5. Table 5. Configuration files to be restored Directory or file /etc/opt/mx/config/ /var/opt/mx/config/ /etc/opt/hp/sslshare/ (for HP- UX) /opt/hp/sslshare (for Linux) /var/opt/mx/logs/mx.log /opt/mx/patch /opt/mx/bin/server_cert.pem /opt/mx/bin/cliclientconfig. cfg /var/opt/mx/output Description Directory of configuration files Additional configuration files Shared openssl certificate directory Audit file Program updates (required if HP SIM is to be reinstalled) Certificate used by the Command Line Interface (CLI) CLI configuration file (optional) Contains job result output. 7. Restore any existing user-supplied (custom) files contained in the HP SIM directory tree, such as tool definition files (TDEFs), Management Information Bases (MIBs), login prompt, actions, etc. 8. Complete the following steps to restore the database file by importing from the backup created in step 6 of Saving data files for use with Oracle : a. Delete the database on the Oracle server created in step 2 of this procedure. b. Create a database (with the same name as the one just deleted in the step 8a), and create a user with DBA privileges (with the same username used while backup was taken as in Step 6 of the Saving data files for use with Oracle ). c. At the Oracle server console, enter the following command: set ORACLE_SID=<dbname> where dbname is the database just created in 8b. d. Enter the command imp and press Enter. Table 6 lists the Oracle database parameters that will be offered and the recommended action. 9
Table 6. Oracle database parameters Parameter Username Password Import file EXPDAT.DMP <c:\backup.dmp> Action Enter the username of dba and press Enter. Enter the password of dba-user-password and press Enter. Enter file name and path of the database to restore and press Enter. Insert buffer size Press Enter to select default value of 30720. List contents of import file only (yes/no) Ignore create error due to object existence (yes/no) Import grants (yes/no) Import table data (yes/no) Import entire export file (yes/no) Username Table (T) Partition (T:P) or if done (.) Enter dba and press Enter. Enter the dot character (.) and press Enter to begin the database restoration. 9. At the HP SIM command line, enter the command mxinitconfig a so that the database and the restored configuration files are updated in HP SIM. End of procedure. 10
For more information For additional information, visit http://www.hp.com/go/hpsim. Call to action Send comments about this paper to TechCom@HP.com. 2006 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein. Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. TC060802HT, August 1, 2006