# TSTvms.def: Verifies Current User Environment on VMS # $Id: TSTvms.def,v 1.11 2008/02/25 17:32:56 mschenke Exp $ # ARCS: $Header: /home/cvs/repository/RDA_4/src/scripting/lib/modules/TSTvms.def,v 1.11 2008/02/25 17:32:56 mschenke Exp $ # # Change History # 20080225 MSC Change the copyright notice. =head1 NAME TSTvms - Verifies Current User Environment on VMS =head1 DESCRIPTION Determines if the current VMS account has the required settings, and that the current logicals and symbols are a valid Oracle Server environment. If not, you cannot run the RDA procedure. =head1 ERROR SECTION Any failure means that the RDA script cannnot proceed. =cut if !isVms() die 'Not on VMS. Tests aborted' echo 'Verifying current user environment...' echo # Define common macros macro f_getdvi {var ($val) = command(concat('write sys$output f$getdvi("',$arg[0],'","',\ $arg[1],'")')) return $val } macro f_getjpi {var ($val) = command(concat('write sys$output f$getjpi("","',$arg[0],'")')) return $val } macro f_getsyi {var ($val) = command(concat('write sys$output f$getsyi("',$arg[0],'")')) return $val } macro f_privilege {var ($val) = command(concat('write sys$output f$privilege("',$arg[0],'")')) return match($val,'TRUE',true) } macro f_search {var ($val) = command(concat('write sys$output f$search("',$arg[0],'")')) return $val } macro f_trnlnm return getEnv($arg[0]) =pod Checks VMS version. =cut if match(f_getsyi('VERSION'),'^V6') {echo 'ERROR: Remote Diagnostic Agent uses OpenVMS version 7.x features.' echo ' RDA cannot run on VMS version 6.x.' echo } =pod Checks if TCPIP Services for OpenVMS is installed and running. =cut var $flg = true if or(f_search('SYS$SYSTEM:TCPIP$UCP.EXE'),f_search('SYS$SYSTEM:UCX$UCP.EXE')) {if and(f_getdvi('_BG0','EXISTS'),f_getdvi('_BG0','MNT')) var $flg = false } if $flg {echo 'ERROR: TCPIP Services for OpenVMS not installed or not running.' echo ' Some network information will not be collected.' echo } =pod UIC check (Taken from F). =cut if expr('le',f_getjpi('GRP'),f_getsyi('MAXSYSGROUP')) {echo 'ERROR: You are attempting to use Oracle Server with an account that is' echo ' a member of the system group. Oracle requires that all accounts' echo ' which administer Oracle Server have UICs above the highest system' echo ' UIC (see the SYSGEN parameter MAXSYSGROUP).' echo echo ' Accounts with UICs equal to or less than MAXSYSGROUP are not' echo ' allowed to use ORACLE DBA commands or open Oracle datafiles.' echo } =pod Checks basic Oracle Server environment (Taken from F). =cut var $root_lnm = f_trnlnm('ORA_ROOT') var $sqlplus_lnm = f_trnlnm('ORA_SQLPLUS') var $rdbms_lnm = f_trnlnm('ORA_RDBMS') if !and($root_lnm,$sqlplus_lnm,$rdbms_lnm) {echo 'ERROR: Basic Oracle logicals are not present.' echo ' If it is available, please execute ORAUSER.COM' echo ' to establish the Oracle environment.' echo } =pod Additional Oracle Server environment checks. =cut var $ora_rootdir_lnm = f_trnlnm('ORA_ROOTDIR') var $oracle_home_lnm = f_trnlnm('ORACLE_HOME') # New to Oracle8i var $ora_sid_lnm = f_trnlnm('ORA_SID') var $oracle_sid_lnm = f_trnlnm('ORACLE_SID') # New to Oracle8i var $ora_install_lnm = f_trnlnm('ORA_INSTALL') var $ora_exe_lnm = f_trnlnm('ORA_EXE') if !and((or($ora_rootdir_lnm,$oracle_home_lnm)),$ora_install_lnm,$ora_exe_lnm) {echo 'ERROR: Oracle Server home, Install and/or SID logicals are not setup.' echo ' If it is available, please execute ORAUSER.COM' echo ' to establish the Oracle environment.' echo } elsif !or($ora_sid_lnm,$oracle_sid_lnm) {echo 'WARNING: Oracle SID logicals are not present.' echo ' No database information will be collected.' echo var $oracle_sid_lnm = 'NONE' } # Set Oracle SID symbol using SID logicals from above; 1 must be non-blank. if $ora_sid_lnm var $sid = $ora_sid_lnm else var $sid = $oracle_sid_lnm =pod Checks rights/identifiers. =cut var $cur = f_getjpi('RIGHTSLIST') if !match($cur,concat('ORA_(',$sid,'_)?DBA')) {echo 'WARNING: This account does not have the ORA_DBA or ORA__DBA' echo ' identifier. Please make sure you have the password to the' echo ' Oracle Server SYSTEM account, otherwise, the RDA script will' echo ' not be able to gather internal database information.' echo } =head1 WARNINGS SECTION RDA can proceed, but with limited functionality. Checks if C value is set to C. =cut if !match(getEnv('DECC$FILE_SHARING'),'^ENABLE$',true) {echo 'WARNING: RDA will not able to perform some collections unless the' echo ' logical DECC$FILE_SHARING is not set to ENABLE.' echo } =pod Checks privileges for an Oracle Admin account. =cut if !and(f_privilege('CMKRNL'),f_privilege('GROUP'),f_privilege('GRPNAM'),\ f_privilege('IMPERSONATE'),f_privilege('LOG_IO'),\ f_privilege('NETMBX'),f_privilege('OPER'),f_privilege('PFNMAP'),\ f_privilege('PRMGBL'),f_privilege('PRMMBX'),f_privilege('SHARE'),\ f_privilege('SYSGBL'),f_privilege('SYSLCK'),f_privilege('SYSNAM'),\ f_privilege('SYSPRV'),f_privilege('TMPMBX'),f_privilege('WORLD')) {echo 'WARNING: To administer ORACLE, you need following privileges:' echo ' CMKRNL GROUP GRPNAM IMPERSONATE LOG_IO NETMBX' echo ' OPER PFNMAP PRMGBL PRMMBX SHARE SYSGBL SYSLCK' echo ' SYSNAM SYSPRV TMPMBX WORLD' echo } =pod Checks if the database instance is running (that is, CsidE_PMON> process exists). =cut if $sid {if !grepCommand('show system',concat('ORA_',$sid,'_PMON')) {echo 'WARNING: The database instance does not appear to active.' echo ' The RDA will be unable to gather database information' echo ' for Oracle instance ',$sid echo } } =pod Checks for C, as it is required to run F. =cut if !f_privilege('OPER') {echo 'WARNING: This account does not have the OPER privilege, unable to run' echo ' SYSMAN and obtain system parameters.' echo } =pod Checks for C, as it is required to run F command. =cut if !f_privilege('SYSLCK') {echo 'WARNING: This account does not have the SYSLCK privilege, cannot run the' echo ' PRODUCT command to obtain the list of VMS patches.' echo } =pod Checks for C, as it is required to run F command. =cut if !f_privilege('WORLD') {echo 'WARNING: This account does not have the WORLD privilege, cannot run the' echo ' SHOW PROCESS command to get information on other processes.' echo } =pod Checks for read access to UAF file. =cut var $fil = 'SYS$SYSTEM:SYSUAF.DAT' if !f_search($fil) var $fil = f_trnlnm('SYSUAF') if !testFile('r',$fil) {echo 'WARNING: This account does not have access to the User Authorization' echo ' File, unable to run AUTHORIZE and to obtain user and identifier' echo ' information.' echo } =pod Checks for availability of the VMS ZIP program. =cut var $ZIP_available = true if !testCommand('zip -h') {echo 'WARNING: Unable to detect a ZIP symbol to package collected data.' echo } echo 'Verification completed.' echo =begin credits =over 10 =item RDA 4.8: Grant Hayden. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002-2008, Oracle. All rights reserved. =head1 TRADEMARK NOTICE Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. =cut