HOW TO DO ROUTINE TASKS IN THE OEM PLATFORMS FOR CMVC Document Number TR 29.2180 Angel Rivera, Edna Wong Kyu and Lee R. Perlov CMVC/TeamConnection Development IBM Software Solutions Research Triangle Park, North Carolina Copyright (C) 1996, 1997. IBM Corp. All rights reserved. ii How to do tasks in OEM platforms ABSTRACT This technical report contains a collection of tips and hints on how to do several tasks that differ across the diverse OEM plat- forms and databases in which the Configuration Management and Version Control (CMVC) product runs. Some examples are how to start and stop a database, and how to do query for the free space of a file system. ITIRC KEYWORDS o CMVC o OEM platforms o Operating systems o AIX o HP-UX o SunOS o Solaris o Database systems o DB2 o Informix o Oracle o Solaris ABSTRACT iii iv How to do tasks in OEM platforms ABOUT THE AUTHORS ANGEL RIVERA Mr. Rivera is a Staff Programmer and team lead for the CMVC development. He joined IBM in 1989 and since then has worked in the development and support of library systems. Mr. Rivera has an M.S. in Electrical Engineering from The Univer- sity of Texas at Austin, and B.S. in Electronic Systems Engi- neering from the Instituto Tecnologico y de Estudios Superiores de Monterrey, Mexico. EDNA WONG KYU Mrs. Kyu is a Senior Associate Programmer for the Software Sol- utions division at Research Triangle Park. She joined IBM in 1987 and has worked in test, VM systems programming, support of library platforms and support of various UNIX platforms. Mrs. Kyu has a B.A. in Computer Science and a minor in Business from New York University in 1985. LEE R. PERLOV Mr. Perlov is a Staff Programmer in the TeamConnection/CMVC development group. He started working for IBM in 1985 in Gaithersburg, Md, working in the Federal Systems Division on various projects for the United States intelligence community. He then moved to RTP to work on library development and support. Mr. Perlov received a B.S.Acc degree in Accounting from the Uni- versity of Florida in 1983. He also completed two years of grad- uate work in the Department of Computer Science at the University of Florida. ABOUT THE AUTHORS v vi How to do tasks in OEM platforms CONTENTS ABSTRACT . . . . . . . . . . . . . . . . . . . . . . . . . III ITIRC KEYWORDS . . . . . . . . . . . . . . . . . . . . . iii ABOUT THE AUTHORS . . . . . . . . . . . . . . . . . . . . . . V Angel Rivera . . . . . . . . . . . . . . . . . . . . . . . v Edna Wong Kyu . . . . . . . . . . . . . . . . . . . . . . . v Lee R. Perlov . . . . . . . . . . . . . . . . . . . . . . . v 1.0 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . 1 2.0 END USER TASKS . . . . . . . . . . . . . . . . . . . . . 3 2.1 Where is the CMVC code located? . . . . . . . . . . . 3 2.2 How to find out the version of CMVC? . . . . . . . . . 3 2.3 Where are the customization files for the CMVC GUI? 4 2.4 Is there a sample profile for the CMVC end user? . . . 5 2.5 How to see the contents of files that are active (nohup.out, logs)? . . . . . . . . . . . . . . . . . . . . 5 2.6 How to link files and directories using symbolic links? 5 2.7 How much space is still available in the file systems? 5 2.8 What are all the processes that are running? . . . . . 6 2.9 How to test the connectivity of a host? . . . . . . . 6 2.9.1 Using the ping command . . . . . . . . . . . . . . 6 2.9.2 Using the host command (or equivalent) . . . . . . 7 2.9.3 Using the nslookup command . . . . . . . . . . . . 7 3.0 ADMINISTRATIVE TASKS . . . . . . . . . . . . . . . . . . 9 3.1 Is there a sample profile for the CMVC family? . . . . 9 3.2 Where are the error messages from the CMVC daemon and databases? . . . . . . . . . . . . . . . . . . . . . . . . 9 3.3 Where are the host and services files? . . . . . . . 11 3.4 Where is the mail box? . . . . . . . . . . . . . . . 12 3.5 How to change the owner/group of a file? . . . . . . 12 3.6 How to export directories? . . . . . . . . . . . . . 13 3.6.1 AIX . . . . . . . . . . . . . . . . . . . . . . . 13 3.6.2 SunOS and HP-UX . . . . . . . . . . . . . . . . . 13 3.6.3 Solaris . . . . . . . . . . . . . . . . . . . . . 13 3.7 How to mount directories? . . . . . . . . . . . . . 13 3.7.1 AIX, HP-UX, Solaris and SunOS . . . . . . . . . . 14 3.8 Handling CD-ROMs . . . . . . . . . . . . . . . . . . 14 3.8.1 Installing code from CD-ROM in AIX . . . . . . . 14 3.8.2 Installing from CD-ROM in HP-UX . . . . . . . . . 16 3.8.3 Installing from CD-ROM in Solaris . . . . . . . . 16 3.8.4 Installing from CD-ROM in SunOS . . . . . . . . . 17 3.9 How to shutdown and reboot the machines? . . . . . . 17 3.9.1 AIX . . . . . . . . . . . . . . . . . . . . . . . 17 3.9.2 HP . . . . . . . . . . . . . . . . . . . . . . . 18 3.9.3 Solaris . . . . . . . . . . . . . . . . . . . . . 18 3.9.4 SunOS . . . . . . . . . . . . . . . . . . . . . . 18 Contents vii 3.10 How to identify and kill semaphores and free shared memory? . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.0 DATABASE TASKS . . . . . . . . . . . . . . . . . . . . 21 4.1 How to start the databases? . . . . . . . . . . . . 21 4.1.1 DB2 . . . . . . . . . . . . . . . . . . . . . . . 21 4.1.2 ORACLE . . . . . . . . . . . . . . . . . . . . . 21 4.1.3 INFORMIX 5 . . . . . . . . . . . . . . . . . . . 21 4.1.4 INFORMIX 7 . . . . . . . . . . . . . . . . . . . 22 4.1.5 SYBASE 4.9 . . . . . . . . . . . . . . . . . . . 22 4.1.6 SYBASE 10 . . . . . . . . . . . . . . . . . . . . 23 4.2 How to STOP the databases? . . . . . . . . . . . . . 23 4.2.1 DB2 . . . . . . . . . . . . . . . . . . . . . . . 23 4.2.2 ORACLE . . . . . . . . . . . . . . . . . . . . . 23 4.2.3 INFORMIX 5 . . . . . . . . . . . . . . . . . . . 24 4.2.4 INFORMIX 7 . . . . . . . . . . . . . . . . . . . 24 4.2.5 SYBASE 4.9 . . . . . . . . . . . . . . . . . . . 24 4.2.6 SYBASE 10 . . . . . . . . . . . . . . . . . . . . 24 4.3 How to look at the versions of the database? . . . . 25 4.3.1 DB2 . . . . . . . . . . . . . . . . . . . . . . . 25 4.3.2 Oracle . . . . . . . . . . . . . . . . . . . . . 25 4.3.3 Informix . . . . . . . . . . . . . . . . . . . . 25 4.3.4 Sybase: . . . . . . . . . . . . . . . . . . . . . 25 4.4 How to gain access to the database? . . . . . . . . 26 4.4.1 DB2 . . . . . . . . . . . . . . . . . . . . . . . 26 4.4.2 ORACLE . . . . . . . . . . . . . . . . . . . . . 26 4.4.3 INFORMIX . . . . . . . . . . . . . . . . . . . . 26 4.4.4 SYBASE . . . . . . . . . . . . . . . . . . . . . 26 4.5 How to dump the transaction log in Sybase? . . . . . 26 4.6 How to setup Sybase devices? . . . . . . . . . . . . 27 4.7 How to setup table and index spaces for Oracle? . . 27 4.8 How to find out which table and index spaces are defined for Oracle? . . . . . . . . . . . . . . . . . . . 28 4.9 How to setup the Oracle profile? . . . . . . . . . . 29 4.10 How to add another file to the system table in Oracle? . . . . . . . . . . . . . . . . . . . . . . . . . 29 4.11 How to create file database space in Informix? . . 29 4.12 Informix 7: need to update .rhosts and /etc/hosts.equiv . . . . . . . . . . . . . . . . . . . . 30 4.13 Which interprocess communication is used between CMVC and INFORMIX? . . . . . . . . . . . . . . . . . . . . . . 30 4.14 How to look at the database tables for CMVC? . . . 31 5.0 COPYRIGHTS, TRADEMARKS AND SERVICE MARKS . . . . . . . 33 viii How to do tasks in OEM platforms 1.0 INTRODUCTION This document contains a collection of tips and hints on how to do several tasks that differ across the diverse OEM platforms and databases in which the CMVC product runs, with special emphasis on the latest level of CMVC version 2 release 3: The operating systems are: AIX 3.2.5 AIX 4.x SunOS 4.1.3 Solaris 2.x HP-UX 9 HP-UX 10 OS/2 (client only) Windows 3.1 (client only) The databases are: DB2 V1 and V2 Sybase 4.9 and System 10 Oracle 7.x Informix 5 and 7. Introduction 1 2 How to do tasks in OEM platforms 2.0 END USER TASKS This section describes some common tasks that the end user of CMVC is likely to do. 2.1 WHERE IS THE CMVC CODE LOCATED? In AIX 3.2.x, in AIX 4.x, in HP-UX, in SunOS 4.1.3, and in Solaris 2.x, the default location for the CMVC code is: /usr/lpp/cmvc In OS/2 the default location for the CMVC code is: c:\cmvc In Windows 3.1 the default location for the CMVC code is: c:\cmvcwin 2.2 HOW TO FIND OUT THE VERSION OF CMVC? The version of the CMVC GUI can be found from the Help pulldown, option "On Version" (UNIX) or option "About" (OS/2 and Windows) The version of the CMVC server and the CMVC line commands for UNIX can be found as follows: 1. Find out the directory where the daemon (cmvcd) or the GUI (cmvc) is installed: o For AIX, SunOS or Solaris, enter: which cmvcd o For HP-UX, enter: whence cmvcd 2. Change to the directory shown above. 3. Find out the 'what' strings and search for 'cmvc': o For the server, do the following: what cmvcd | grep cmvc End User Tasks 3 o For the line commands, such as Report, do the following: what Report | grep cmvc 2.3 WHERE ARE THE CUSTOMIZATION FILES FOR THE CMVC GUI? In UNIX, there are two customization files for the CMVC GUI: o Cmvc This is the X Resource File where the user can specify the font size, the colors for the windows, etc. If this file does not exist, then the GUI will NOT create it in the $HOME directory; instead, the GUI will rely on the system-wide Cmvc resource file. The user could copy the sample /usr/lpp/cmvc/samples/Cmvc into the $HOME directory and customize it. o .cmvcrc This is the file that contains the tasks shown in the CMVC Tasks window and contains values used by functions in the GUI. This file is created if it does not exist (such as when using the GUI for the first time) and resides in the $HOME direc- tory for the user account. NOTE: It is strongly recommended that the users should not attempt to edit this file. That is the reason that this file is a hidden file. In OS/2, the CMVC.INI file is stored where the OS/2 operating system code is stored, such as C:\OS2. It is strongly recom- mended that the users should not attempt to edit this file. In Windows 16-bit, the CMVCWIN.INI file is stored where the Windows operating system code is stored, such as C:\WINDOWS. It is strongly recommended that the users should not attempt to edit this file. 4 How to do tasks in OEM platforms 2.4 IS THERE A SAMPLE PROFILE FOR THE CMVC END USER? The following sample profile can be used as the basis for the profile for a UNIX user account that will use CMVC (end-user). The user will have to read thru the entire profile and comment out those lines that are appropriate for the operating system to be used. /usr/lpp/cmvc/samples/profile.user 2.5 HOW TO SEE THE CONTENTS OF FILES THAT ARE ACTIVE (NOHUP.OUT, LOGS)? To see the up-to-date contents of the files that are active, such as nohup.out and the audit/database logs, do: 1. Enter the following command: tail -f filename 2. Observe that the output is scrolling when the file is being updated. 3. If it is not longer being updated, then there will be no more scrolling. 4. You have to press Ctrl+C to exit from this mode. 2.6 HOW TO LINK FILES AND DIRECTORIES USING SYMBOLIC LINKS? To establish a symbolic link between a 'real' file/directory and a 'shadow' file/directory do: ln -s real-entity shadow-entity You have to use the following command in order to see what is the real file/directory of a shadow file/directory: ls -l 2.7 HOW MUCH SPACE IS STILL AVAILABLE IN THE FILE SYSTEMS? To show the space left in kilobytes, use: AIX 3.2.5 df AIX 4 df -k End User Tasks 5 HP-UX bdf SOLARIS df -k SUNOS df -a 2.8 WHAT ARE ALL THE PROCESSES THAT ARE RUNNING? This is useful for querying how many CMVC daemons are running, such as (in AIX): ps -ef | grep cmvcd To show all the processes that are running, use: AIX "ps -ef" HP-UX "ps -ef" SOLARIS "ps -ef" SUNOS "ps -ax" 2.9 HOW TO TEST THE CONNECTIVITY OF A HOST? Sometimes it is important to test the connectivity of a host in order to proper diagnose a problem. 2.9.1 Using the ping command _____________________________ This is the first tool that the user should use to diagnose pos- sible network problems. If "ping" fails, then you really have a network problem, which could mean most of the time that the target host is not active. The TCP/IP "ping" command can be used to test if a given host specified by a host name or host IP address is registered as a valid host and actively connected to the network. If the host name or IP address is not registered as a valid iden- tifier, then the ping command will fail. If the host is active but not connected to the network then the "ping" command will not be able to receive the expected message. 6 How to do tasks in OEM platforms 2.9.2 Using the host command (or equivalent) _____________________________________________ In some networks, there could be a mismatch between the host name and the IP address. In this case, the "host" command could be used as follows: 1. First issue "host " and notice the IP address associated with it. 2. Then issue "host " and you SHOULD get the host name obtained in the previous step. We have seen in that in some networks the second step gives a different host name and this will cause problems with TeamConnection. In AIX and in OS/2 there is a command called "host" which gets the IP address given a host name or viceversa. This command uses the local hosts file first and if the host name orthe IP address is not found there, then the network name server is contacted next. In other platforms we provide the "cmvchost" command which pro- vides the basic functionality of the "host" command provided in AIX and OS/2. 2.9.3 Using the nslookup command _________________________________ The TCP/IP "nslookup" command skips the local hosts file and queries directly the network name server, thus its name: Name Server Look Up. It provides the host name and IP address of the name server, fol- lowed by the target host name and IP address. End User Tasks 7 8 How to do tasks in OEM platforms 3.0 ADMINISTRATIVE TASKS This section describes some common tasks that the administrator user of CMVC is likely to do with the operating system, in general. 3.1 IS THERE A SAMPLE PROFILE FOR THE CMVC FAMILY? The following sample profile can be used as the basis for the profile for a UNIX user account that will serve as a CMVC family. The CMVC family administrator will have to read thru the entire profile and comment out those lines that are appropriate for the operating system in question. /usr/lpp/cmvc/install/profile.DB where DB is the database name. 3.2 WHERE ARE THE ERROR MESSAGES FROM THE CMVC DAEMON AND DATABASES? Errors encountered by CMVC are recorded in the syslog facility when syslog is activated. If syslog is not activated, error mes- sages are sent to the console of the CMVC server workstation. Since multiple families may be supported by a single CMVC server, the messages logged in syslog may pertain to multiple families. It is important to activate the syslog daemon so that CMVC errors and database errors can be logged for subsequent problem resol- ution. To activate the syslog daemon do the following: 1. Use the touch command to create the log file if it does not exist in the appropriate directory: AIX "touch /var/spool/syslog" HP-UX 9 "touch /usr/adm/syslog" HP-UX 10 "touch /var/adm/syslog/syslog.log" SOLARIS "touch /var/adm/messages" SUNOS "touch /var/adm/messages" 2. When creating the log file, set permissions according to the directions for the operating system; for example in AIX, the Administrative Tasks 9 permissions for /usr/spool/syslog should be read-write for owner and group, and read for others, with owner root and group system. For example in AIX: chmod 666 /var/spool/syslog chown root /var/spool/syslog chgrp system /var/spool/syslog For example in HP-UX 9: chmod 666 /usr/adm/syslog chown root /usr/adm/syslog chgrp system /usr/adm/syslog 3. Edit the /etc/syslog.conf file and add the following line, depending on the operating system you are using: AIX "*.warning /var/spool/syslog" HP-UX 9 "*.warning /usr/adm/syslog" HP-UX 10 "*.warning /var/adm/syslog/syslog.log" SOLARIS "*.warning /var/adm/messages" SUNOS "*.warning /var/adm/messages" NOTE: If you are using DB2, then if you add entries for both warning and errors, then you will have double entries for each DB2 message in the syslog. 4. Stop and restart syslogd after modifying syslog.conf and cre- ating the log file. For example in AIX: stopsrc -s syslogd For example in HP (this is enough to re-read the config file): kill -HUP `cat /etc/syslog.pid` 5. Start the syslog daemon by issuing the following command, depending on the operating system you are using: AIX To stop use: stopsrc -s syslogd To start use: 10 How to do tasks in OEM platforms startsrc -s syslogd HP-UX "/etc/syslogd" SOLARIS "/usr/sbin/syslogd" SUNOS "/usr/etc/syslogd" 6. Verify that the syslog daemon is running: In AIX, Solaris and HP do: ps -ef | grep syslog 7. In SunOS do: ps -ax | grep syslog 8. Verify that the syslog daemon is able to write into the syslog file. The following test case can help you to deter- mine if the syslog has been configured properly: a. login with a CMVC family id b. use 'su root' and give a wrong password. This action will add a message to the syslog. c. if the syslog is properly set and running, then a message similar to this one will be added to the syslog: Apr 19 hostname su: BAD SU from userid to root at /dev/pts/3 or May 1 oem-hp03 syslog: su : - ttyp1 cmhp3ora-root 9. If you want to cleanup the syslog, you can use the following command: cp /dev/null ***************** => use the appropriate name NOTE: Refer to the /etc/syslog.conf file for the location of the syslog file. Monitor this file at regular intervals so that any required maintenance or problem resolution can be performed. 3.3 WHERE ARE THE HOST AND SERVICES FILES? +--- TO VERIFY -------------------------------------------------+ | | +---------------------------------------------------------------+ Administrative Tasks 11 UNIX "/etc/hosts" and "/etc/services" It is recommended that the system administration utilities should be used to update these files, such as smit in AIX and sam in HP-UX. OS/2 They are located in the directory described in the environment variable "SET ETC" WINDOWS 3.1 They are located in the appropriate directory that is different in each TCP/IP product. In IBM TCP/IP for DOS, the directory is TCPDOS\ETC. WINDOWS 95 TBD WINDOWS NT TBD 3.4 WHERE IS THE MAIL BOX? AIX 3.2.5 /var/spool/mail HP-UX 9 /usr/mail SOLARIS /var/mail SUNOS /usr/spool/mail 3.5 HOW TO CHANGE THE OWNER/GROUP OF A FILE? AIX chown user.group Also in AIX 4: chwon user:group HP-UX chown user:group SOLARIS chown user; chgrp group SUNOS chown user; chgrp group (only root can do it) In AIX, HP and Solaris, the command 'ls -l' will show both the owner and the group. In SunOS, this command will show only the owner. In SunOS, the command 'ls -lg' will show both the owner and the group. 12 How to do tasks in OEM platforms 3.6 HOW TO EXPORT DIRECTORIES? 3.6.1 AIX __________ The easiest way is to use "smit": 1. Logon as root. 2. Enter "smit" (GUI) or "smitty" (ASCII) 3. Select "Communications Applications and Services" 4. Select "NFS" 5. Select "Network File System" 6. Select "Add a Directory to exports lists" 3.6.2 SunOS and HP-UX ______________________ 1. Logon as root. 2. Enter the following command: exportfs /directory 3.6.3 Solaris ______________ 1. Logon as root. 2. Create a file, by entering the following command: /etc/dfs/dfstab init 3. Then: share -F nfs -o rw=host -d "cmvc client" /export/home/directory 3.7 HOW TO MOUNT DIRECTORIES? In AIX you can use smit and in HP-UX you can use sam to mount directories. Administrative Tasks 13 3.7.1 AIX, HP-UX, Solaris and SunOS ____________________________________ 1. Logon as root. 2. Enter the following command: mount carcps21:/home/build /export/home/build | | | host remote directory local directory to be mounted 3.8 HANDLING CD-ROMS 3.8.1 Installing code from CD-ROM in AIX _________________________________________ To install the CMVC code from CD-ROM, do the following: +--- QUICK START FOR EXPERTS -----------------------------------+ | | | Mount the CD-ROM as /CDROM. Use smit to install the appro- | | priate CMVC components. | | | +---------------------------------------------------------------+ NOTE: The SMIT command starts the System Management Interface Tool (smit) which presents a menu-driven environment for system administration tasks. For more information on smit, see your AIX operating system documentation. 3.8.1.1 Adding and mounting a CD-ROM file system Before you begin, add and mount a CD-ROM file system: 1. Insert the CD-ROM into the CD-ROM drive. 2. Log in as user ROOT or do SU - ROOT. 3. Create a directory for the CD-ROM, such as /CDROM by entering MKDIR /CDROM 4. Enter SMIT STORAGE to add a CD-ROM file system. 5. Select "File Systems" 6. Select "Add / Change / Show / Delete File Systems." 7. Select "CDROM File Systems" 14 How to do tasks in OEM platforms 8. Select "Add a CDROM File System" 9. Select a "DEVICE name". CD-ROM file system device names must be unique. You may need to delete a previously defined CD-ROM file system if there is a conflict. 10. Type /CDROM for "MOUNT POINT". 11. Select "Do" (or press enter if using the smit ascii inter- face). 12. Exit smit. 13. Enter SMIT MOUNTNFS to mount the CD-ROM file system. 14. Select /DEV/CD0 (or /DEV/CD1) for "FILE SYSTEM name". 15. Select /CDROM for "DIRECTORY over which to mount". 16. Select "cdrfs" for "TYPE of file system". 17. Select "yes" for "Mount as a READ-ONLY system.". 18. Select "Do" (or press enter if using the smit ascii inter- face). 19. Exit smit. Now you are ready to install the appropriate CMVC components. 3.8.1.2 Using smit to install the appropriate CMVC components After you have added and mounted the CD-ROM, do the following: 1. Enter SMIT INSTALL to install the CMVC components. 2. Select "Install / Update Software" 3. Select "Install / Update Selectable Software (Custom Install)" 4. Select "Install Software Products at Latest Available Level" 5. Select /CDROM for "INPUT device / directory for software". 6. Press F4 to display the list of CMVC components to install in the field "SOFTWARE to install" 7. Press F7 to select the appropriate CMVC component to install. 8. Follow the rest of the directions on the smit installation menus to install the CMVC components. Administrative Tasks 15 9. Exit smit 3.8.2 Installing from CD-ROM in HP-UX ______________________________________ To install the CMVC for HP-UX code from CD-ROM, do the following: 1. Insert the CD-ROM into the CD-ROM drive. 2. Log in as root and use System Administration Manager (SAM) to mount the CD-ROM as a file system under a directory, such as "/cdrom". In HP-UX 9, this may be done manually by doing: mount /dev/dsk/c201d2s0 /cdrom In HP-UX 10, this may be done manually by doing: mount /dev/dsk/c0t2d0 /cdrom 3. Type the following commands: cd /cdrom ./CMVCINST NOTE: In HP, the directories and file names in the CD-ROM are shown in UPPERCASE. 4. Follow the instructions in the installation script (CMVCINST) to install the appropriate CMVC client. 5. After the installation is completed, type the following com- mands: cd umount /cdrom 3.8.3 Installing from CD-ROM in Solaris ________________________________________ To install the Solaris systems client code from CD-ROM, do the following: 1. Insert the CD-ROM into the CD-ROM drive. The Solaris volume management automatically mounts the CD-ROM as /cdrom/cmvc_230. 2. Log in as root and type the following commands: cd /cdrom/cmvc_230 ./cmvcinst 16 How to do tasks in OEM platforms 3. Follow the instructions in the installation script to install the appropriate CMVC client. 4. After the installation is completed, type the following command: cd eject cdrom NOTE: If volume management is not running, contact your system administrator for instructions on mounting the CD-ROM. 3.8.4 Installing from CD-ROM in SunOS ______________________________________ To install the CMVC for Sun systems client code from CD-ROM, do the following: 1. Insert the CD-ROM into the CD-ROM drive. 2. Log in as root and type the following commands: mkdir /cdrom mount -r -t hsfs /dev/sr0 /cdrom cd /cdrom ./cmvcinst 3. Follow the instructions in the installation script (cmvcinst) to install the appropriate CMVC client. 4. After the installation is completed, type the following com- mands: cd umount /cdrom eject /dev/sr0 3.9 HOW TO SHUTDOWN AND REBOOT THE MACHINES? 3.9.1 AIX __________ 1. Logon as root. 2. Enter the following command to shutdown and reboot (quick restart): shutdown -Fr Administrative Tasks 17 3.9.2 HP _________ 1. Logon as root. 2. Enter the following command to shutdown and reboot: shutdown -r 3.9.3 Solaris ______________ 1. Logon as root. 2. Enter the following command to shutdown and reboot: shutdown -i6 3.9.4 SunOS ____________ 1. Logon as root. 2. Enter the following command to shutdown and reboot: sync; sync; sync; halt 3. Then, enter 'yes' that is OK to reboot. 3.10 HOW TO IDENTIFY AND KILL SEMAPHORES AND FREE SHARED MEMORY? You can use the CMVC sample /usr/lpp/cmvc/samples/stopCMVC to stop the CMVC daemons and to cleanup the semaphores and shared memory used by CMVC. 1. Logon as root. 2. Enter the following command to show the semaphores: ipcs -s 3. Enter the following command to kill a semaphore: ipcrm -s xxx Where xxx is the semaphore id identified in the previous step. 4. Enter the following command to show the shared memory: ipcs -m 18 How to do tasks in OEM platforms 5. Enter the following command to kill the shared memory: ipcrm -m xxx Where xxx is the shared memory id identified in the previous step. Administrative Tasks 19 20 How to do tasks in OEM platforms 4.0 DATABASE TASKS This section describes some common tasks that the administrator user of CMVC is likely to do with the database systems. 4.1 HOW TO START THE DATABASES? 4.1.1 DB2 __________ 1. Logon as the DB2 administrator. 2. Enter the following command: db2start 4.1.2 ORACLE _____________ 1. Logon as the ORACLE administrator. 2. To start Oracle, enter the following command: login as the Oracle administrator cd rdbms/install ./startup.sh ps -ef | grep ora ora716 14539 1 80 11:46:21 ? 0:01 ora_smon_ORCL ora716 14537 1 35 11:46:17 ? 0:00 ora_dbwr_ORCL ora716 14540 1 41 11:46:23 ? 0:00 ora_reco_ORCL ora716 14538 1 57 11:46:19 ? 0:01 ora_lgwr_ORCL ora716 14536 1 26 11:46:15 ? 0:00 ora_pmon_ORCL 4.1.3 INFORMIX 5 _________________ 1. Logon as the INFORMIX 5 administrator. 2. Enter the following command: /usr/db/informix/bin/tbinit /usr/db/informix/bin/tbstat -d 3. The first line will show if it is online or offline. For example: Database Tasks 21 RSAM Version 5.02.UC1 -- On-Line -- Up 00:00:02 -- 2448 Kbytes 4.1.4 INFORMIX 7 _________________ 1. Logon as the INFORMIX 7 administrator. 2. Enter the following command to start the database from off- line to on-line mode: /usr/db/informix/bin/oninit Enter the following command to verify if the database is on-line. If you get an error message about not able to access the shared memory, then this means (very likely) that the database is not on-line, because this command uses shared memory to verify if the database is on-line: /usr/db/informix/bin/onstat -d 3. Also try: ps -ef | grep oninit 4.1.5 SYBASE 4.9 _________________ 1. Logon as the SYBASE administrator. 2. Enter the following commands (AIX): cd /usr/db/sybase49/install RUNSERVER & exit 3. Enter the following commands (Solaris): cd /export/home2/sybase/sybase49/install RUN_SYBASE49 & exit 4. Verify that the daemon is running. From the sybase install directory, issue showserver 22 How to do tasks in OEM platforms 4.1.6 SYBASE 10 ________________ 1. Logon as the SYBASE administrator. 2. Enter the following commands (AIX): cd /usr/db/sybase/install RUN_SYBASE & exit 3. Enter the following commands (Solaris): cd /export/home2/sybase/sybase10/install RUN_SYBASE10 & exit 4. Verify that the daemon is running. From the sybase install directory, issue showserver 4.2 HOW TO STOP THE DATABASES? 4.2.1 DB2 __________ 1. Logon as the DB2 administrator. 2. Enter the following command: db2stop 4.2.2 ORACLE _____________ 1. Logon as the ORACLE administrator. 2. Enter the following command: sqldba lmode=y connect internal startup quit ; Also: login ora716 cd rdbms/install ./shutdown.sh Database Tasks 23 4.2.3 INFORMIX 5 _________________ 1. Logon as the INFORMIX 5 administrator. 2. Enter the following command: tbmode -k 4.2.4 INFORMIX 7 _________________ 1. Logon as the INFORMIX 7 administrator. 2. Enter the following command to change the state from on-line to off-line: onmode -k 4.2.5 SYBASE 4.9 _________________ 1. Logon as the SYBASE administrator. 2. Enter the following command: isql -Uuser -Ppassword > shutdown > go 3. From the sybase install directory, issue showserver 4. Kill the process that is running. 4.2.6 SYBASE 10 ________________ 1. Logon as the SYBASE administrator. 2. From the sybase install directory, issue showserver 3. Kill the process that is running. 24 How to do tasks in OEM platforms 4.3 HOW TO LOOK AT THE VERSIONS OF THE DATABASE? 4.3.1 DB2 __________ 1. login into an account that has access to the database 2. issue "db2" 3. The help message about the usage of the db2 command line will have something like this: Command Line Processor for DB2 SDK 2.1.0 4.3.2 Oracle _____________ 1. login into an account that has access to the database 2. change the directory to "rdbms/install" 3. issue "./startup.sh" 4. The output will have something like this: SQL*DBA: Release 7.1.6.2.0 - Production on Tue Aug 27 4.3.3 Informix _______________ 1. login into an account that has access to the database 2. issue "tbstat" 3. The output will have something like this: INFORMIX-OnLine Version 7.12.UC1 -- On-Line -- Up 4.3.4 Sybase: ______________ 1. login into an account that has access to the database 2. Database Tasks 25 isql -U sandsrv Password: sandsrv 1> select @@version 2> go --------------------------------------------------------------- SQL Server/4.9.2/P/RS6000/AIX3.2/1/OPT/Mon Jun 14 (1 row affected) 4.4 HOW TO GAIN ACCESS TO THE DATABASE? 4.4.1 DB2 __________ $DB2_HOME/sqllib/bin/db2 connect to familyName 4.4.2 ORACLE _____________ $ORACLE_HOME/bin/sqlplus familyName/$ORACLE_PASS 4.4.3 INFORMIX _______________ $INFORMIXDIR/bin/isql familyName 4.4.4 SYBASE _____________ $SYBASE/bin/isql -U familyName -P $SYBASE_PASS 4.5 HOW TO DUMP THE TRANSACTION LOG IN SYBASE? 1. logon into the family account 2. stop the cmvc daemons for the family 3. perform the following (first check the database space then dump) 26 How to do tasks in OEM platforms isql -P 1> sp_spaceused 2> go 1> dump transaction your_db_name_that_report_full with no_log 2> go You may get a warning message about the syslog being dumped. This is OK. 4. start the daemons. 4.6 HOW TO SETUP SYBASE DEVICES? To setup the devices, do the following and change the variables: # To setup the devices, do the following and change the variables: # xxx (family name), YYY (file path), XXXXX (integer), # Y1 (device number 1), Y2 (device number 2) # To find out the device numbers in use, do (in isql): # select distinct low/16777216 from sysdevices order by low # isql -U sa -P cmvcsyb > disk init name="cmibmsyb_dev", > physname="/home/sybase/cmvc-space/cmibmsyb/cmibmsyb_dev.dev", > vdevno=9, size=2048 > go > disk init name="cmibmsyb_log", > physname="/home/sybase/cmvc-space/cmibmsyb/cmibmsyb_log.log", > vdevno=2, size=2048 > go # export SYBASE_DBDEV="cmibmsyb_dev=9" # export SYBASE_LOGDEV="cmibmsyb_log=x" 4.7 HOW TO SETUP TABLE AND INDEX SPACES FOR ORACLE? 1. Login into oracle. 2. To setup the table space and index space, do the following and change the variables: Database Tasks 27 # Comment: XXX (with family name), xx (integer), YYY (file path) sqlplus system/manager create tablespace XXXtblsp datafile 'YYY/data01.dbf' size xxM default storage (initial 10k next 10k pctincrease 50 minextents 1 maxextents 120) ; create tablespace XXXndxsp datafile 'YYY/index01.dbf' size xxM default storage (initial 10k next 10k pctincrease 50 minextents 1 maxextents 120) ; quit; 4.8 HOW TO FIND OUT WHICH TABLE AND INDEX SPACES ARE DEFINED FOR ORACLE? 1. Login into oracle. 2. To find out which table and index spaces are defined for Oracle do the following: sqlplus system/manager # To list the names and default storage parameters of all # tablespaces: select tablespace_name "TABLESPACE", initial_extent "INITIAL_EXT", next_extent "NEXT_EXT", min_extents "MIN_EXT", max_extents "MAX_EXT", pct_increase from sys.dba_tablespaces; # To list the names, sizes and associated tablespaces: select file_name, bytes, tablespace_name from sys.dba_data_files; quit; 28 How to do tasks in OEM platforms 4.9 HOW TO SETUP THE ORACLE PROFILE? To create the profile for Oracle, do the following: 1. login oracle 2. cd sqlplus/admin 3. sqlplus system/manager @pupbld 4.10 HOW TO ADD ANOTHER FILE TO THE SYSTEM TABLE IN ORACLE? To add another file to the system table in oracle: alter tablespace system add datafile '/xxxx/xxx/xxx/xxx/xxx.dbf' size 20M; Where the datafile is the place where you have the table space and index files for Oracle. 4.11 HOW TO CREATE FILE DATABASE SPACE IN INFORMIX? To create a file database space (also known as "cooked"), in order to not use the root dbspace, do the following: 1. Login as the informix administrator. 2. Create directory where to store the regular dbspace, such as: mkdir /users/informix/cmvc-space 3. Create file where to store the regular dbspace, such as: touch /users/informix/cmvc-space/sandhp03 4. Use the tbspace utility (Informix 5) or the onspace utility (Informix 7): to create the regular dbspace. In the example below the dbspace is named "sandhp03" and with a size of 2.5MB and offset of 0. tbspaces -c -d sandhp03 -p /cmvc-space/sandhp03 -s 5000 -o 0 5. Verify that the new regular dbspace is active by using "tbstat -d" in Informix 5 or "onstat -d" in Informix 7. Database Tasks 29 4.12 INFORMIX 7: NEED TO UPDATE .RHOSTS AND /ETC/HOSTS.EQUIV Problem: To avoid the following problem when using the CMVC command "mkdb" to create the database for the family, it is necessary to add the name of the CMVC family in the files $INFORMIX/.rhosts and /etc/hosts.equiv in order to become an Informix trusted user. Creating the INFORMIX database. 956: Client host or user (cmhp3inf@oem-hp03) is not trusted by the server No such file or directory Error in line 1 Near character position 1 Solution: In $INFORMIXDIR create/update the .rhosts file and in the system root directory create/update the /etc/hosts.equiv file, for example: /users/informix(99) cat .rhosts oem-hp03.raleigh.ibm.com informix oem-hp03 informix oem-hp03.raleigh.ibm.com cmhp3inf oem-hp03 cmhp3inf 4.13 WHICH INTERPROCESS COMMUNICATION IS USED BETWEEN CMVC AND INFORMIX? Specify TCP/IP and not shared memory for the Informix file: sqlhosts. To avoid problems with unreleased shared-memory when doing some CMVC tasks, it is critical to NOT use the shared-memory con- nection for the Informix databases and use the TCP/IP connection. For example the file /usr/informix/etc/sqlhosts below shows one correct entry and one incorrect entry (which is commented out): oem_hp03 onsoctcp oem-hp03 online3 # oem_hp03 onipcshm oem-hp03 online3 30 How to do tasks in OEM platforms 4.14 HOW TO LOOK AT THE DATABASE TABLES FOR CMVC? DB2 is the example database used in this section. NOTES: 1. All the queries must be entered in the same line. Due to 80 characters limit in VM, I am showing split lines, but they should be a single line. 2. Replace the value of your family when you see , such as: db2 connect to toro Steps to look at the database tables for CMVC 1. Connect to the family db2 connect to 2. Query all the system tables owned by your family db2 "select name,creator,type from sysibm.systables where creator in '' " You should see something like: NAME CREATOR TYPE ------------------ -------- ---- ACCESSDOWNVIEW TORO V ACCESSFASTVIEW TORO V ACCESSNINHERITVIEW TORO V ACCESSTABLE TORO T ACCESSUPVIEW TORO V ACCESSVIEW TORO V APPROVALS TORO T ... COMPONENTS TORO T ... DEFECTDOWNVIEW TORO V DEFECTS TORO T DEFECTVIEW TORO V ... FEATUREDOWNVIEW TORO V FEATUREVIEW TORO V ... For a total of 67 records Note: V = View T = Table 3. Now that the tables/views for the family are shown to exist, then let's query an item from the COMPONENTS table: Database Tasks 31 db2 "select id,name from COMPONENTS where name='root'" ID NAME ----------- --------------------------------------------- 2 root 1 record(s) selected. 4. Now that we know that we can obtain data from a CMVC table, let's deal with defects and features: 5. Let's select a defect name that is likely to NOT exist in CMVC right now (successful query, with no errors, but with no records) db2 "select id,ownername from DEFECTVIEW where name='9999'" ID OWNERNAME ----------- --------------------------------------------- 0 record(s) selected. 6. Let's select a defect name that exist in the family, such as '123' in my toro family: db2 "select id,ownername from DEFECTVIEW where name='4500'" ID OWNERNAME ----------- --------------------------------------------- 366035 Lee R. Perlov 1 record(s) selected. Note: the ID is the internal id, not the name seen by the user. 7. Let's repeat 4.1 and 4.2 for features using FEATUREVIEW instead of DEFECTVIEW. 8. You can continue exploring the database for CMVC as you wish. 32 How to do tasks in OEM platforms 5.0 COPYRIGHTS, TRADEMARKS AND SERVICE MARKS The following terms used in this technical report, are trademarks or service marks of the indicated companies: +---------------------+-------------------------------------------+ | TRADEMARK, | COMPANY | | REGISTERED | | | TRADEMARK OR | | | SERVICE MARK | | +---------------------+-------------------------------------------+ | AIX, OS/2, IBM, | IBM Corporation | | DB2/6000, DB2, | | | VisualGen, CMVC | | | ImagePlus, | | | TeamConnection | | +---------------------+-------------------------------------------+ | UNIX, USL | UNIX System Laboratories, Inc. | +---------------------+-------------------------------------------+ | NetLS, Network | Apollo Computer, Inc., a subsidiary of | | Licensing System | Hewlett-Packard Co. | +---------------------+-------------------------------------------+ | OSF, OSF Motif | Open Software Foundation, Inc. | +---------------------+-------------------------------------------+ | PostScript | Adobe Systems Incorporated | +---------------------+-------------------------------------------+ | INFORMIX | Informix Inc. | +---------------------+-------------------------------------------+ | ORACLE | Oracle Corp. | +---------------------+-------------------------------------------+ | SYBASE | Sybase Inc. | +---------------------+-------------------------------------------+ | Sun, SunOS, | Sun Microsystems Inc. | | OpenWindows, Solaris| | +---------------------+-------------------------------------------+ | HP, HP-UX, | Hewlett-Packard Company | | SoftBench | | +---------------------+-------------------------------------------+ | Microsoft, Windows | Microsoft Corporation | +---------------------+-------------------------------------------+ | X Window System | Massachusetts Institute of Technology | +---------------------+-------------------------------------------+ END OF DOCUMENT Copyrights, Trademarks and Service marks 33