CMVC FREQUENTLY ASKED QUESTIONS: HINTS AND TIPS ON USING DATABASES AND OEM PLATFORMS Document Number TR 29.2298 Angel Rivera, Lee R. Perlov, Edna Wong Kyu CMVC/TeamConnection Development IBM Software Solutions Research Triangle Park, North Carolina Copyright (C) 1996, 1999. IBM Corp. All rights reserved. ii How to do tasks in OEM platforms ABSTRACT This technical report contains a collection of hints and tips for CMVC users and family administrators that must cope with the het- erogeneous operating system and database environments supported by CMVC. This document focuses on several system-related tasks that are different across the diverse platforms available to developers using CMVC. Some sample tasks are: o How to start and stop a database. o 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 an Advisory Software Engineer and team lead for the CMVC development. group. 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. LEE R. PERLOV Mr. Perlov is a Staff Software Engineer 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. EDNA WONG KYU Mrs. Kyu is a Staff Software Engineer for the Software Solutions division at Research Triangle Park. She joined IBM in 1987 and has worked in testing, 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. 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 Lee R. Perlov . . . . . . . . . . . . . . . . . . . . . . . v Edna Wong Kyu . . . . . . . . . . . . . . . . . . . . . . . v 1.0 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . 1 1.1 Supported Platforms . . . . . . . . . . . . . . . . . 1 1.2 Notes on terminology used in this document . . . . . . 2 1.3 Suggestion for Intel Users . . . . . . . . . . . . . . 2 1.4 About this and previous technical reports . . . . . . 2 1.5 Acknowledgements . . . . . . . . . . . . . . . . . . . 3 2.0 END USER TASKS . . . . . . . . . . . . . . . . . . . . . 5 2.1 Where is the CMVC code located? . . . . . . . . . . . 5 2.2 How to find out the version of CMVC? . . . . . . . . . 5 2.2.1 GUI - all platforms . . . . . . . . . . . . . . . . 5 2.2.2 UNIX - Client/Server . . . . . . . . . . . . . . . 5 2.2.3 Intel - Client . . . . . . . . . . . . . . . . . . 6 2.3 How to find out the version of the operating system? 6 2.3.1 UNIX - operating system version . . . . . . . . . . 7 2.3.2 Intel - operating system version . . . . . . . . . 7 2.4 Where are the customization files for the CMVC GUI? 7 2.4.1 UNIX - Customization files . . . . . . . . . . . . 7 2.4.2 Intel - Customization files . . . . . . . . . . . . 8 2.5 Is there a sample profile for the CMVC end user? . . . 8 2.5.1 UNIX - Sample profiles . . . . . . . . . . . . . . 9 2.5.2 Intel - Profile information . . . . . . . . . . . . 9 2.6 How to see the contents of files that are active (nohup.out, logs)? . . . . . . . . . . . . . . . . . . . . 9 2.7 How to link files and directories using symbolic links? 9 2.8 How much space is still available on disk? . . . . . 10 2.8.1 UNIX - Space in a file system . . . . . . . . . . 10 2.8.2 Intel - Space on each drive . . . . . . . . . . . 10 2.9 How to find out all the processes that are running? 10 2.9.1 UNIX - processes . . . . . . . . . . . . . . . . 10 2.9.2 Intel - Processes . . . . . . . . . . . . . . . . 11 2.10 How to test the connectivity of a host? . . . . . . 11 2.10.1 Using the ping command . . . . . . . . . . . . . 11 2.10.2 Using the host command (or equivalent) . . . . . 12 2.10.3 Using the nslookup command . . . . . . . . . . . 12 3.0 ADMINISTRATIVE TASKS . . . . . . . . . . . . . . . . . 13 3.1 Which are the main administration tools? . . . . . . 13 3.1.1 UNIX - Administrative GUI tools . . . . . . . . . 13 3.1.2 Intel - Administrative Tools . . . . . . . . . . 13 3.2 Is there a sample profile for the CMVC family? . . . 13 Contents vii 3.2.1 UNIX - Family profile . . . . . . . . . . . . . . 14 3.2.2 Intel - Profile information . . . . . . . . . . . 14 3.3 Where are the error messages from the CMVC daemon and databases? . . . . . . . . . . . . . . . . . . . . . . . 14 3.4 Where are the host and services files? . . . . . . . 17 3.5 How to change the owner/group of a file? . . . . . . 17 3.5.1 Intel - file ownership . . . . . . . . . . . . . 18 3.6 How to export directories to be mounted by other hosts? . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.6.1 UNIX - exporting directories . . . . . . . . . . 18 3.6.2 Intel - Exporting directories or drives . . . . . 20 3.7 How to mount directories exported by a remote host? 20 3.7.1 UNIX - mount command . . . . . . . . . . . . . . 21 3.7.2 Intel - mount command . . . . . . . . . . . . . . 21 3.8 Handling CD-ROMs . . . . . . . . . . . . . . . . . . 22 3.8.1 AIX - CD-ROMs . . . . . . . . . . . . . . . . . . 22 3.8.2 HP-UX - Using CD-ROMs . . . . . . . . . . . . . . 23 3.8.3 Installing from CD-ROM in Solaris . . . . . . . . 25 3.8.4 Installing from CD-ROM in SunOS . . . . . . . . . 26 3.9 How to shutdown and reboot the machines? . . . . . . 26 3.9.1 UNIX - shutdown . . . . . . . . . . . . . . . . . 26 3.9.2 Intel - How to shutdown and reboot . . . . . . . 28 3.10 How to identify and kill semaphores and free shared memory? . . . . . . . . . . . . . . . . . . . . . . . . . 28 3.11 Topics related to printers . . . . . . . . . . . . 29 3.11.1 HP-UX: How to setup a printer? . . . . . . . . . 29 3.11.2 AIX: How to setup printer access? . . . . . . . 30 3.11.3 Solaris: How to setup printer access? . . . . . 30 3.11.4 SunOS: how to setup remote printers? . . . . . . 31 3.12 Miscellaneous topics, by platform . . . . . . . . . 32 3.12.1 Solaris: How to fix problems with the /etc/vfstab file? . . . . . . . . . . . . . . . . . . . . . . . . . 32 4.0 DATABASE GENERIC TASKS . . . . . . . . . . . . . . . . 33 4.1 How to start the databases? . . . . . . . . . . . . 33 4.1.1 DB2 . . . . . . . . . . . . . . . . . . . . . . . 33 4.1.2 Oracle . . . . . . . . . . . . . . . . . . . . . 33 4.1.3 Informix 5 . . . . . . . . . . . . . . . . . . . 34 4.1.4 Informix 7 . . . . . . . . . . . . . . . . . . . 34 4.1.5 Sybase 4.9 . . . . . . . . . . . . . . . . . . . 34 4.1.6 Sybase 11 . . . . . . . . . . . . . . . . . . . . 35 4.2 How to stop the databases? . . . . . . . . . . . . . 35 4.2.1 DB2 . . . . . . . . . . . . . . . . . . . . . . . 35 4.2.2 Oracle . . . . . . . . . . . . . . . . . . . . . 35 4.2.3 Informix 5 . . . . . . . . . . . . . . . . . . . 36 4.2.4 Informix 7 . . . . . . . . . . . . . . . . . . . 36 4.2.5 Sybase 4.9 . . . . . . . . . . . . . . . . . . . 36 4.2.6 Sybase 10 . . . . . . . . . . . . . . . . . . . . 37 4.3 How to find out the version of the database? . . . . 37 4.3.1 DB2 . . . . . . . . . . . . . . . . . . . . . . . 37 4.3.2 Oracle . . . . . . . . . . . . . . . . . . . . . 37 4.3.3 Informix . . . . . . . . . . . . . . . . . . . . 38 4.3.4 Sybase: . . . . . . . . . . . . . . . . . . . . . 38 4.4 How to gain access to the database? . . . . . . . . 38 viii How to do tasks in OEM platforms 4.5 How to look at the database tables for CMVC? . . . . 39 5.0 TASKS THAT ARE SPECIFIC TO A PARTICULAR DBMS . . . . . 41 5.1 DB2 . . . . . . . . . . . . . . . . . . . . . . . . 41 5.1.1 How to add more file system space to the DB2 tablespace? . . . . . . . . . . . . . . . . . . . . . . 41 5.1.2 Backup/restore a DB2 database . . . . . . . . . . 41 5.2 Informix . . . . . . . . . . . . . . . . . . . . . . 42 5.2.1 How to change the state from online to quiescent in Informix? . . . . . . . . . . . . . . . . . . . . . . . 42 5.2.2 What does it mean "shared memory not initialized" in Informix? . . . . . . . . . . . . . . . . . . . . . . 42 5.2.3 How to create file database space in Informix? . 43 5.2.4 Informix 7: need to update .rhosts and /etc/hosts.equiv . . . . . . . . . . . . . . . . . . . . 43 5.2.5 Which interprocess communication is used between CMVC and Informix? . . . . . . . . . . . . . . . . . . . 44 5.2.6 Backup/Restore an Informix database . . . . . . . 44 5.3 Oracle . . . . . . . . . . . . . . . . . . . . . . . 45 5.3.1 How to setup table and index spaces for Oracle? . 45 5.3.2 How to find out which table and index spaces are defined for Oracle? . . . . . . . . . . . . . . . . . . 46 5.3.3 How to setup the Oracle profile? . . . . . . . . 46 5.3.4 How to add another file to the system table in Oracle? . . . . . . . . . . . . . . . . . . . . . . . . 47 5.3.5 Backup/restore an Oracle database . . . . . . . . 47 5.4 Sybase . . . . . . . . . . . . . . . . . . . . . . . 48 5.4.1 How to dump the transaction log in Sybase? . . . 48 5.4.2 How to move the transaction log to a new device in Sybase? . . . . . . . . . . . . . . . . . . . . . . . . 49 5.4.3 How to see what devices are defined in Sybase? . 49 5.4.4 How to find which device numbers are in used in Sybase? . . . . . . . . . . . . . . . . . . . . . . . . 49 5.4.5 How to setup a device in Sybase? . . . . . . . . 50 5.4.6 How to add more DASD to SYBASE_DBDEV? . . . . . . 50 5.4.7 How to drop a device in Sybase? . . . . . . . . . 51 5.4.8 How to drop a normal database in Sybase? . . . . 51 5.4.9 How to drop a suspect database in Sybase? . . . . 51 5.4.10 How to create a database in Sybase? . . . . . . 51 5.4.11 How to find out how much space is used in the syslog in Sybase? . . . . . . . . . . . . . . . . . . . 52 5.4.12 Backup/Restore a Sybase database . . . . . . . . 52 APPENDIX A. BIBLIOGRAPHY . . . . . . . . . . . . . . . . . 55 A.1 How to get electronic copies of manuals and technical reports . . . . . . . . . . . . . . . . . . . . . . . . . 55 A.1.1 IBM Intranet . . . . . . . . . . . . . . . . . . 55 A.1.2 Internet . . . . . . . . . . . . . . . . . . . . 56 APPENDIX B. COPYRIGHTS, TRADEMARKS AND SERVICE MARKS . . . 59 Contents ix x 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 operating system platforms and relational databases in which the CMVC product runs. This document separates tasks into those performed by family administrators and system administrators, and those performed by general users of CMVC. Each task is grouped, where appropriate, into There are subsections where differences exist between specific operating systems in a group. For example, the administrative tool in AIX is SMIT and the corresponding tool for HP-UX is SAM. 1.1 SUPPORTED PLATFORMS The operating systems that have both server and client code are: AIX 3.2.5 AIX 4 HP-UX 9 HP-UX 10 Solaris 2 SunOS 4.1.3 The operating systems that have only client code are: OS/2 Windows 3.1 The databases are: DB2 V1 and V2 Informix 5 and 7. Oracle 7.1 and 7.2 (but not 7.3 or later) Sybase 4.9 and System 10 Introduction 1 1.2 NOTES ON TERMINOLOGY USED IN THIS DOCUMENT o Some tasks are UNIX specific due to the multi-user character- istics of this class of operating system. o The names of the operating systems will be used without the version numbers, when there is no need to specify it. For example, the term "AIX" means in this document "AIX Version 4". o The term UNIX will be used as a generic term for all the dif- ferent UNIX versions when there is no need to specify one of them. o The term Intel will be used as a generic term for the non-UNIX operating systems that run under Intel processors (OS/2 and Windows) when there is no need to specify one of them. 1.3 SUGGESTION FOR INTEL USERS We strongly recommend installing a package of UNIX-like commands for your Intel platform. These packages are generally inexpensive and provide between 30 and 100 useful tools that are common to UNIX operating systems. These tools will allow you to perform most of the UNIX commands described in this document on your Intel operating system. You may try to find such packages from the Internet by using search engines such as "http://www.yahoo.com/" and using keywords such as "OS/2 utilities" or "Windows NT utilities". 1.4 ABOUT THIS AND PREVIOUS TECHNICAL REPORTS This document, as well as other recently released technical reports related to CMVC, contains some information that was pre- viously available in other "unofficial" documents. We have endeavored to better organize the information and improve its readability so that you will find it more useful. This technical report supersedes the technical report TR 29.2180 HOW TO DO ROUTINE TASKS IN THE OEM PLATFORMS FOR CMVC and it replaces the CMVC readme file /USR/LPP/CMVC/DOC/README.HOW.TO.OEM. Please use the new tech- nical report when possible, as we have made many improvements and will be removing the older documents from our shipped media and ftp sites. 2 How to do tasks in OEM platforms 1.5 ACKNOWLEDGEMENTS Many of the questions and answers that are compiled in this tech- nical report were obtained from the CMVC forum in the IBMPC con- ferencing disk and from the CMVC6000 forum in the IBMUNIX conferencing disk. We want to thank the main participants in these electronic forums for their support! Also, we want to thank Dodde Stark for editing this technical report. Introduction 3 4 How to do tasks in OEM platforms 2.0 END USER TASKS This section describes some common tasks and useful information for CMVC client users. 2.1 WHERE IS THE CMVC CODE LOCATED? The default location for the CMVC code is: AIX "/usr/lpp/cmvc" HP-UX "/usr/lpp/cmvc" SOLARIS "/usr/lpp/cmvc" SUNOS "/usr/lpp/cmvc" OS/2 "c:\cmvc" WINDOWS 3.1 "c:\cmvcwin" 2.2 HOW TO FIND OUT THE VERSION OF CMVC? 2.2.1 GUI - all platforms __________________________ The version of the CMVC GUI for all platforms can be found from the Help pulldown, option "Product Information". NOTE: It is important to understand that the version of the GUI might be different than the version of the line commands and of the server, because the GUI uses a different message catalog. 2.2.2 UNIX - Client/Server ___________________________ The version of the CMVC server and client for UNIX can be found as follows: 1. Find out the directory where the daemon (cmvcd) or the client is installed: o For AIX, SunOS or Solaris, enter: End User Tasks 5 which cmvcd o For HP-UX, enter: whence cmvcd 2. Change to the directory shown in the step above. 3. Find out the 'what' strings and search for 'cmvc': o For the server, do the following: what cmvcd | grep cmvc o For the client, such as the Report line command, do the following: what Report | grep cmvc 2.2.3 Intel - Client _____________________ The client and code for Intel has the same "what" strings and if you have access to a similar "what" and "grep". command, then you can find out the version of the CMVC executables. For OS/2 and Windows, CMVC provides a version of the "what" command: "cmvcwhat". o Locate the CMVC "exe" directory on the path: echo %PATH% or PATH o Change to the directory shown above. o Find the 'what' strings and manually search for 'cmvc': cmvcwhat Report | more 2.3 HOW TO FIND OUT THE VERSION OF THE OPERATING SYSTEM? 6 How to do tasks in OEM platforms 2.3.1 UNIX - operating system version ______________________________________ You can use the command "uname -a". The output will be similar to: AIX 1 4 operating-system-name release version 2.3.1.1 AIX level version For AIX, you can then find the level (that is, version.release.level) using the "oslevel" command. 2.3.1.2 X-Windows server version The X-Windows server is the program the manages the graphical display on your system and communicates with the TeamConnection GUI for UNIX. The X-Windows server needs to be running when you run the following command that displays the release number, among other data: xrdb -symbols 2.3.2 Intel - operating system version _______________________________________ You can use the command "ver". 2.4 WHERE ARE THE CUSTOMIZATION FILES FOR THE CMVC GUI? 2.4.1 UNIX - Customization files _________________________________ 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. End User Tasks 7 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. For advanced users: to guarantee that your new Cmvc changes are loaded do the following: 1. Exit the CMVC gui 2. xrdb -remove 3. xrdb -load Cmvc o .cmvcrc This is the file that contains the tasks shown in the CMVC GUI 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. 2.4.2 Intel - Customization files __________________________________ 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. 2.5 IS THERE A SAMPLE PROFILE FOR THE CMVC END USER? 8 How to do tasks in OEM platforms 2.5.1 UNIX - Sample profiles _____________________________ The following sample profile can be used as the basis for the profile of a UNIX user account that will use CMVC (end-user). The user will have to read thru the entire profile and delete the comment character of those lines that are appropriate for the operating system to be used. /usr/lpp/cmvc/samples/profile.user 2.5.2 Intel - Profile information __________________________________ Since Intel operating systems are single user systems, the CMVC installation script addresses all environmental configuration needs. 2.6 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 the following: 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 no longer scrolling, then the file is not being updated anymore. 4. You have to press Ctrl+C to exit from the tail command. 2.7 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 Use the following command in order to see the real file/directory of a shadow file/directory: ls -l End User Tasks 9 2.8 HOW MUCH SPACE IS STILL AVAILABLE ON DISK? 2.8.1 UNIX - Space in a file system ____________________________________ To show, in kilobytes, the space left in the file system, use: AIX df -k Without "-k" the default is to show the size in 512 byte blocks. HP-UX bdf SOLARIS df -k SUNOS df -a 2.8.2 Intel - Space on each drive __________________________________ To show the space available on any logical disk drive, use: dir /w [DRIVE-LETTER] or chkdsk [DRIVE-LETTER] 2.9 HOW TO FIND OUT ALL THE PROCESSES THAT ARE RUNNING? 2.9.1 UNIX - processes _______________________ To see the processes related to CMVC that are running, do the following: o To find out how many CMVC family server daemons are running on the entire system: ps -ef | grep cmvcd In SunOS use: ps -ax | grep cmvcd o To find out all of the processes running in a family account: 10 How to do tasks in OEM platforms ps -fu FAMILY_ACCOUNT 2.9.2 Intel - Processes ________________________ 2.9.2.1 OS/2 - process status pstat | more 2.9.2.2 Windows 3.1 You can use the Task Manager to find out which processes are running. 2.10 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.10.1 Using the ping command ______________________________ The "ping" command is the first tool that the user should use to diagnose possible network problems. 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. End User Tasks 11 2.10.2 Using the host command (or equivalent) ______________________________________________ In AIX and in OS/2 there is a command called "host" which gets the IP address given a host name or vice versa. This command uses the local /etc/hosts file first and if the host name or the IP address is not found there, then the network name server is contacted next. 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 the following command and notice the IP address associated with it: host HOST_NAME 2. Then issue the following command and you SHOULD get the host name obtained in the previous step. host IP_ADDRESS In some networks the second step gives a different host name and this will cause problems with CMVC. In other platforms we provide the "cmvchost" or "tchostw" command which provides the basic functionality of the "host" command pro- vided in AIX and OS/2. 2.10.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. 12 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 WHICH ARE THE MAIN ADMINISTRATION TOOLS? 3.1.1 UNIX - Administrative GUI tools ______________________________________ AIX The main tool is "smit" for GUI or "smitty" for a character-based interface. for command line inter- face. HP-UX The main tool is "sam" for GUI. This tool is very hard to use when using the command line. SOLARIS The main tool is "admintool" for GUI. 3.1.2 Intel - Administrative Tools ___________________________________ 3.1.2.1 OS/2 The vast majority of administrative actions can be found by opening the System Icon. 3.1.2.2 Windows 3.1 The limited system administration facilities are in: o "Main Icon"->"System Icon" 3.2 IS THERE A SAMPLE PROFILE FOR THE CMVC FAMILY? Administrative Tasks 13 3.2.1 UNIX - Family profile ____________________________ The following sample profile can be used as the basis for the profile of a UNIX user account that will serve as a CMVC family: /usr/lpp/cmvc/install/profile.DB where DB is the database name. The CMVC family administrator will have to read the entire profile and remove the comment character of those lines that are appropriate for the operating system in question. 3.2.2 Intel - Profile information __________________________________ Since Intel operating systems are single user systems, the CMVC installation script addresses all environmental configuration needs. 3.3 WHERE ARE THE ERROR MESSAGES FROM THE CMVC DAEMON AND DATABASES? Errors encountered by CMVC are recorded in the system log file (syslog) when the syslog daemon (syslogd) is activated. If syslog is not activated, error messages are sent to the console of the CMVC server workstation; however, these messages eventu- ally will scroll off the screen. Because 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 syslog file if it does not exist already 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" 14 How to do tasks in OEM platforms 2. When creating the syslog file, set the file permissions according to the directions for the operating system: o AIX: chmod 666 /var/spool/syslog chown root:system /var/spool/syslog o HP-UX: chmod 666 /usr/adm/syslog/syslog.log chown root:system /usr/adm/syslog/syslog.log o Solaris: chmod 666 /var/adm/messages chown root:system /var/adm/messages NOTES: a. If you do not want to use "chmod 666", you can use any of the following: chmod a=rw /var/adm/syslog or chmod ugo=rw /var/adm/syslog b. The command "chown root:system" is a short way to do the following: chown root /var/spool/syslog chgrp system /var/spool/syslog 3. Edit the /etc/syslog.conf file and add the following line: NOTE: You must use a tab character to separate the values. 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. Administrative Tasks 15 a. AIX: stopsrc -s syslogd startsrc -s syslogd b. HP-UX 9: kill -HUP `cat /etc/syslog.pid` c. HP-UX 10: kill -HUP `cat /var/run/syslog.pid` d. Solaris ps -ef | grep syslog # Find the process id for syslogd kill -9 ******************** => use the process id /usr/sbin/syslogd e. SunOS ps -ax | grep syslog # Find the process id for syslogd kill -9 ******************** => use the process id /usr/etc/syslogd 5. Verify that the syslog daemon is running: In AIX, Solaris and HP-UX do: ps -ef | grep syslog 6. In SunOS do: ps -ax | grep syslog You should see an entry for syslogd. 7. 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. To quickly view the last 10 lines of the syslog, do: tail ****************** => use the appropriate name 16 How to do tasks in OEM platforms d. 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 8. If you want to cleanup the syslog, you can use the following command: cp /dev/null **************** => use the appropriate name 9. Monitor this file at regular intervals so that any required maintenance or problem resolution can be performed. 3.4 WHERE ARE THE HOST AND SERVICES FILES? The "hosts" file is used to indicate the IP address of a host and aliases for that host. The "services" file is used to indicate the port number of the service (CMVC family). 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 differ in each TCP/IP product. In IBM TCP/IP for DOS, the directory is TCPDOS\ETC. 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) Administrative Tasks 17 NOTES: 1. In AIX, HP and Solaris, the command 'ls -l' will show both the owner and the group. 2. In SunOS, the command 'ls -l' will show only the owner. In SunOS, the command 'ls -lg' will show both the owner and the group. 3. The command "chown user:group" is a short way to do the fol- lowing: chown user file chgrp group file 3.5.1 Intel - file ownership _____________________________ Intel operating systems do not have the concept of ownership for ordinary files. 3.6 HOW TO EXPORT DIRECTORIES TO BE MOUNTED BY OTHER HOSTS? This section assumes that you are using TCP/IP and the NFS daemon to export your filesystems. For Intel platforms and AIX there is support for IBM OS/2 Warp Server and other traditional Intel "net use" facilities. 3.6.1 UNIX - exporting directories ___________________________________ 3.6.1.1 AIX - /etc/exports You can use the sam tool to specify the directories to be exported; this information is stored in /etc/exports: 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" 18 How to do tasks in OEM platforms 6. Select "Add a Directory to exports lists" AIX also allows client access to IBM OS/2 Warp Server drivers through "net use", starting with AIX 4.1.4. 3.6.1.2 HP-UX You can use the sam tool to specify the directories to be exported; this information is stored in /etc/exports: 1. Logon as root. 2. At the command prompt, enter "sam". 3. Double click on the Networking and Communications icon. 4. Double click on the Networked File Systems icon. 5. Double click on the Exported Local Filesystems icon. 6. From the menu bar, select Actions. Then select Add Exported File System. 7. In the Local Directory Name field, enter the absolute path name of the directory to export. Also select other options on the same screen as appropriate for your system. 8. Then click on the OK box. This will export your directory to the specified machines immediately. 3.6.1.3 Solaris The Solaris admintool does NOT provide a convenient method of updating /etc/dfs, so we have provided the manual process below: 1. Logon as root. 2. Change directory to /etc/dfs. 3. Edit the file dfstab which is a file containing commands for sharing resources across a network. Append a share command to the end of this file. Use the man command to find out more information about the share command. Add a share command in the dfstab file. For example: share -F nfs -o rw=host -d "CMVC client" /export/home/dir 4. Save and exit the file. Administrative Tasks 19 5. For the export to take effect immediately, execute the same share command on the command line. 3.6.1.4 SunOS 1. Logon as root. 2. Enter the following command: exportfs /directory 3.6.2 Intel - Exporting directories or drives ______________________________________________ 3.6.2.1 OS/2 IBM TCP/IP provides an NFS daemon. Since this is a separate product from the operating system we will only cover this facility briefly. 1. Add export directories by updating the "exports" file in the directory pointed to by the ETC environment variable. 2. Restart TCP/IP with the "tcpstart" command. 3. Verify the new export with the "showexp SYSTEM_NAME" command. NOTE: We have found the "showexp" command to be unique to OS/2. It is very useful for checking NFS exports in a heterogeneous environment. 3.6.2.2 Windows 3.1 The operating system does NOT support an NFS daemon (the process that manages an NFS export) in the operating system. The NFS server for this platform is provided by third-party vendors. Follow the instructions provided by the vendor. 3.7 HOW TO MOUNT DIRECTORIES EXPORTED BY A REMOTE HOST? 20 How to do tasks in OEM platforms 3.7.1 UNIX - mount command ___________________________ The best way to mount directories that are exported by a remote host is to use the system administration tool. If you have mounted directories as part of your normal system configuration, you can use the system administration tool and have the operating system mount the directories during bootup and initialization. Note that if your network is experiencing problems, your system may hang or take a long time to complete the bootup process. 3.7.1.1 Mounting directories using manual commands 1. Logon as root. 2. Enter the following command: mount carcps21:/home/build /home/build | | | host remote directory local directory to be mounted 3.7.1.2 AIX mount AIX supports administering mounts through smit. AIX also supports "net use" for drives exported by OS/2 Warp Server. 3.7.2 Intel - mount command ____________________________ 3.7.2.1 OS/2: OS/2 mount syntax: mount carcps21:c:\home\build x: | | | | host remote remote directory local drive drive if to be mounted an Intel Server Administrative Tasks 21 3.7.2.2 Windows 3.1 The operating system does NOT support an NFS client (the process that mounts an exported file system from a remote host) in the operating system. The NFS client for this platform is provided by third-party vendors. Follow the instructions provided by the vendor. 3.8 HANDLING CD-ROMS 3.8.1 AIX - CD-ROMs ____________________ Before you can use a CD-ROM in AIX, you have to mount the CD-ROM. Once the CD-ROM is mounted, then you can access it. 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" 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). 22 How to do tasks in OEM platforms 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. 9. Exit smit 3.8.2 HP-UX - Using CD-ROMs ____________________________ Before you can use a CD-ROM in HP-UX, you have to mount the CD-ROM. Once the CD-ROM is mounted, then you can access it. Administrative Tasks 23 3.8.2.1 HP-UX - Mounting a CD-ROM Do the following to add and mount a CD-ROM file system: 1. Insert the installation CD into the CD-ROM drive. 2. Log in as user ROOT or type su - root. 3. Issue the mount command to determine if the CD-ROM file system is mounted and operational. Verify that /cdrom is listed; if, not, then do the following: a. To create a directory for the CD-ROM, type mkdir /cdrom. b. Type: sam & c. Select Disks and File Systems. d. Select Disk Devices. e. Select the entry CDFS (for CD-ROM File System), then from the menu bar select "Actions" and choose the option "View more information". f. Click on the Show Device Files. Do not select raw devices such as /dev/rdsk/c0t2d0. g. Write down the value for Device File. In HP-UX 9, it might be: /dev/dsk/c201d2s0 In HP-UX 10, it might be: /dev/dsk/c0t2d0 h. Close the View More Information window. i. Close the Disks and File Systems window. j. Exit sam. k. To mount the CD-ROM device file identified above, do the following. 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 24 How to do tasks in OEM platforms l. Issue the mount command again and verify that /cdrom is listed. 3.8.2.2 HP-UX - Installing CMVC code from CD-ROM To install the CMVC for HP-UX code from CD-ROM, do the following: 1. Log in as root. 2. Type the following commands: cd /cdrom ./CMVCINST NOTE: In HP, the directories and file names in the CD-ROM are shown in UPPERCASE. 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 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 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 Administrative Tasks 25 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 UNIX - shutdown ______________________ 3.9.1.1 Miscellaneous notes before shutdown In order to efficiently shutdown a system, it is recommended that you follow these suggestions before you actually shutdown the system: 1. It is recommended to shutdown your system from a local session that does not use a windowing system (otherwise, the shutdown time will be longer because the windowing system has to be shutdown too). 2. If possible, unmount all the mounted NFS file systems. 26 How to do tasks in OEM platforms 3.9.1.2 Miscellaneous notes after reboot After the system has been rebooted, it is suggested that you should manually remount the necessary NFS file systems and if desired, start specific processes that may not be started auto- matically after reboot, such as the database server. Sometimes it is not convenient to automatically mount NFS file systems. For example, Host A and Host B are being rebooted at the same time. If Host B NFS mounts directories from Host A, Host B will hang during bootup until Host A is completely ini- tialized and has its nfsd and mountd daemons running. Then Host B can NFS mount directories from Host A and complete its bootup. It is also convenient to startup processes only when they are needed, such as databases. This is advantageous when you know that the system is heavily used and when there is no need for some databases to be running all the time. In order to facilitate these tasks, you can, as root, create a shell script that will mount the necessary NFS file systems and start the desired processes. +--- ADD SAMPLE SHELL ------------------------------------------+ | | +---------------------------------------------------------------+ 3.9.1.3 AIX - shutdown 1. Logon as root. 2. Enter the following command to shutdown and reboot (quick restart): shutdown -Fr 3.9.1.4 HP-UX - shutdown 1. Logon as root. 2. Enter the following command to shutdown and reboot: shutdown -r Administrative Tasks 27 3.9.1.5 Solaris - shutdown 1. Logon as root. 2. Enter the following command to shutdown and reboot: shutdown -i6 3.9.1.6 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.9.2 Intel - How to shutdown and reboot _________________________________________ 3.9.2.1 OS/2 - setboot The OS/2 "setboot /b" command will cause OS/2 to shutdown and reboot. You can also manually specify Shut Down from the desktop menu (point to the desktop and click right button). 3.9.2.2 Windows 3.1 You need to manually exit Windows and then reboot by doing a Ctrl-Alt-Del or power off then power on the system 3.10 HOW TO IDENTIFY AND KILL SEMAPHORES AND FREE SHARED MEMORY? NOTE: It seems that there is a limit of only 10 semamphores in a default installation in Solaris; in this case, you may get the error message when trying to start a CMVC family server: "CreateSemAccept() fail semget()". In this case, you need to man- ually remove a semaphore. 28 How to do tasks in OEM platforms To cleanup the semaphores and shared memory used by one CMVC family, you can do one of the following: o Use the CMVC utility /usr/teamc/bin/stopCMVC which also stops the CMVC daemons. o Perform the following manual procedure: 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 5. Enter the following command to kill the shared memory: ipcrm -m xxx Where xxx is the shared memory id identified in the pre- vious step. 3.11 TOPICS RELATED TO PRINTERS 3.11.1 HP-UX: How to setup a printer? ______________________________________ You can set up local or remote printer access using "sam". 1. At the command line prompt, enter 'sam'. 2. Select the 'Printers and Plotter' icon. 3. Select the 'Printers and Plotter' icon again. 4. From the 'Actions' pull down, select local, remote or network based printer access. 5. Complete and/or answer the screens that appear. Administrative Tasks 29 Please also refer to your system documentation for further infor- mation on local, remote or network printer setup. 3.11.2 AIX: How to setup printer access? _________________________________________ You can use the "smit" or "smitty" tool to set up local or remote printer access. The steps below show how to set up remote printer access. Please refer to system documentation for local set up. 1. Type 'smitty' at a command line prompt. 2. At the System Management screen select 'Print Spooling'. 3. At the Print Spooling screen select 'Add a Print Queue'. 4. At the Add a Print Queue screen select 'remote'. 5. At the Type of Remote Printing screen select 'Standard Proc- essing'. 6. At this final screen, you will be asked to enter the fol- lowing information: o Name of QUEUE to a add o HOSTNAME of remote server o Name of QUEUE on remote server o TYPE of print spooler 7. Press enter and the new print queue will be added. 8. Exit smitty and verify the setup by attempting to print a small ascii text file using the lp command. Please also refer to your system documentation for further infor- mation on printer setup. 3.11.3 Solaris: How to setup printer access? _____________________________________________ There are 2 options: o You can set up local or remote printer access using the "admintool" in Solaris. 1. At the command line prompt, enter 'admintool'. 2. Select 'Browse', then 'printer' from the pull down menu. 30 How to do tasks in OEM platforms 3. On the 'Admintool: Printers' pull down menu, select 'Edit', then 'add' and then one of the following: - 'Access to Printer' for remote printer set up, or - 'Local Printer' for local printer setup. 4. Complete the information on the screen and select 'OK'. Please also refer to your system documentation for further information. o You can use the line commands below to setup a printer. 1. Ensure that the client is allowed to print on the host. 2. Do the following: lpsystem -t bsd server_name lpadmin -p new_name -s hostname!printer_name lpadmin -p new_name -T unkonwn # unless PS (PostScript) lpadmin -p new_name -I simple # unless above is PS 3. Change directory to /etc/lp/fd 4. Do the following: sh for f in download dpost postio postior postprint postreverse do lpfilter -f $f -F $f.fd done 5. Do the following: accept new_name enable new_name 3.11.4 SunOS: how to setup remote printers? ____________________________________________ 1. Create a buffer directory, such as "/var/spool/brocklpd". 2. Add the following line to describe the remote printer in "/etc/printcap": brlp|remote printer:\ :lp=:rm=brock:rp=+lpt1:sd=/var/spool/brocklpd: 3. Stop and restart "/usr/lib/lpd". Administrative Tasks 31 3.12 MISCELLANEOUS TOPICS, BY PLATFORM 3.12.1 Solaris: How to fix problems with the /etc/vfstab file? _______________________________________________________________ If this file is corrupted, such as wrong parameters were used, then the system could hang when trying to mount or to perform fchk. To solve this problem, boot from the Solaris install disk. When the GUI is shown, mount the /etc file system; you must use the device name, such as: mount /dev/dsk/c0t1d0s0 /mnt Then you can correct the invalid entry. 32 How to do tasks in OEM platforms 4.0 DATABASE GENERIC 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. For Oracle 7.1.6: login ora716 cd rdbms/install ./startup.sh 2. For Oracle 7.3.3: login ora733 cd products/733 cd rdbms/install cd rdbms ./startup.sh Wait for the end of the startup process: SVRMGR> Server Manager complete. 3. Verify that the Oracle processes were started: 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 Database generic tasks 33 Where the suffix used in the process names is the Oracle SID. 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: 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): 34 How to do tasks in OEM platforms cd /export/home2/sybase/sybase49/install RUN_SYBASE49 & exit 4. Verify that the daemon is running. From the sybase install directory, issue showserver 4.1.6 Sybase 11 ________________ 1. Logon as the SYBASE administrator. 2. Enter the following commands (AIX): cd $HOME/install RUN_SYBASE & exit 3. 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 ; Database generic tasks 35 3. Also for Oracle 7.1.6: login ora716 cd rdbms/install ./shutdown.sh 4. Also for Oracle 7.3.3: login ora733 cd products/733 cd rdbms/install cd rdbms ./shutdown.sh Wait for the end of the shutdown process: SVRMGR> Server Manager complete. 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 3. If you try "onstat -d" you may get the following error message which indicates that the Informix server is not running: onstat: Cannot attach to shared memory. errno = 22 4.2.5 Sybase 4.9 _________________ 1. Logon as the Sybase administrator. 2. Enter the following command: 36 How to do tasks in OEM platforms 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. 4.3 HOW TO FIND OUT THE VERSION 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 Database generic tasks 37 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. 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) For Sybase 11: ---------------------------------------------------------------------- SQL Server/11.0.2/P/Sun_svr4/OS 5.4/1/OPT/Tue Sep 10 14:03:23 PDT 1996 (1 row affected) 4.4 HOW TO GAIN ACCESS TO THE DATABASE? DB2 Enter: $DB2_HOME/sqllib/bin/db2 connect to familyName ORACLE Enter: $ORACLE_HOME/bin/sqlplus familyName/$ORACLE_PASS INFORMIX Enter: $INFORMIXDIR/bin/isql familyName SYBASE Enter: 38 How to do tasks in OEM platforms $SYBASE/bin/isql -U $LOGNAME -P $SYBASE_PASS 4.5 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 Database generic tasks 39 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: 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. 40 How to do tasks in OEM platforms 5.0 TASKS THAT ARE SPECIFIC TO A PARTICULAR DBMS This chapter describes some tasks that are specific to a partic- ular database management system (DBMS). 5.1 DB2 5.1.1 How to add more file system space to the DB2 tablespace? _______________________________________________________________ 1. Log in as root id. 2. Use "smit" to increase the size of the file system where your DB2 database resides. The path of the filesystem should be set in the environment variable DB2_DBPATH. 5.1.2 Backup/restore a DB2 database ____________________________________ 5.1.2.1 Backup Use the DB2 BACKUP command. 1. Login to the family. 2. Make a new directory "backup" and change the permission to 777: mkdir backup chmod 777 backup 3. Invoke DB2. 4. Enter "connect to tutfam1" (where tutfam1 is the family name in this example). 5. Enter: BACKUP DATABASE tutfam1 USER tutfam1 USING password TO /tmp/backup Now you have a backup copy of your database in the directory /tmp/backup. Tasks that are specific to a particular DBMS 41 NOTE: You can also backup the database to a tape device by changing "/tmp/backup" to the device name of the tape. 5.1.2.2 Restore Use the DB2 RESTORE command. 1. Login to tutfam1 to stop cmvcd and notifyd. 2. Run rmdb to simulate lost of database. 3. Invoke DB2 4. Enter: RESTORE DATABASE tutfam1 USER tutfam1 USING password FROM /home/tutfam1/backup TO $DB2_DBPATH INTO tutfam1 Where DB2_DBPATH is the path on which the DB2 database will be restored. 5.2 INFORMIX 5.2.1 How to change the state from online to quiescent in __________________________________________________________ Informix? _________ You can do one of the following: o Invoke "db-monitor" and select the menu mode. Then select "on-line", then "graceful-shutdown" o Invoke the following commands: tbinit : offline to online tbmode -s : offline to quiescent tbmode -m : quiescent to online tbmode -s : online to quiescent 5.2.2 What does it mean "shared memory not initialized" in ___________________________________________________________ Informix? _________ If you encounter the following message when running "tbstat": shared memory not initialized 42 How to do tasks in OEM platforms ;p. Then this means that Informix is not running. 5.2.3 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 tbspaces utility (Informix 5) or the onspaces 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. onspaces -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. 5.2.4 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: Tasks that are specific to a particular DBMS 43 /users/informix(99) cat .rhosts oem-hp03.raleigh.ibm.com informix oem-hp03 informix oem-hp03.raleigh.ibm.com cmhp3inf oem-hp03 cmhp3inf Where the second item in each row is the Informix user id (in the first 2 rows) and the CMVC family (in the last 2 rows). 5.2.5 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 5.2.6 Backup/Restore an Informix database __________________________________________ 5.2.6.1 Backup of Informix databases 1. Login as the CMVC family administrator ($LOGNAME): 2. Stop the CMVC family: stopCMVC $LOGNAME 3. Create a directory where to store the backup files: $ $HOME/backup $ chmod 777 $HOME/backup 4. Use the DBEXPORT command to export the database for the CMVC family (in a file $HOME/backup/familyName.exp): $INFORMIXDIR/bin/dbexport -o $HOME/backup $LOGNAME 5. Wait for the backup to be completed: dbexport completed 44 How to do tasks in OEM platforms 5.2.6.2 Restore of Informix databases Use the DBIMPORT command to import the tables, indexes and views for the CMVC family. 1. If you are restoring a database into an existing one, then it is necessary to drop/delete the database: $ rmdb If the database exists, then the following error will occur when trying to restore the database from the backup file: *** create database 330 - Cannot create or rename database. 100 - ISAM error: duplicate value for a record with unique key. 2. If INFORMIX_DBSP is not set, run the following: $INFORMIXDIR/bin/dbimport -i $HOME/backup -l -ansi $LOGNAME 3. If INFORMIX_DBSP is set, run the following (in one single line): $INFORMIXDIR/bin/dbimport -i $HOME/backup -l -ansi -d $INFORMIX_DBSP \ $LOGNAME 4. Wait for the restore to be completed: dbimport completed 5. The above commands will create a database with the name of the CMVC family with log (-l) and mode ansi (-ansi). The data is loaded into INFORMIX_DBSP or into rootdbs if INFORMIX_DBSP was not specified. 5.3 ORACLE 5.3.1 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: Tasks that are specific to a particular DBMS 45 # 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; 5.3.2 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; 5.3.3 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 46 How to do tasks in OEM platforms 5.3.4 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. 5.3.5 Backup/restore an Oracle database ________________________________________ 5.3.5.1 Backup of Oracle databases 1. Login as the CMVC family administrator ($LOGNAME): 2. Stop the CMVC family: stopCMVC $LOGNAME 3. Create a directory where to store the backup files: $ $HOME/backup $ chmod 777 $HOME/backup 4. Use the EXP command to export the database to a file prior to backing up the HOME directory for the CMVC family. For example (in one single line) $ORACLE_HOME/bin/exp $ORACLE_DBA buffer=40000 \ file=$HOME/backup/oracle.dmp grants=n indexes=y rows=y constraints=n \ compress=y full=n record=n owner=$LOGNAME 5. Wait for the backup to be completed: Export terminated successfully without warnings 5.3.5.2 Restore of Oracle databases 1. If you are restoring into the same CMVC family id, then drop the existing database: $ rmdb Tasks that are specific to a particular DBMS 47 2. Create an Oracle userid with the same name as your CMVC family. This userid has the password kept in the ORACLE_PASS environment variable. For example: $ORACLE_HOME/bin/sqlplus $ORACLE_DBA GRANT CONNECT, RESOURCE TO familyName IDENTIFIED BY oracle_pass; Where you need to provide the actual values for familyName (from $LOGNAME) and oracle_pass (from $ORACLE_PASS). 3. If you have tables stored in a different tablespace, alter the Oracle userid and make its default tablespace to be the one kept in ORACLE_TBLSP environment variable. For example: ALTER USER familyName DEFAULT TABLESPACE oracle_tblsp; EXIT Where you need to provide the actual values for familyName (from $LOGNAME) and oracle_tblsp (from $ORACLE_TBLSP). 4. Use the IMP command to import the tables, indexes and views for your CMVC family. For example (in one single line): $ORACLE_HOME/bin/imp $ORACLE_DBA buffer=40000 \ file=$HOME/backup/oracle.dmp commit=y show=n ignore=n grants=n \ indexes=y rows=y destroy=n full=n fromuser=$LOGNAME touser=$LOGNAME 5. If you have indexes stored in a different tablespace, do not import the indexes, create them after the tables have been imported. For example (in one single line): sed "s/TABLESPACENAME/$ORACLE_NDXSP/g" $CMVC_HOME/install/index.db | \ $ORACLE_HOME/bin/sqlplus $LOGNAME/$ORACLE_PASS 5.4 SYBASE 5.4.1 How to dump the transaction log in Sybase? _________________________________________________ 1. login into the family account 2. stop the cmvc daemons for the family 3. perform the following (first check the database space then dump) 48 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. 5.4.2 How to move the transaction log to a new device in Sybase? _________________________________________________________________ 1. Run: sp_logdevice dbName, device_name 2. Process enough transactions to fill current log. 3. Wait until all currently active transactions are done. 4. Run: dump transaction 5. To verify, run: sp_helplog 5.4.3 How to see what devices are defined in Sybase? _____________________________________________________ You can use: isql -U sa -P password 1> sp_helpdevice 2> go 5.4.4 How to find which device numbers are in used in Sybase? ______________________________________________________________ You can do the following in isql: > select distinct low/16777216 from sysdevices order by low > go Tasks that are specific to a particular DBMS 49 5.4.5 How to setup a device in Sybase? _______________________________________ Before you can setup a device, you need to know which device numbers are already in use and then you can select a number that is not already in use; see 5.4.4, "How to find which device numbers are in used in Sybase?" for more details. To setup the devices, do the following and change the variables: # isql -U sa -P password > 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 ## Then you can export the following variables in your .profile # export SYBASE_DBDEV="cmibmsyb_dev=9" # export SYBASE_LOGDEV="cmibmsyb_log=2" The details for "disk init" are: o This command allocates space for the device; you can use either a "cooked" (a file system) or a "raw" physical device (such as /dev/syb_dev). In the example above it is a cooked device. o Specify a number for "vdevno" that has not been used before. o The size is specified in 512-byte blocks. 5.4.6 How to add more DASD to SYBASE_DBDEV? ____________________________________________ o isql -Usa -Psybase - The user is system administrator and the password is sybase. o Dump the transaction log (replace "familyName"): dump transaction familyName with no_log go o Display the usage of database space: 50 How to do tasks in OEM platforms use familyName go sp_spaceused go o For example, extend the database "tutfam1" on device "tutfam1" by 2 MB: use master go alter database tutfam1 on tutfam1=2 go o exit 5.4.7 How to drop a device in Sybase? ______________________________________ You can use: sp_dropdevice deviceName You cannot drop a device that is in use by a database. 5.4.8 How to drop a normal database in Sybase? _______________________________________________ You can use: isql -U sa -P password > drop database databaseName > go 5.4.9 How to drop a suspect database in Sybase? ________________________________________________ You can use: dbcc dbrepair (databaseName, dropdb) 5.4.10 How to create a database in Sybase? ___________________________________________ Determine how much space you will need and search the devices to find out if there is space in them for the database. If there is not enough space in master, then you will need to specify a dif- ferent device; for details see 5.4.5, "How to setup a device in Sybase?" on page 50. Tasks that are specific to a particular DBMS 51 Once you have identified the device to use, then use the appro- priate device number in the following command: create database dbName on some_device_name=3 log on another_device_name=2 The above will create a database named dbName on a device previ- ously created called some_device_name which is 3 Mb in size (this command does not take 512-byte blocks). The log parameter will place the database log on a device named another_device_name and will allocate 2 Mb for it. 5.4.11 How to find out how much space is used in the syslog in _______________________________________________________________ Sybase? _______ From the desired database, run: dbcc checktable(syslogs) 5.4.12 Backup/Restore a Sybase database ________________________________________ 5.4.12.1 Backup of Sybase databases This section describes how to create a dump device by using the SP_ADDUMPDEVICE. and how to use the DUMP DATABASE command to dump the database to the device recently created. For more details see the Sybase documentation, section "Dumping and Loading: SQL Server Scheme". 1. Login as the CMVC family administrator ($LOGNAME): 2. Stop the CMVC family: stopCMVC $LOGNAME 3. Create a directory where to store the backup files: $ $HOME/backup $ chmod 777 $HOME/backup 4. If using Sybase 11 you must start the Backup Server: a. login as the Sybase user id b. cd install c. RUN_SYB_BACKUP & 52 How to do tasks in OEM platforms 5. Invoke isql: $ isql -Usa -P$SYBASE_SA_PASS 6. Run the following command to back up the family database. You need to replace FAMILY with the name of your family and specify the actual directory where you want the backup file to be saved. o For Sybase 4.9 or 10 sp_addumpdevice "disk", dobackup, "/export/home/family/backup/family.bak", 2 go dump database family to dobackup go Where the number 2 in sp_addumpdevice is the control type. o For Sybase 11 sp_addumpdevice "disk", dobackup, "/export/home/family/backup/family.bak" go dump database family to dobackup go Wait until you get the following message that indicates that the backup procedure is done: Backup Server: 3.42.1.1: DUMP is complete (database familyName). Now you have a backup copy of your database in the file /export/home/family/backup/family.bak. NOTES: 1. You can also dump the database to a tape device by changing "disk" to "tape", "/home/family/backup/family.bak" to the device name of the tape and the controller number parameter 2 to another number which must be between 3 and 8 (tape volume) in the above command. 2. Use SP_DROPDEVICE DEVICENAME to drop dump devices. Tasks that are specific to a particular DBMS 53 5.4.12.2 Restore of Sybase databases Use the LOAD DATABASE command to restore the database for the CMVC family. For more details see the Sybase documentation, section "Dumping and Loading: SQL Server Scheme". 1. Always make sure that the destination database must be large enough to hold the amount of storage space that was actually allocated to the dumped database. 2. Login as the CMVC family administrator ($LOGNAME): 3. Stop the CMVC family: stopCMVC $LOGNAME 4. If appropriate, simulate the loss of the database and then recreate the basic one: $ rmdb $ mkdb -d 5. If using Sybase 11 you must start the Backup Server: a. login as the Sybase user id b. cd install c. RUN_SYB_BACKUP & 6. Ensure that you have the appropriate dump device defined in Sybase. This dump device should have the backup of the data- base of the CMVC family. 7. Run the following command to restore the Sybase database: $ isql -Usa -P$SYBASE_SA_PASS 1> load database family from dobackup 2> go Where family is the name of the CMVC family. 8. In Sybase 11, wait for the following message that indicates that the restore was completed: Backup Server: 3.42.1.1: LOAD is complete (database familyName). 9. In Sybase 11, you need to have stop and restart the SYBASE servers in order to change the status from offline to online. Then you can restart the CMVC family. 54 How to do tasks in OEM platforms APPENDIX A. BIBLIOGRAPHY For more information on how to use CMVC, you can consult the fol- lowing manuals and publications: SC09-1596-01 IBM CMVC Client Installation and Configuration SC09-1597-01 IBM CMVC User's Reference SC09-1631-02 IBM CMVC Server Administration and Installation SC09-1633-00 IBM CMVC Concepts SC09-1635-01 IBM CMVC Commands Reference The following Redbooks offer practical advice on CMVC: GG24-4178-00 Did you say CMVC? GG24-4345 CMVC: Customer's Perspective The following technical reports describe in detail useful hints on using CMVC: 29.2130 Diagnosing and solving Release -extract problems with CMVC 29.2169 How to use CMVC with National Language Support (NLS) and Double-Byte Character Sets (DBCS) 29.2180 How to do routine tasks in the OEM Platforms for CMVC 29.2183 Using CMVC for Products with Multiple National Language Versions (NLVs) 29.2232 How to do migration tasks with CMVC 29.2244 How to build and package the CMVC client for Windows 3.1 29.2245 How to build and package the CMVC client for OS/2 29.2253 Comparison between CMVC 2.3 and TeamConnection 2 29.2254 Migrating from CMVC 2.3 to TeamConnection 2 29.2268 CMVC frequently asked questions: license management with NetLS/iFOR 29.2269 How to build and package the CMVC server/Client for UNIX A.1 HOW TO GET ELECTRONIC COPIES OF MANUALS AND TECHNICAL REPORTS Many of the manuals and technical reports mentioned in this docu- ment can be downloaded as follows: o From the IBM intranet (only for IBM employees). o From the Internet (open to everyone). A.1.1 IBM Intranet ___________________ Appendix A. Bibliography 55 A.1.1.1 Web Home Page You can access the CMVC Service/Development Home Page at: http://tc-cmvc.raleigh.ibm.com/cmvc From the index at the top of the page, select: o Technical Reports and related tools o Copies of ALL the archived versions for the forums CMVC and CMVC6000 o Documentation in PostScript files o Documentation in ASCII text files A.1.1.2 FTP You can download the code from our internal FTP site, by doing: 1. ftp tc-cmvc.raleigh.ibm.com 2. login as 'anonymous' and for password give your email address. 3. cd e: 4. cd cmvc/doc 5. binary 6. get fileName 7. quit A.1.2 Internet _______________ A.1.2.1 Web Home Page Not available. 56 How to do tasks in OEM platforms A.1.2.2 FTP You can download the code from our external FTP site, by doing: 1. ftp ftp.software.ibm.com 2. login as 'anonymous' and for password give your email address. 3. cd ps/products/cmvc/doc 4. binary 5. get fileName 6. quit Appendix A. Bibliography 57 58 How to do tasks in OEM platforms APPENDIX B. 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, CMVC | | | TeamConnection | | +---------------------+-------------------------------------------+ | UNIX | X/Open Co., Ltd. | +---------------------+-------------------------------------------+ | PostScript | Adobe Systems Incorporated | +---------------------+-------------------------------------------+ | Informix | Informix Inc. | +---------------------+-------------------------------------------+ | Oracle | Oracle Corp. | +---------------------+-------------------------------------------+ | Sybase | Sybase Inc. | +---------------------+-------------------------------------------+ | Sun, SunOS, | Sun Microsystems Inc. | | Solaris | | +---------------------+-------------------------------------------+ | HP, HP-UX | Hewlett-Packard Company | +---------------------+-------------------------------------------+ | Microsoft, Windows | Microsoft Corporation | +---------------------+-------------------------------------------+ | Yahoo | Yahoo! Inc. | +---------------------+-------------------------------------------+ END OF DOCUMENT Appendix B. Copyrights, Trademarks and Service marks 59