SDF Core2
SDF Core2
# NOTES:
# 1) Currently only supporting 11i instances for the entire core file.
# In future all APIs will be investigated on their ability to run
# on previous versions (if still required). At that time certain APIs
# will be limited to certain versions of APPS.
# 2) variables to manage test runs:
# - IZU_OD is set to Yes when running from OD
##
## Version History:
##
## ver. date who what
## 1 ssandrew initial release of core file
## 2.01 rstead initial release of version 2
## 2.02 rstead changes made to '$ECHO'
## 21-JUN-2002 svarga / done many changes to let it all work on NT
## dbezemer Merged the changes and version 2.02 op the core
## 2.03 svarga using LINE_FEED, SPACE instead of <BR>,
## svarga modifications in Setup_Env
## svarga modifications because of new naming standards
## the output files will be ${PRD}_${REPORT}
## 26-JUN-2002 dbezemer Changed the Package_Files so the old gz file
## does not get compressed too
## 2.04 28-JUN-2002 dbezemer Added procedure Empty_Line
## 28-JUN-2002 dbezemer Consistency across all procedures with "End"
## 28-JUN-2002 dbezemer Several changes (documented in procedures
## themselves)
## 2.05 03-JUL-2002 dbezemer Several changes to the text output
## 03-JUL-2002 dbezemer Added procedure Setup_Oracle
## 08-JUL-2002 dbezemer Added procedure Convert_EnvFile
## (used on NT only)
## 2.06 11-JUL-2002 dbezemer Several bug fixes (Compare_Values,
## Get_DB_Patch_List, Check_Config_File, Check_Path)
## 2.07 23-JUL-2002 rstead Deprecated (commented out) entries regarding,
## DB_ENV since deriving it is very "shaky." In
## addition have not found where this environment is
## actually used in the diagnostic tests.
## 2.08 24-JUL-2002 hakkinap enhancements (Set_APPS_SQL, Show_BigTable)
## 2.09 25-JUL-2002 dbezemer bug fixes/enhancements (Show_BigTable, Setup_Env,
## Setup_OS, Check_Jinitiator_Version,
Check_Permissions,
## SuccessPrint, Check_File_Version,
## Check_Developer_Version, Show_Link, Compare_Values,
## Execute_URL, Show_Footer, Convert_EnvFile,
## Check_APPS_Version, Check_Config_File,
## Show_Profile_Option)
## 29-JUL-2002 dbezemer Implemented decision to have only major version in
## file.
## 2.10 09-AUG-2002 svarga/ bug fixes/enhancements (Setup_Env,
## dbezemer Check_Jinitiator_Version, Check_Developer_Version,
## Show_Link, Check_Patch, Setup_OS)
## 2.11 19-AUG-2002 dbezemer Resolved NT DUALCASE issue with MKS.
## (Knowledge Base Article #20014)
## 23-AUG-2002 dbezemer Check_Node revised
## 2.12 30-SEP-2002 rstead Changed the formatting on the Show_Footer, in order
to make
## the text print out correctly when running via the
web.
## Changed Check_Jinitiator_Version to handle formatting
## correctly.
## 2.13 01-OCT-2002 rstead Updated version in order to match repository
versioning.
## 2.14 15-OCT-2002 dbezemer Added Show_SQL_Output, Changed Compare_Values
## 2.15 16-OCT-2002 dbezemer Changed Show_Table, Check_Config_File
## 2.17 17-OCT-2002 rstead Updated version in order to match repository
versioning.
## 2.18 13-NOV-2002 dbezemer Fixed Compare_Values
## Changed Setup_Oracle, Setup_OS
## 2.19 05-DEC-2002 ssandrew 1) Added support to run in batch mode from the
command line
## if a ScriptName.conf file exists with the format of
## parm1=value one per line. 2) Also added in support to
run
## under OEMs EMD collection agent, which requires a
calling
## stub program to setup the env, without the need for a
support.cfg.
## 3) Added better error trap to Run_SQL 4) Added
optional
## REMOVE_ZIP=on, to remove the report.Z or .gz after
the run.
## 2.20 20-DEC-2002 svarga Added QuickLinks API, changed SectionHeader because
of
## QuickLinks, commented out a debug $ECHO in
Get_Command_Parms
## 2.21 24-DEC-2002 dbezemer Changed Show_SQL_Output for performance reasons
## Add support for comparing character in
Compare_Version (5.2.2A)
## Fixed problem in Get/Check_File_Version on NT with
latest AD
## 03-JAN-2003 dbezemer Added QLINKS environment variable check into the
QuickLinks API
## 2.22 06-JAN-2003 rstead Updated Show Footer in order to make the text output
more readable
## 2.23 06-JAN-2003 svarga Modified the Show_Link to correct indentation
## 2.24 08-JAN-2003 svarga Modified Setup_Env
## 2.25 10-JAN-2003 svarga/ Changed Check_SQLPLUS_Connection, Run_tnsping,
Check_Config_File
## dbezemer SectionHeader, QuickLinks, Setup_Env,
Check_Developer_Version
## Added MakeTag for consistently making tags in
SectionHeader and
## in the QuickLinks APIs
## 2.26 15-JAN-2003 dbezemer Changed Setup_OS, Execute_URL, Run_SQL, QuickLinks,
Show_Table,
## Setup_Env, Check_Permissions, ...Print,
Check_Jinitiator_Version,
## Get_Package_Versions
## 2.27 17-JAN-2003 svarga Modified Package_Files
## 2.28 22-JAN-2003 sasarumu Modified SQL in Set_Apps_SQL
## 27-JAN-2003 dbezemer Setup_Env, Check_Jinitiator_Version,
Insert_Style_Sheet, QuickLinks
## 2.29 28-JAN-2003 dbezemer Setup_Env, Check_Jinitiator_Version,
Check_Developer_Version
## 2.30 30-JAN-2003 dbezemer Updated text to use 3rd person and remove 'you' and
'your',
## Setup_Env, Check_Jinitiator_Version,
Check_JVM_Version,
## Get_File_Version, Insert_HTML, Validate_APPS_User
## 2.31 11-FEB-2003 svarga Updated Check_Process, Execute_URL,
Validate_APPS_User,
## Check_Jinitiator_Version
## 2.32 03-MAR-2003 svarga Updated Setup_Oracle, Setup_Env, Show_Footer,
Execute_URL,
## /05-MAR-2003 svarga Parse_CGI_Args, Send_Email, Check_Developer_Version,
## Check_Jinitiator_Version, Get_DB_Patch_List,
Check_Table_Count,
## Check_SQLPLUS_Connection, Check_File_Version,
Get_File_Version,
## Compare_Values, Check_JVM_Version,
Check_Apache_Version,
## Show_Link, Run_tnsping, Check_Node,
## replaced HTML_LINE_FEEDs with LINE_FEED, put some
comments,
## replaced tabs with spaces, modified header
## 05-MAR-2003 dbezemer Modified Empty_Line, Check_Path
## 2.33 07-MAR-2003 svarga Changed date formats to DD-MON-YYYY
## 10-MAR-2003 dezemer Indentation on all coding, changed version numbering
to standards.
## 13-MAR-2003 svarga Started to add Descriptions to APIs and checked
header infos
## 14-MAR-2003 dbezemer More descriptions plus changes for Final QA
## 17-MAR-2003 dbezemer Minor changes to Package_Files
## Remove you/your from comments too => third person
## 2.34 18-MAR-2003 svarga Changed Setup_Env and Parse_CGI_Args, updated umask
## 2.35 19-MAR-2003 dbezemer Bug fix in Run_SQL_File
## 2.36 17-OCT-2003 svarga Enhancements: Removed all of the 'Checking', 'Check',
'Getting',
## 'Trying', 'Running', 'Current', 'Currently' words from
the titles,
## added API list into the header
## updated: Setup_OS, Setup_Env, Show_Header,
Check_Developer_Version,
## Show_Link, Check_Patch, Execute_URL, Check_Process,
Check_Config_File,
## Validate_Apps_User, Insert_Style_Sheet,
Check_SQLPLUS_Connection,
## Check_Disk_Space, Check_Permissions,
Get_File_Version, Get_File,
## Run_SQL_File, SectionHeader,
Check_Jinitiator_Version, , Run_SQL,
## Show_SQL_Output, Get_Web_Parms,
## ActionErrorPrint, WarningPrint, Plain_WarningPrint,
ActionWarningPrint
## SuccessPrint, Plain_FooterPrint, Plain_SectionPrint,
Plain_BluePrint,
## SectionPrint, ErrorPrint, Plain_ErrorPrint,
BluePrint, GreenPrint,
## RedPrint, BlackPrint, ActionPrint
## updated because of NUMBERING=OFF: Begin_Pre, End_Pre,
Tab0Print,
## Tab1Print, Tab2Print, Tab3Print
## added: Start_Html (removed from Show_Header),
WrapText, NoticePrint,
## Plain_NoticePrint, Tab0Print, Check_Forms_Process,
Simple_Ping,
## 07-NOV-2003 dbezemer updated: Show_BigTable, Show_Table
## 10-NOV-2003 svarga / updated: Show_Profile_Option, Set_Apps_SQL
## dbezemer
## 16-DEC-2003 svarga updated: Check_Apps_Version, ActionPrint,
SuccessPrint,
## Insert_Style_Sheet, Run_SQL_File, Get_File,
Check_Jinitiator_Version,
## Check_Developer_Version, SectionPrint
## 2.37 19-JAN-2004 svarga Fixed some minor issues after FQA, please check the
QA doc ver. 1.20
## major changes in Check_Forms_Process
## 2.38 22-JAN-2004 svarga / Modified Show_Profile_Option because of an HP Unix
(sh-posix)
## dbezemer problem
## 2.39 30-JAN-2004 svarga / Modified Run_SQL_File and Get_File_Version apis
(because of NT specific
## dbezemer problems)
## 2.40 12-FEB-2004 svarga Modified Set_Apps_SQL, Check_Node, Setup_OS,
Validate_Apps_User,
## Run_SQL_File
## added Show_Profile_Option_Lookup API
## 2.41 01-MAR-2004 svarga Modified Show_File_Versions, Setup_OS, Show_Link,
Compare_SQL_Data,
## Show_Footer, Check_SQLPLUS_Connection, Run_SQL_File,
Tab0Print,
## Tab1Print, Tab2Print, Tab3Print, Check_Node
## 2.42 03-MAR-2004 svarga Modified Setup_OS, Run_SQL_File,
Check_SQLPLUS_Connection,
## 2.43 04-MAR-2004 svarga Modified Check_Process, Setup_Env
## 2.44 05-MAR-2003 mcasalgr Erroneus checkout/in
## 2.45 05-MAR-2004 mcasalgr Sync with SCM
## 2.46 11-MAR-2004 svarga Modified Execute_URL because of BUG:2003657
## 2.47 11-MAR-2004 svarga Modified Show_Table
## 2.48 16-MAR-2004 mcaslgr Cosmetic changes before publication
## 2.49 23-MAR-2004 svarga Modifications because of security check:
## modified Setup_Env, Get_Command_Parms,
Parse_CGI_Args, Run_SQL,
## added Get_Web_Parms_Secure, Setup_Login,
## added deprecation notice for Get_Web_Parms
## 2.50 15-APR-2004 svarga Modified Check_Developer_Version, Process_Options,
Escape,
## Run_SQL, Setup_Env, Show_Header, Set_Apps_SQL,
Show_Profile_Option
## 2.51 28-APR-2004 svarga Modified Get_File
## 2.52 30-JUL-2004 dbezemer Amended footer text
## Fixed bug with incorrect setting of 'Program'
## 2.53 02-AUG-2004 dbezemer Amended footer text (text version)
## 2.54 12-AUG-2004 dbezemer Execute_URL: Handle SSLException
## Run_SQL_File: Amend header and check for file
## Show_Header: Consistent header in CGI and command
line
## Check_Developer_Version: textual changes
## Setup_OS: Fix gzip problem on Linux
## Package_Files: Add and set PACKED_OUTPUT_FILES
variable for zipfile
## Show_Footer: Use PACKED_OUTPUT_FILES variable
## Checked all 'script' words and replaced most by
'diagnostic test'
## Setup_Login: In case we exit here : remove temporary
file
## Get_Command_Parm, Get_Web_Parms_Secure: Add code to
print header
## Setup_Env: Add process id to PRD; add $
{PRD_REPORT_FILE} for easier
## reference to $OUT_DIR/$PRD_$REPORT.xxx
## 2.55 20-AUG-2004 dbezemer NT: rewrite of sourcing the environment (3848208)
## 27-AUG-2004 dbezemer Check_Developer_Version: support new developer
patchset
## Check_Jinitiator_Version: support for 1.1.8.24,
1.3.1.18
## Setup_OS: improve NT path handling (no more resetting
path),
## Convert_Env: modification because of new autoconfig
file
## 2.56 03-SEP-2004 dbezemer Get_File_Version: changes because of adident output
changes (11i10)
## 2.57 22-SEP-2004 svarga Removed tab character, updated version history,
updated
## Package_Files & Show_File_Version & Setup_Env
## 2.58 24-NOV-2004 svarga Shell adapter related modifications: changed
Show_Header
## 2.59 15-FEB-2005 svarga Modified Setup_Env (get rid of support.cfg)
## 2.60 31-MAR-2005 svarga Modified Show_Footer, Package_Files,
Get_Command_Parms,
## Show_Header, SectionHeader, Show_Table,
Show_BigTable,
## Show_SQL_Output, Show_File_Versions, Check_Disk_Space
## 2.61 21-APR-2005 svarga Updated Package_Files, Check_Permissions,
Show_Footer,
## Get_Command_Parms
## 2.62 22-APR-2005 svarga Modified Show_BigTable (SUN specific issue)
## 2.63 02-MAY-2005 mcasalgr Fixed minor misspellings
## 2.64 10-MAY-2005 dbezemer Fixed 'print' issue on SUN when run via OD
## 2.65 17-MAY-2005 svarga Synchronized header version with RON, modified
Show_Header
## ('print' issue)
## 2.66 23-MAY-2005 dbezemer Fix issue in Setup_Env when running on multinode;
## Fix NT program display problem on NT
## 2.67 06-JUN-2005 svarga Modified Get_Command_Parms (enable spaces)
## 2.68 13-SEP-2005 svarga Replaced some weird double-quotes in a comment
## (GSCC BUG: 4558530), changed Show_Footer (ENH:
4580037)
## 115.3 14-NOV-2005 svarga Removed gif file references, created Set_OUT_DIR and
changed
## output directory to ./out, changed Check_Disk_Space
to use OUT_DIR,
## removed output file link from the end of the output,
showing output
## file location also in command mode, changed
Execute_URL to quit if
## jsphttps.jar not found
## 115.4 21-NOV-2005 svarga Changed Package_Files to properly work with tar in
OUT_DIR
## 115.5 06-DEC-2005 dbezemer Removed headers from methods; changed ExecuteURL to
use new izu class
## 115.6 12-DEC-2005 dbezemer Add code to ExecuteURL to allow running from patch
directory
## 115.7 15-DEC-2005 svarga API consolidation (updating APIs with the latest from
individual
## tests): Display_Product_Status, Check_Node,
GetRegistrySetting,
## GetClassHeader, Check_FNDFS, Check_Port, Using_SSL,
## Validate_ClassPath, Show_Metalink, ListIncludes,
FindVirtualDir,
## Check_Directory, Table_Begin, Table_Header,
Table_Row, Table_End,
## INITParameter_Row, Get_Curr_Parameter_Value,
Get_DB_Value,
## Display_Conc_Prgm_Last_Run, Display_Profile_Values,
Get_File,
## Get_APPS_Context_Value, Check_Permissions,
VersionFilter,
## GetPosition, CheckEntryOrder, CheckExistenceEnv,
## Get_Command_Parms, Get_Web_Parms_Secure
## removed some DOLLARHeader-strings to have proper file
versions
## in ACT, added DisplayPatches with PatchList.xml
usage, modified
## Get_RDBMS_Header (ENH: 5011126)
## 115.8 10-FEB-2006 svarga FQA mod: Show_Header, Get_File, AdidentNormalize,
VersionFilter,
## DisplayPatches
## 115.9 23-MAR-2006 dbezemer
## Fixes for RAC environment; remove OA_HTML requirement; try running
APPS<sid>_<node>.env
## instead of APPSORA.env; Add SILENT option to GET_RDBMS_HEADER and remove
SetOption;
## Amend Check_Apps_Version and Check_Patch to check version in DB first;
Added @ to be handled
## by Escape; fixed download link in Show_Link; Add new jinit versions to
Check_Jinitiator_Version;
## Add new patches to Check_Developer_Version; Add load balance to
Check_Node; Added
## Get_AutoConfig_Value, Get_Jserv_Executable, Get_Apache_Configfile and
Get_DBC_Filename; Fix
## setting APACHE_TOP in Setup_Env when running from OD;
## Bugs: 5089628, 4162187, 3924413, 3944094, 4188635, 5089618, 4874247,
## 115.11 06-APR-2006 svarga "Undo checkout", version synch
## 115.12 11-APR-2006 dbezemer Add FND_SECURE to Get_DBC_Filename
## 115.13 29-JUN-2006 svarga Fixing Get_AutoConfig_Value (BUG:5365512)
## 115.14 13-SEP-2006 svarga Changed VersionFilter (BUG:5526218)
## 115.15 13-SEP-2006 svarga More changes in VersionFilter (BUG:5526218)
## 115.16 13-SEP-2006 svarga Modified Get_File_Version (BUG: 5526218)
## 115.17 26-SEP-2006 dbezemer Fix bugs 5448624 and 4714160 (virtual hosts) in
Setup_OS
## 115.18 22-NOV-2006 dbezemer Fix windows bug 5574827
## 115.19 05-DEC-2006 ybedekar Changed references to appsweb.cfg to
appsweb_sid_node.cfg(Bug:4144701 )
## 115.20 28-FEB-2007 dbezemer
## Fix issue where wrong .env file is used (RAC install); Some minor updates
to comments;
## confirm bugfix 4150155 - CHECK_PERMISSIONS NOT WORKING ON NT;
## Remove obsoleted INSTALL_ME, CONFIG_TOP and support.cfg stuff and updated
descriptions;
## Make sure UNIX like paths are returned by Get_AutoConfig_Value;
## Enh 4526327: Extra check and message on APACHE_TOP;
## Now introduced APPS_DBSID and using that instead of TWO_TASK (RAC
instances);
## Update Get_Apache_Configfile; Fix bug 5933459 - 8. show_link issue;
## ER 4904822 - Add new prodedure Get_Java_Version
## 115.21 04-MAY-2007 svarga
## Fixed FQA issues (Setup_Env, Check_Node, Get_Dbc_Filename,
Get_Command_Parms)
## 115.22 08-MAY-2007 svarga Typo fix
## 115.23 11-MAY-2007 dbezemer
## Fixed bug 6046724 in Get_Command_Parms
## 115.24 16-MAY-2007 dbezemer
## Bug 6050470 - Check_Config_File: returns CR on UNIX when file is DOS
format
## Bug 6067078 - Execute_URL: avoid possible expression syntax error
## Bug 6058499 - incorrect interop patch recommended
## Bug 6080034 - Setup_OS: awk errors starting any diagnostic test on Sun
## BUG 6080089 - Setup_OS: echo SPACE/INDENT not working properly on Sun
## BUG 4230045 - SHOW_PROFILE_OPTION_LOOKUP DOES NOT SHOW PROPERLY THE
VALUES
## BUG 6084761 - SDF_CORE2.TXT: APPS_DBSID is not determined correctly
## BUG 6086481 - Get_Autoconfig_Value can return multiple values
## BUG 6110514 - GET_JAVA_VERSION NOT WORKING PROPERLY
## BUG 4544174 - STRANGE BEHAVIOUR WHEN IZU_OD=YES
## 115.25 21-JUN-2007 dbezemer
## BUG 6144407 - DISPLAYPATCHES GIVES BROKEN PIPE ON HEAD COMMAND
## Add more references to Show_Metalink
## 115.26 16-JUL-2007 dbezemer
## Fix check on 1631309 and oajinit.exe in Check_Jinitiator_Version
## 115.27 11-dec-2007 dbezemer
## bug 6715802 - Add support for 1.3.1.19
## bug 6715806 - Use BOXNAME instead of hostname in header cause of virtual
hostnames
###################################################################################
#############
## APIs Implemented
##
## ActionErrorPrint ()
## ActionPrint ()
## ActionWarningPrint ()
## Begin_Pre ()
## BlackPrint ()
## BluePrint ()
## Change_Env ()
## Check_Apache_Version ()
## Check_Apps_Version ()
## Check_Config_File ()
## Check_Developer_Version ()
## Check_Directory ()
## Check_Disk_Space ()
## CheckEntryOrder
## Check_File_Version ()
## Check_FNDFS ()
## Check_Forms_Process ()
## Check_JVM_Version ()
## Check_Jinitiator_Version ()
## Check_Node ()
## Check_Patch ()
## Check_Path ()
## Check_Permissions ()
## Check_Port ()
## Check_Process ()
## Check_SQLPLUS_Connection ()
## Check_Send_Mail ()
## Check_Table_Count ()
## Compare_SQL_Data ()
## Compare_Values ()
## Convert_EnvFile ()
## CsvPrint ()
## DecString ()
## Display_Conc_Prgm_Last_Run ()
## DisplayPatches ()
## Display_Product_Status ()
## Display_Profile_Values
## Doc () {
## DocD ()
## Empty_Line ()
## EncString ()
## End_Pre ()
## ErrorPrint ()
## Escape ()
## Execute_URL ()
## FindVirtualDir ()
## Get_Apache_Configfile ()
## Get_APPS_Context_Value ()
## Get_AutoConfig_Value ()
## Get_Command_Parms ()
## Get_Curr_Parameter_Value ()
## Get_DB_Apps_Version ()
## Get_DB_Patch_List ()
## Get_DB_Value ()
## Get_DBC_Filename ()
## Get_File ()
## Get_File_Version ()
## Get_Java_Version ()
## Get_Jserv_Executable ()
## Get_Langs ()
## Get_Package_Version ()
## Get_Password ()
## GetPosition ()
## Get_Process_Details ()
## Get_RDBMS_Header ()
## Get_Web_Parms ()
## Get_Web_Parms_Secure ()
## GetClassHeader ()
## GetRegistrySetting ()
## GreenPrint ()
## INITParameter_Row ()
## Insert_HTML ()
## Insert_Style_Sheet ()
## ListIncludes ()
## Log ()
## MakeTag ()
## Next_Section ()
## Next_Sub_Section ()
## NoticePrint ()
## Package_Files ()
## Parse_CGI_Args ()
## Plain_BluePrint ()
## Plain_ErrorPrint ()
## Plain_FooterPrint ()
## Plain_NoticePrint ()
## Plain_SectionPrint ()
## Plain_WarningPrint ()
## Process_Options ()
## QuickLinks ()
## RedPrint ()
## Run_PLSQL ()
## Run_SQL ()
## Run_SQL_File ()
## Run_tnsping ()
## SectionHeader ()
## SectionPrint ()
## Send_Email ()
## Set_Apps_SQL ()
## Set_OUT_DIR ()
## Setup_Env ()
## Setup_Login ()
## Setup_OS ()
## Setup_Oracle ()
## Show_BigTable ()
## Show_Footer ()
## Show_Header ()
## Show_Link ()
## Show_Metalink ()
## Show_Profile_Option ()
## Show_Profile_Option_Lookup ()
## Show_SQL_Output ()
## Show_Table ()
## Simple_Ping ()
## Start_Html ()
## SuccessPrint ()
## Tab0Print ()
## Tab1Print ()
## Tab2Print ()
## Tab3Print ()
## Table_Begin ()
## Table_Header ()
## Table_Row ()
## Table_End ()
## Using_SSL ()
## Validate_Apps_User ()
## Validate_ClassPath ()
## WarningPrint ()
## WrapText ()
##
# output files only accessible to user running the diagnostic test
umask 077
#
# START OF sdf_core
#
Set_OUT_DIR ()
{
##
## Procedure Name: Set_OUT_DIR
##
## Usage:
## Set_OUT_DIR
##
## Parameters:
## None
##
## Description:
## Sets OUT_DIR environment variable to store the output files
##
## Notes:
## Same API used by ACT.sh
##
## Version history:
## 115.3 15-NOV-2005 svarga Initial Release
Setup_Env ()
{
##
## Procedure Name: Setup_Env
##
## Usage:
## Setup_Env [APPS_ENV|APPS_DB_ENV|APACHE_TOP]
##
## Parameters:
## $1 - Node to source Env for
## [ defaults to APPL_TOP and 8.0.6 env (APPS_ENV,APPS_DB_ENV) ]
##
## Description:
## The API first sets some global variables and initialize the output
## (Start_Html, Insert_Style_Sheet). After setting the environment it sets
## Oracle specific variables (Setup_Oracle) and parses input parameters.
## It is usually called as the first API in the tests.
##
## Notes:
## none
##
## Version history:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.03 19-JUN-2002 svarga Changed the source environment file for tmp.env from
## $APPL_TOP/${TWO_TASK}.env to $APPS_ENV for NT
## 19-JUN-2002 svarga Added environment variables from $APPS_DB_ENV file
## to the tmp.env for NT
## 19-JUN-2002 svarga Synchronize ORACLE_SID, TWO_TASK, LOCAL variables
## 24-JUN-2002 svarga Added SPACE variable for text output as well and
## changed all to $SPACE
## 25-JUN-2002 svarga echo -e is needed only on LINUX
## 26-JUN-2002 svarga Added rm tmp.env after running it
## 2.04 27-JUN-2002 dbezemer use '=', not '=='
## 2.05 03-JUL-2002 dbezemer Add call to Setup_Oracle
## 08-JUL-2002 dbezemer Add adovars.env to the 'environment' files
## 2.06 11-JUL-2002 dbezemer changed 2.05 to 2.06
## 2.07 23-JUL-2002 rstead Deprecated DB_ENV (see #DEV comments below)
## 2.08 25-JUL-2002 dbezemer switched order of TWO_TASK, LOCAL and ORACLE_SID
## 29-JUL-2002 dbezemer Now determine the version of the core dynamically
## 2.09 09-AUG-2002 dbezemer Set the 'INDENT' variable
## 2.10 05-DEC-2002 ssandrew Added support for OEMs EMD to run the sdf scripts
## Basically checks for readable ${EMD_SCRIPTS_TOP}
## which is setup in the calling shell from EMD.
## 2.11 08-JAN-2003 svarga Modifications to be able run diagnostic without
## previous APPL_TOP and TWO_TASK setting, exit and
show
## correct error messages if CONFIG_TOP is not set or
## support.cfg can not be read, CONFIG_TOP will be
## not determined with the help of Apache process
## anymore ($FND_TOP is the source dir of support.cfg)
## 2.12 10-JAN-2003 svarga Commented out explicit SQL_Login_Password, modified
## CONFIG_TOP error message, resourcing support.cfg if
## APACHE_TOP is set in env files as well
## 2.13 15-JAN-2003 dbezemer Inserted Insert_Style_Sheet at beginning of output
## 2.14 27-JAN-2003 dbezemer Initialized SPACE variable to '\040' on Linux for
text output
## 2.15 28-JAN-2003 dbezemer Set INDENT to be 8 spaces for html output and 5 for
text
## 2.16 03-MAR-2003 svarga Modified BEGIN_DELIM-END_DELIM, modified html-text
if condition,
## modified PRD validation, removed HTML_LINE_FEED
setting, exit if
## more than 20 parameters were used, changed url to
URL,
## changed sdf_corexx.txt to sdf_core
## 10-MAR-2003 dbezemer Now source environment like APPSORA.env does
## 2.17 18-MAR-2003 svarga Decreased the num. of par. to 10 because of hanging
problems on NT
## 2.36 17-OCT-2003 svarga Fixed problem with setting variables from
adovars.env on NT,
## replaced APACHE_TOP/conf to $FND_TOP/secure in
comments, changed
## "echo -e" part
## 2.43 04-MAR-2004 svarga Modified BEGIN_DELIM-END_DELIM setting (not setting
in txt mode when
## it is already set, removed resetting from the end of
the API)
## 2.49 23-MAR-2004 svarga Security modification: LOGIN_ID & LOGIN_PW are not
in support.cfg anymore
## 2.50 15-APR-2004 svarga CEL modification with regard to .CONFIG_TOP
## 2.54 12-AUG-2004 dbezemer No longer overrule LOG_YN; Add PRD_REPORT_FILE
variable for the
## complete path, filename and extension of the
diagnostic output file;
## Add current processID to PRD (and thus to output
file)
## 2.55 13-AUG-2004 dbezemer NT: rewrite of sourcing the environment
## 2.57 22-SEP-2004 svarga Added PRD_SOURCE variable
## 2.59 02-FEB-2005 svarga Shell adapter modification (get rid of support.cfg)
## 2.66 23-MAY-2005 dbezemer Fix issue running on multinode when IAS_ORACLE_HOME
not set
## 115.9 04-APR-2006 dbezemer Fix NT issue, now use set instead of env
## 115.18 22-NOV-2006 dbezemer Fix bug 5574827: problems sourcing environment on
Windows2003
## 115.20 06-MAR-2007 dbezemer Fix issue with sourcing incorrect file based on
TWO_TASK;
## Remove obsoleted CONFIG_TOP and support.cfg stuff;
## Changed the behaviour of TWO_TASK and TWO_TASK_VAR. TWO_TASK is used to
connect to the
## database. The APPS_DBSID is used in all naming of files. For RAC
environment this makes
## a big difference. TWO_TASK is usually set to PROD_806_BALANCE while the
DBSID is set to PROD.
## Note that all files use PROD: PROD_node1.xml; PROD_node1.env;
APPSPROD_node1.env
## 115.21 04-MAY-2007 svarga Small FQA fix
# Global Variables
# PRD - SHORT NAME PRE-FIX that all the collected files will be named
if [ "${PRD}" = "" ]; then
ErrorPrint "The PRD variable is not set in the diagnostic test"
ActionErrorPrint "Modify the diagnostic test (contact diagnostics team)"
exit 1
fi
if [ "${REPORT}" = "" ]; then
REPORT=diag
fi
# catching errors of commands used by the diagnostic test in this file (used
# for redirecting STDERR to this file : 2>$PRD_ERROR_FILE
PRD_ERROR_FILE=${OUT_DIR}/${PRD}_error.txt
# OUT_DIR - directory that the files will be generated to when the diagnostic
test runs
# svarga: IZU mod
Set_OUT_DIR
##
## 1st thing is to call Setup_OS based on OS_NAME that we just derived
##
Setup_OS
# This will only run if the diagnostic test is running from the WEB as a CGI
# - SERVER_NAME gets set automatically by Apache
if [ ! -z "${SERVER_NAME}" ]; then
internal_output=html; export internal_output
PRD_REPORT_FILE=${OUT_DIR}/${PRD}_${REPORT}.htm
rm -f ${PRD_REPORT_FILE}
$ECHO "Content-TYPE: text/html"
$ECHO ""
Start_Html
Insert_Style_Sheet "${OUT_DIR}/${PRD}_${REPORT}.htm"
# GLOBAL DELIMITER VARIABLE:
# BOLD vs. ( Delimiters 0r Open for FUTURE CHANGES)
BEGIN_DELIM=${BEGIN_DELIM:="<B>"}; export BEGIN_DELIM
END_DELIM=${END_DELIM:="</B>"}; export END_DELIM
LINE_FEED="<BR>"; export LINE_FEED
PAGE_BREAK="<P>"; export PAGE_BREAK
SPACE=' '; export SPACE
INDENT="${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}"
else
internal_output=txt; export internal_output
PRD_REPORT_FILE=${OUT_DIR}/${PRD}_${REPORT}.txt
rm -f ${PRD_REPORT_FILE}
BEGIN_DELIM=${BEGIN_DELIM:="("}; export BEGIN_DELIM
END_DELIM=${END_DELIM:=")"}; export END_DELIM
LINE_FEED="\n"; export LINE_FEED
PAGE_BREAK="\f"; export PAGE_BREAK
SPACE="\0040"; export SPACE # escape character for SPACE
if [ "${OS_NAME}" = "Linux" ];then
SPACE="\040"; export SPACE
fi
INDENT="${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}"
fi
export PRD_REPORT_FILE INDENT SPACE
if [ -r $LOG ];then
rm $LOG
fi
# May not even need this with the NEW WAY of checking who owns apache process
if [ -r /usr/ucb/whoami ]; then
# SUN is here usually all other /usr/bin/whoami
USER=`/usr/ucb/whoami`; export USER
elif [ -r /usr/bin/whoami ]; then
USER=`/usr/bin/whoami`; export USER
else
# For NT and MKS to work
USER=`who | awk '{print $1}'`
fi
if [ -z "${ORACLE_HOME}" ]; then
ErrorPrint "The ORACLE_HOME environment variable is not set"
ActionErrorPrint "Please make sure that ORACLE_HOME is set"
ENV_ERROR_MESAGGE=True
else
if [ "${OS_NAME}" = "Windows_NT" ]; then
ORACLE_HOME=`print -r ${ORACLE_HOME} | sed 's/\\\/\//g'`
fi
fi
if [ ! -z "${APPS_ENV}" ]; then
case ${1} in
APPS_ENV)
$ECHO "Setting env to APPS_ENV: ${APPS_ENV}"
. $APPS_ENV ;;
APPS_DB_ENV)
$ECHO "Setting env to APPS_DB_ENV: ${APPS_DB_ENV}"
. $APPS_DB_ENV ;;
APACHE_TOP)
$ECHO "Setting env to IAS ENV: ${APACHE_TOP}/../../${APPS_DBSID}.env"
. $APACHE_TOP/../../${APPS_DBSID}.env ;;
. ${APPS_ENV}
COMMON_TOP=`$ECHO $APPL_TOP/../*comn`
# IAS_TOP=`$ECHO $APACHE_TOP/../../` # actually IAS_ORACLE_HOME
export COMMON_TOP
else
# Setup for NT since it is not possible to source the .env file under
MKS.
# The idea is to run the cmd file for sourcing the environment in a NT
command
# process and then catch the environment variables. This environment
will
# then be used in this MKS shell.
# Now run the cmd file and catch the environment into env file
CORE_PATH="${PATH}"
TMP_NT_ENV_FILE="tmp_nt$$.env"
$ECHO "### temporary env file" > ${TMP_NT_ENV_FILE}
${SystemRoot}/system32/cmd /c start /wait /b ${TMP_NT_CMD_FILE} 2>nul |
sed 's#\\#/#g' | sed 's/\"//g' |
${AWK} '{ line = $0;
i = index(line, "=");
if (substr(line,i+1,1) != "\"") { # only add "
when not there already
line1 = substr(line,1,i);
line2 = substr(line,i+1);
line = sprintf("%s\"%s\"",line1,line2);
}
print line
}' | \
sed 's/&/\\&/g' >> ${TMP_NT_ENV_FILE} # put \
before &; append all to destination file
# Run temporary file to set the new environment (and keeping the old)
. ./${TMP_NT_ENV_FILE}
export ORACLE_HOME
COMMON_TOP=`$ECHO $APPL_TOP/../*comn`
# OA_HTML="$COMMON_TOP/html"; export OA_HTML
fi
# For connecting to the database
if [ "${TWO_TASK}" != "" ]; then
ORACLE_SID=$TWO_TASK
LOCAL=$TWO_TASK
elif [ "${LOCAL}" != "" ]; then
ORACLE_SID=$LOCAL
TWO_TASK=$LOCAL
elif [ "${ORACLE_SID}" != "" ]; then
LOCAL=$ORACLE_SID
TWO_TASK=$ORACLE_SID
fi
export ORACLE_SID TWO_TASK LOCAL
;;
esac
SECURE_IP=n
APACHE_TOP=""
if [ -z "${IAS_ORACLE_HOME}" ]; then
if [ "${OS_NAME}" = "Windows_NT" ]; then
if [ -z "${WV_GATEWAY_CFG}" ]; then
KEY_SERVICES_VAR="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services"
# Get the service name
APACHE_SERVICENAME_VAR=`registry -p -k "$KEY_SERVICES_VAR" -n DisplayName
| grep '${APPS_DBSID}$' | awk -F"\"" '{ print $2 }' | grep Apache`
APACHE_FULLSERVICENAME_VAR=$KEY_SERVICES_VAR"\\"$APACHE_SERVICENAME_VAR
# Get the parameter list used to start Apache listener
APACHE_STARTUP_CMD_VAR=`registry -p -k "$APACHE_FULLSERVICENAME_VAR" -n
Parameters | sed 's#\\\\#/#g' | awk -F"\"" '{print $2}'`
APACHE_TOP=`echo $APACHE_STARTUP_CMD_VAR | awk -F"Apache" '{ print
$1 }'`"Apache/Apache"
Log "APACHE_SERVICENAME_VAR=.${APACHE_SERVICENAME_VAR}.
APACHE_FULLSERVICENAME_VAR=.${APACHE_FULLSERVICENAME_VAR}. APACHE_STARTUP_CMD_VAR=.
${APACHE_STARTUP_CMD_VAR}."
else
APACHE_TOP=`print -r ${WV_GATEWAY_CFG} | sed 's/\\\/\//g' | awk
-F"Apache" '{print $1}'`"Apache/Apache"
fi
else
APAC_BOUNCE_COMMAND="adapcctl.sh"
if [ -f "${OAD_TOP}/admin/scripts/${APPS_DBSID}_${BNAME}/$
{APAC_BOUNCE_COMMAND}" ]; then
APACHE_BOUNCE="${OAD_TOP}/admin/scripts/${APPS_DBSID}_${BNAME}/$
{APAC_BOUNCE_COMMAND}"
elif [ -f "${OAD_TOP}/admin/scripts/${APPS_DBSID}_${BOXNAME}/$
{APAC_BOUNCE_COMMAND}" ]; then
APACHE_BOUNCE="${OAD_TOP}/admin/scripts/${APPS_DBSID}_${BOXNAME}/$
{APAC_BOUNCE_COMMAND}"
elif [ -f "${OAD_TOP}/admin/scripts/${APAC_BOUNCE_COMMAND}" ]; then
APACHE_BOUNCE=${OAD_TOP}/admin/scripts/${APAC_BOUNCE_COMMAND}
elif [ -f "${OAD_TOP}/admin/scripts/${APPS_DBSID}/$
{APAC_BOUNCE_COMMAND}" ]; then
APACHE_BOUNCE=${OAD_TOP}/admin/scripts/${APPS_DBSID}/$
{APAC_BOUNCE_COMMAND}
fi
if [ "${APACHE_BOUNCE}" != "" ]; then
oraenv_file=`grep "^ORAENV_FILE" $APACHE_BOUNCE`
if [ ! -z "${oraenv_file}" ]; then
APACHE_TOP=`dirname \`echo $oraenv_file | awk -F= '{print $2}' | tr -d
'"'\``"/Apache/Apache"
fi
fi
fi
else
if [ "${OS_NAME}" = "Windows_NT" ]; then
APACHE_TOP=`print -r ${IAS_ORACLE_HOME} | sed 's/\\\/\//g'`"/Apache/Apache"
else
APACHE_TOP=${IAS_ORACLE_HOME}"/Apache/Apache"
fi
fi
fi
Log "HERE: APPS_ENV=$APPS_ENV APACHE_TOP=$APACHE_TOP IAS_TOP=$IAS_TOP"
#
# OS commands are set, Oracle env vars are set, now determine
# specific Oracle executable names for different programs.
#
Setup_Oracle
#
# Parse and setup CGI parameters to Real Unix Variables
#
if [ "${internal_output}" = "html" ]; then # need to restrict to html
othervise dd may have problems in command mode
Log "CONTENT_LENGTH: >$CONTENT_LENGTH<"
_F_QUERY_STRING=`dd count=$CONTENT_LENGTH bs=1 2> /dev/null`"&"
Log "_F_QUERY_STRING: >$_F_QUERY_STRING<"
while [ "$_F_QUERY_STRING" != "" -a "$_F_QUERY_STRING" != "&" ] ; do
_F_VARDEF=`$ECHO $_F_QUERY_STRING | cut -d \& -f 1`
_F_VAR=`$ECHO $_F_VARDEF | cut -d = -f 1`
_F_VAL=`$ECHO "$_F_VARDEF""=" | cut -d = -f 2`
if $ECHO $_F_QUERY_STRING | grep -c \& > /dev/null ; then
_F_QUERY_STRING=`$ECHO $_F_QUERY_STRING | cut -d \& -f 2-`
else
_F_QUERY_STRING=""
fi
eval `$ECHO "$_F_VAR=$_F_VAL"`
Log "APPS param: >$_F_VAR< >$_F_VAL<"
done
fi
#
# Parse and setup Command line Args name=val to Real Unix Variables
#
for CurArg in `$ECHO "$Args"`
do
NameVar=`$ECHO "$CurArg" | awk -F"=" '{print $1}'`
ValueVar=`$ECHO "$CurArg" | awk -F"=" '{print $2,$3,$4,$5,$6,$7}'`
eval `$ECHO "$NameVar=$ValueVar"`
# $ECHO "Setting n GetArguments - $NameVar=$ValueVar"
done
# This Runs Every Time - Looking for QUERY_STRING to be Set and Parses
# into Normal Variables if they are passed from the Web URL.
# Parse_CGI_Args
if [ "${QUERY_STRING}" != "" ];then
fi
Setup_Login ()
{
##
## Procedure Name: Setup_Login
##
## Usage:
## Setup_Login
##
## Parameters:
## None.
##
## Description:
## This procedure is meant for validating APPS Username and APPS Password
required input
## parameters. The API is used at the end of the Setup_Env API.
##
## Examples:
## Setup_Login
##
## Returns:
## SQL_Login_Password - to use in SQL*Plus
##
## Notes:
## None.
##
## Version History:
## 2.49 30-MAR-2004 svarga Initial Release
## 2.54 13-AUG-2004 dbezemer Remove temp file; wrap long lines
##
ErrorPrint "APPS Username input parameter was not entered. The APPS
username \
parameter is required for this diagnostic test."
ActionErrorPrint "Please restart the test and enter APPS Username"
exit 1
fi
SQL="select 'APPS_USERNAME='||'OK' from dba_objects where object_name =
'FND_APPLICATION_PKG'\
and object_type = 'PACKAGE' and owner = '${LOGIN_ID}'"
Run_SQL
APPS_USERNAME=`cat ${OUT_DIR}/${OUT_FILE}.txt | grep APPS_USERNAME | tail -1
| \
awk -F"=" '{print $2}' |sed 's/ //g'`
rm ${OUT_DIR}/${OUT_FILE}.txt >/dev/null 2>&1
if [ "${APPS_USERNAME}" != "OK" ]; then
Log "APPS Username is wrong: >${LOGIN_ID}<"
Convert_EnvFile ()
{
##
## Procedure Name: Convert_EnvFile
##
## Usage:
## Convert_EnvFile <source file> <dest file> <excludes>
##
## Parameters:
## $1 - NT environment file
## $2 - File to append the UNIX settings of the NT file
## $3 - Strings to exclude
##
## Description:
## This procedure is meant for NT platform. It converts NT command files
## into UNIX shell script. See comments after this header which steps are taken
to
## accomplish this.
##
## Examples:
## Convert_EnvFile v11i.env unix.env
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.05 08-JUL-2002 dbezemer Initial Release
## 2.06 01-AUG-2002 dbezemer Handle '&'
## Do not add " in front and after value when already
there
## 2.55 20-AUG-2004 dbezemer Make sure set is on the beginning of the line;
otherwise ignore line;
## Obsoleting this API
##
## Obsolescense notice:
## This API will be removed in the next major version.
## No longer needed because of a new method in sourcing the NT environment.
##
grep "^[ ]*set " ${1} | grep -v "REM " | egrep -v 'APPLFULL|FORMS60_APPSLIBS|
APPLSHAR' | \
grep -vi "set PATH" | sed 's/set //g' | sed 's/\\/\//g' | \
awk '{ line=$0;
while ((i = index(line, "%")) != 0)
{ line2 = substr(line, 1, i-1);
line2 = sprintf("%s$", line2);
tmp = substr(line, i+1);
i = index(tmp, "%");
line2 = sprintf("%s%s", line2, substr(tmp, 1, i-1));
line2 = sprintf("%s%s", line2, substr(tmp, i+1));
line = line2;
};
print line
}' | \
awk '{ line = $0;
i = index(line, "=");
if (substr(line,i+1,1) != "\"") { # only add " when
not there already
line1 = substr(line,1,i);
line2 = substr(line,i+1);
line = sprintf("%s\"%s\"",line1,line2);
}
print line
}' | \
sed 's/&/\\&/g' >> ${2} # Append to
destination file
Setup_Oracle ()
{
##
## Procedure Name: Setup_Oracle
##
## Usage:
## Setup_Oracle
##
## Parameters:
## None.
##
## Description:
## Internal Procedure *ONLY* Called to setup Oracle executable names.
## Variables that are specific to the OS and Oracle go in here. They are
## based on the OS_NAME from uname.
##
## Examples:
## Setup_Oracle
##
## Returns:
## tnsnames_file - which tnsnames.ora is used for connections
## listener_file - which listener.ora is used by the listener
## sqlnet_file - which sqlnet.ora is used
## several executable names (See below for detailed explanation):
## SQLPLUS, TNSPING, LSNRCTL, TNSLSNR, FORMS60_SRV_EXE, FORMS60_CHAR_EXE,
## FORMS60_WEBR_EXE, FORMS60_WEBRX_EXE, FORMS60_GUIR_EXE, FORMS60_GUID_EXE,
## FORMS60_LB_SRV_EXE, FORMS60_LB_CLI_E REPORTS60_MTS_EXE, REPORTS60_CHAR_EXE,
## REPORTS60_GUIR_EXE, REPORTS60_GUID_EXE, APACHE_EXE
##
## Notes:
## None.
##
## Version History:
## 2.05 03-JUL-2002 dbezemer Initial Release
## 2.06 26-JUL-2002 dbezemer Added TNSLSNR variable
## 29-JUL-2002 dbezemer Added settings for tnsnames.ora, listener.ora and
## sqlnet.ora file (path and file)
## 2.07 13-NOV-2002 dbezemer Remove some of the checks for the Net files to
reflect
## the search path of the Oracle Tools (SQL*Plus)
## 2.08 03-MAR-2003 svarga Added /etc check for UNIX platforms other than Sun,
## modified executable names part, changed the header
line
##
#
# Set locations of configuration files
#
# Get tnsnames.ora
if [ -f "${TNS_ADMIN}/tnsnames.ora" ]; then
# TNS_ADMIN was set and tnsnames.ora was found
tnsnames_file="$TNS_ADMIN/tnsnames.ora"
elif [ "${OS_NAME}" = "Windows_NT" ]; then
# No TNS_ADMIN set and OS is NT
if [ -f "${ORACLE_HOME}/net80/admin/tnsnames.ora" ]; then
tnsnames_file="${ORACLE_HOME}/net80/admin/tnsnames.ora"
elif [ -f "${ORACLE_HOME}/network/admin/tnsnames.ora" ]; then
tnsnames_file="${ORACLE_HOME}/network/admin/tnsnames.ora"
else
tnsnames_file=""
fi
else # No TNS_ADMIN set and OS is UNIX
if [ -f "${default_network_source}/tnsnames.ora" ]; then
tnsnames_file="${default_network_source}/tnsnames.ora"
elif [ -f "$ORACLE_HOME/network/admin/tnsnames.ora" ]; then
tnsnames_file="$ORACLE_HOME/network/admin/tnsnames.ora"
else
tnsnames_file=""
fi
fi
# Get listener.ora
if [ -f "${TNS_ADMIN}/listener.ora" ]; then
# TNS_ADMIN was set and listener.ora was found
listener_file="$TNS_ADMIN/listener.ora"
elif [ "${OS_NAME}" = "Windows_NT" ]; then
# No TNS_ADMIN set and OS is NT
if [ -f "${ORACLE_HOME}/net80/admin/listener.ora" ]; then
listener_file="${ORACLE_HOME}/net80/admin/listener.ora"
elif [ -f "${ORACLE_HOME}/network/admin/listener.ora" ]; then
listener_file="${ORACLE_HOME}/network/admin/listener.ora"
else
listener_file=""
fi
else # No TNS_ADMIN set and OS is UNIX
if [ -f "${default_network_source}/listener.ora" ]; then
listener_file="${default_network_source}/listener.ora"
elif [ -f "$ORACLE_HOME/network/admin/listener.ora" ]; then
listener_file="$ORACLE_HOME/network/admin/listener.ora"
else
listener_file=""
fi
fi
#
# Set executable names
#
# Forms
FORMS60_LB_SRV_EXE="d2ls60" # Forms Load Balancer Server
FORMS60_LB_CLI_EXE="d2lc60" # Forms Load Balancer Client
# Reports
REPORTS60_MTS_EXE="rwmts60" # Reports Multi tier server
REPORTS60_GUIR_EXE="rwrun60" # Reports GUI Runtime
REPORTS60_GUID_EXE="rwbld60" # Reports GUI Designer
TNSPING="tnsping80"
SQLPLUS="plus80"
if [ -f ${ORACLE_HOME}/bin/lsnrctl80.exe ]; then
LSNRCTL="lsnrctl80"
TNSLSNR="tnslsnr80"
else
LSNRCTL="lsnrctl"
TNSLSNR="tnslsnr"
fi
FORMS60_SRV_EXE="ifsrv60"
FORMS60_CHAR_EXE="" # There is no Forms Character mode runtime
FORMS60_WEBR_EXE="ifweb60"
FORMS60_WEBRX_EXE="ifweb60" # Userexits is same exe; DLL included dynamically
FORMS60_GUIR_EXE="ifrun60"
FORMS60_GUID_EXE="ifbld60"
APACHE_EXE="Apache"
# End_if Windows_NT
else
TNSPING="tnsping"
SQLPLUS="sqlplus"
LSNRCTL="lsnrctl"
TNSLSNR="tnslsnr"
# Forms
FORMS60_SRV_EXE="f60srvm" # Forms Server
FORMS60_CHAR_EXE="f60run" # Forms Character mode Runtime
FORMS60_WEBR_EXE="f60webm" # Forms Web Runtime (Normal, no userexits)
if [ "${OS_NAME}" = "AIX" ]; then
FORMS60_WEBRX_EXE="f60runm" # Display name is ps command
else
FORMS60_WEBRX_EXE="f60webmx" # Forms Web Runtime Userexits (for APPS !!)
fi # AIX
FORMS60_GUIR_EXE="f60runm" # Forms GUI Runtime
FORMS60_GUID_EXE="f60desm" # Forms GUI Designer
# Reports
REPORTS60_CHAR_EXE="rwrun60c" # Reports Character mode Runtime
# Apache
APACHE_EXE="httpd" # Apache process (also httpds)
fi # UNIX
Log "PATH=${PATH}"
# NOTE:
# If MKS is not part of the path, everything will fail including the statement
above.
# Therefore, verifying if MKSNT is in the path seems a bit overdone.
else
# Make sure /usr/sbin and /usr/bin are part of path. If it's not there, add
it.
case "$PATH" in
*/usr/sbin*) PATH=`$ECHO $PATH`;;
*:) PATH=${PATH}/usr/sbin: ;;
"") PATH=/usr/sbin ;;
*) PATH=$PATH:/usr/sbin ;;
esac
fi
export PATH
##
## Main Right-hand frame Report Overview file name
## It actually will be written to: OUT_DIR/DOLLARHeaderReport
## HeaderReport=RDA_right_frame.htm
##
HeaderReport=${PRD}_right_frame.htm
# Start setting up commands that are different for each OS. Make them
# unknown to begin with to allow skipping when attempting to execute.
# Correct command syntax should be set under each OS setup.
SHOWREV=''
ECHO_SHOWREV=N
ECHO_PKGINFO=N
LISTENER_FOUND_IN=3
OS_NAME=`uname`
# Set defaults
DF="df -k "
PS_EF="ps -ef "
STRINGS_CMD="strings -a "
GREP="grep "
AWK="awk"
SED="sed"
unset LANG
CASESENS="ON" # Case sensitive is default (used in some API grep commands)
if [ -x /bin/sar ]; then
if [ -x /bin/svmon ]; then
Log "" # do nothing, we can get to both
else
Log "svmon information cannot be gathered"
Log "check permissions or run this diagnostic test as root"
fi
else
if [ -x /bin/svmon ]; then
Log "sar information cannot be gathered"
Log "check permissions or run this diagnostic test as root"
else
Log "sar and svmon information cannot be gathered"
Log "check permissions or run this diagnostic test as root"
fi
fi
;;
OSF1)
# Compaq Tru64 / Digital UNIX Version format: Vx.y
OS_VERSION=`uname -r | awk -F"." '{ print $1 }' | sed 's/V//'`
OS_SUBVERSION=`uname -r | awk -F"." '{ print $2 }'`
Log "Running ${OS_NAME}, Version $OS_VERSION.$OS_SUBVERSION"
TOP="/usr/bin/top -s1 -d2 -n40"
ZIP="NO"
COMPRESS="compress "
UNCOMPRESS="uncompress "
SYSDEF=`cat /etc/sysconfigtab`
SYSDEF_print="cat /etc/sysconfigtab"
UCB_PS="ps -f -u $USER"
PKGINFO=`setld -i|grep installed|grep -v Patch`
PKGINFO_print="setld -i|grep installed|grep -v Patch"
ECHO_PKGINFO=Y
Memory_Stats="vmstat -s"
CPU_STATS="/usr/sbin/pset_info"
CPU_INFO=`psrinfo -v`
CPU_INFO_print="psrinfo -v"
SHOWREV=`/usr/sbin/setld -i|grep Patch`
ECHO_SHOWREV=Y
SHOWREV_print="/usr/sbin/setld -i|grep Patch"
IOSTAT_M="iostat"
IOSTAT_d="iostat"
IOSTAT_xe="iostat"
IOSTAT_e="iostat"
# sar does not exist on Dec, vmstat is best found so far
SAR_g="vmstat -s"
SAR_u="vmstat -s"
SAR_c="vmstat -s"
SAR_m="vmstat -s"
SWAP_s="swapon -s "
SWAP_l="swapon -s"
NETWORKS="/etc/networks"
USE_NDD=N
NET_TUNING="/sbin/sysconfig -q inet"
if [ "${DO_PING_TEST}" = "y" ];then
Ping_MACHINE_NANE=`/usr/sbin/ping -R -c 10 -s 1280 $MACHINE_NAME`
Ping_WAN_NODE=`/usr/sbin/ping -R -c 10 -s 1280 $WAN_NODE`
Ping_RDBMS_NODE=`/usr/sbin/ping -R -c 10 -s 1280 $RDBMS_NODE`
Ping_WEB_NODE=`/usr/sbin/ping -R -c 10 -s 1280 $WEB_NODE`
Ping_CLIENT_NODE=`/usr/sbin/ping -R -c 10 -s 1280 $CLIENT_NODE`
fi
IFCONFIG_a=`ifconfig -a`
#BEGIN Deprecation
LINK_System="http://www.compaq.com/support/index.shtml"
LINK_Patches="http://ftp1.support.compaq.com/public/Digital_UNIX/"
LINK_Doc="http://tru64unix.compaq.com/faqs/publications/pub_page/pubs_page.html"
#END Deprecation
;;
Linux)
# Linux Version format: x.y.<others>
OS_VERSION=`uname -r | awk -F"." '{ print $1 }'`
OS_SUBVERSION=`uname -r | awk -F"." '{ print $2 }'`
Log "Running ${OS_NAME}, Version $OS_VERSION.$OS_SUBVERSION"
if [ ! -z "$BASH_VERSION" ]; then
# We seem to be running in bash, which is ok on Linux
true # dummy command instead of nop
elif [ ! -z "$KSH_VERSION" ]; then
# We seem to be running in ksh, which would probably
# work, too, but we prefer to run in bash on Linux.
# If bash is not available we try to continue in ksh.
bashpath=`which bash`
if [ $? -eq 0 -a -f "$bashpath" -a -x "$bashpath" ]; then
Log "The test is started under ksh - will run under bash instead."
exec bash $0 $@
else
Log "The test is started under ksh, but bash is not available. Continuing
in ksh."
fi
else
# We seem to be running in an unknown shell. Let's check
# whether bash is available and use it if possible.
bashpath=`which bash`
if [ $? -eq 0 -a -f "$bashpath" -a -x "$bashpath" ]; then
Log "The test is started under an unknown shell - will run under bash
instead."
exec bash $0 $@
else
Log "The test runs under an unknown shell, and bash is not available."
Log "If errors will be encountered then please consider installing bash."
fi
fi
if [ -f /usr/bin/zip ]; then
ZIP="zip -q "
UNZIP="unzip "
else
# gzip behaves like compress, need to tar the files first
ZIP="NO"
COMPRESS="gzip -q "
UNCOMPRESS="gunzip "
fi
TOP="/usr/bin/top -d 1 -n 2 b"
SYSDEF=`ipcs -l`
SYSDEF_print="ipcs -l"
PS_ELF="ps -elf"
CPU_INFO=`cat /proc/cpuinfo`
CPU_INFO_print="cat /proc/cpuinfo"
PKGINFO="rpm -qa"
CPU_STATS="procinfo"
Memory_Stats="cat /proc/meminfo"
# sar doesn't exist so need some way to get this stuff
SAR_g="cat /proc/stat" # paging activity
# SAR_u="sar -u 1 4|grep -v $OS_NAME" # cpu usage
# SAR_c="sar -c 1 4|grep -v $OS_NAME" # system calls
# SAR_m="sar -m 1 4|grep -v $OS_NAME" # message and semaphore
SWAP_s="free -t"
SWAP_l="cat /proc/swaps"
# iostat does not exist on Linux. vmstat is best I can find so far.
IOSTAT_M="vmstat" # disk thruput in MB
IOSTAT_d="vmstat" # disk thruput in bytes
IOSTAT_xe="vmstat" # disk extended statistics
IOSTAT_e="vmstat" # disk errors
NETWORKS="/etc/networks"
USE_NDD=N
NET_TUNING="grep -i tcp /usr/src/linux/include/net/tcp.h"
GET_GNU_LIBC="Y"
SUSERELEASE="/etc/SuSE-release"
if [ -f $SUSERELEASE -a -r $SUSERELEASE ]; then
true
else
unset SUSERELEASE
fi
if [ "${DO_PING_TEST}" = "y" ];then
Ping_MACHINE_NANE=`/bin/ping -R -c 10 -s 1280 $MACHINE_NAME`
Ping_WAN_NODE=`/bin/ping -R -c 10 -s 1280 $WAN_NODE`
Ping_RDBMS_NODE=`/bin/ping -R -c 10 -s 1280 $RDBMS_NODE`
Ping_WEB_NODE=`/bin/ping -R -c 10 -s 1280 $WEB_NODE`
Ping_CLIENT_NODE=`/bin/ping -R -c 10 -s 1280 $CLIENT_NODE`
fi
IFCONFIG_a=`/sbin/ifconfig -a`
#BEGIN Deprecation
LINK_System="http://www.linux.com/enhance/hardware/"
LINK_Patches="http://www.redhat.com/support/errata/"
LINK_Doc="http://www.redhat.com/support/manuals/"
#END Deprecation
;;
DYNIX/ptx)
# Sequent DYNIX Version format: Vx.y
OS_VERSION=`uname -r | awk -F"." '{ print $1 }' | sed 's/V//'`
OS_SUBVERSION=`uname -r | awk -F"." '{ print $2 }'`
Log "Running ${OS_NAME}, Version $OS_VERSION.$OS_SUBVERSION"
TOP="/usr/bin/top -s1 -d2 40"
ZIP="NO"
COMPRESS="compress "
UNCOMPRESS="uncompress "
SYSDEF=`/etc/sysdef|grep -v instance |grep -v drv |tail -77`
SYSDEF_print="/etc/sysdef|grep -v instance |grep -v drv |tail -77"
UCB_PS="ps -f -u `who am i|awk '{print $1}'`"
PKGINFO="pkginfo -i"
SHOWREV="cat /etc/versionlog"
Memory_Stats="sar -cwmpr"
CPU_STATS="sar -qwu 1 3"
CPU_INFO=`/etc/showcfg|grep PROC`
CPU_INFO_print="/etc/showcfg|grep PROC"
IOSTAT_M="sar -d"
IOSTAT_d="sar -d"
IOSTAT_xe="sar -d"
IOSTAT_e="sar -d"
SAR_g="sar -w 1 4|grep -v $OS_NAME"
SAR_u="sar -u 1 4|grep -v $OS_NAME"
SAR_c="sar -c 1 4|grep -v $OS_NAME"
SAR_m="sar -m 1 4|grep -v $OS_NAME"
SWAP_s="sar -w 2 2 "
SWAP_l="sar -w 2 2 "
NETWORKS="/etc/networks"
USE_NDD=N
NET_TUNING="grep -i tcp /usr/conf/uts/symmetry.$MACHINE_NAME/config.h"
if [ "${DO_PING_TEST}" = "y" ];then
Ping_MACHINE_NANE=`/etc/ping -R -s 1280 -c 10 $MACHINE_NAME`
Ping_WAN_NODE=`/etc/ping -R -s 1280 -c 10 $WAN_NODE`
Ping_RDBMS_NODE=`/etc/ping -R -s 1280 -c 10 $RDBMS_NODE`
Ping_WEB_NODE=`/etc/ping -R -s 1280 -c 10 $WEB_NODE`
Ping_CLIENT_NODE=`/etc/ping -R -s 1280 -c 10 $CLIENT_NODE`
fi
IFCONFIG_a=`ifconfig -a`
#BEGIN Deprecation
LINK_System="http://www-1.ibm.com/eserver/support/"
LINK_Patches="http://techsupport.services.ibm.com/eserver/fixes"
LINK_Doc="http://webdocs.numaq.ibm.com"
#END Deprecation
;;
Windows_NT)
# Windows NT/2000 Version format: x yy
OS_VERSION=`uname -r`
OS_SUBVERSION=`uname -v`
Log "Running ${OS_NAME}, Version $OS_VERSION.$OS_SUBVERSION"
TOP=" ps -l "
DF=" df -kP"
ZIP="NO"
COMPRESS="mkszip " # mkszip works like compress
UNCOMPRESS="uncompress "
SYSDEF_print="net config Server"
UCB_PS=" ps -fu `who am i | awk -F"@" '{print $1}'`"
PS_EF=" ps -ef"
STRINGS_CMD="strings -a -z " # Special option for MKS
CASESENS="OFF" # Turn off case-sensitivity
PKGINFO=" net config Server"
SHOWREV=" net statistics Server"
Memory_Stats=" ps -e -o args,vsz,time"
CPU_STATS=" ps -l"
CPU_INFO=" ps -e -o args,pcpu,time,etime"
CPU_INFO_print=" ps -ef"
IOSTAT_M=" ps -l"
IOSTAT_d=" ps -l"
IOSTAT_xe=" ps -l"
IOSTAT_e=" ps -l"
SAR_g=" ps -l"
SAR_u=" ps -l"
SAR_c=" ps -l"
SAR_m=" ps -l"
SWAP_s=" df -k "
SWAP_l=" df -k "
NETWORKS="C:/WINNT/system32/drivers/etc/host"
USE_NDD=N
NET_TUNING=" net start"
if [ "${DO_PING_TEST}" = "y" ];then
Ping_MACHINE_NANE=`ping -l 1280 -n 10 $MACHINE_NAME`
Ping_WAN_NODE=`ping -l 1280 -n 10 $WAN_NODE`
Ping_RDBMS_NODE=`ping -l 1280 -n 10 $RDBMS_NODE`
Ping_WEB_NODE=`ping -l 1280 -n 10 $WEB_NODE`
Ping_CLIENT_NODE=`ping -l 1280 -n 10 $CLIENT_NODE`
fi
IFCONFIG_a=`ipconfig /all`
#BEGIN Deprecation
LINK_System="http://www.microsoft.com"
LINK_Patches="http://www.microsoft.com"
LINK_Doc="http://www.microsoft.com"
#END Deprecation
# Try getting the hostname and domain name from the autoconfig file. This will
make sure
# we are using the hostname that Applications is configured with (virtual
hostname). If we
# cannot find the setting, we try it the old way.
config_file=${CONTEXT_FILE}
BOXNAME=`Get_AutoConfig_Value s_hostname`
BNAME=`echo $BOXNAME | awk -F. '{print $1}'`
DOMAIN_NAME=`Get_AutoConfig_Value s_domainname`
Change_Env ()
{
##
## Procedure Name: Change_Env
##
## Usage:
## Change_Env [APPS_ENV|APPS_DB_ENV|APACHE_TOP]
##
## Parameters:
## $1 - Node to source Env for
## [ defaults to APPL_TOP and 8.0.6 env (APPS_ENV,APPS_DB_ENV) ]
##
## Description:
## The API sources the given environment.
##
## Examples:
## Change_Env APPS_ENV
##
## Returns:
## None.
##
## Notes:
## Commented out the DB_ENV checks, since it is not easily determined
## and have not found any diagnostic tests that require it to be used.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 23-JUL-2002 rstead Deprecated DB_ENV (see #DEV comments below)
## 2.03 12-MAR-2003 svarga Corrected header
##
case ${1} in
APPS_ENV)
Log "Setting env to APPS_ENV: ${APPS_ENV}"
. $APPS_ENV ;;
APPS_DB_ENV)
Log "Setting env to APPS_DB_ENV: ${APPS_DB_ENV}"
. $APPS_DB_ENV ;;
# See header comments
# DB_ENV)
# Log "Setting env to APPS_DB_ENV: ${DB_ENV}"
# . $DB_ENV ;;
APACHE_TOP)
Log "Setting env to IAS ENV: ${APACHE_TOP}/../../${APPS_DBSID}.env"
. $APACHE_TOP/../../${APPS_DBSID}.env ;;
########################################
# Some Internal Only Procedures
# Currently not Documented
########################################
WrapText ()
{
##
## Procedure Name: WrapText
##
## Usage:
## WrapText <word> <text>
##
## Parameters:
## $1 - Usually one word that we want to keep on the left all other
## text will be at the right side of this
## $2 - text to print on the right side.
##
## Example:
## WrapText "ACTION - " "This is the action to be taken"
##
## Returns:
## nothing
##
## Description:
## Wrap given text nicely to 80 characters using 'space' as separator.
##
## Version history:
## 2.01 13-MAR-2003 dbezemer Initial Release
## 2.02 18-MAR-2003 dbezemer Added 'prompt' and able to indent
## 2.03 07-APR-2003 dbezemer Fixed problem with initstring
## 2.04 03-OCT-2003 dbezemer Support multiple spaces in one row
## and LINE_FEEDs in the text
## 2.36 20-OCT-2003 svarga Added to the core file (from ADJinitDiag115.sh),
## removed debug messages
##
NoticePrint ()
{
##
## Procedure Name: NoticePrint
##
## Usage:
## NoticePrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs ATTENTION - txt with class=noticebold sreen and report
##
## Examples:
## NoticePrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 1.01 13-JUN-2003 svarga Initial Release
## 1.02 24-SEP-2003 dbezemer Added italics
## 1.03 02-OCT-2003 dbezemer Wrap text for text mode output
## 2.36 04-NOV-2003 svarga Added to the core file (from ADJinitDiag115.sh),
## using font class and removed JAWS condition
##
Plain_NoticePrint ()
{
##
## Procedure Name: Plain_NoticePrint
##
## Usage:
## Plain_NoticePrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs txt with class=notice screen and report
##
## Examples:
## Plain_NoticePrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 1.01 24-SEP-2003 dbezemer Initial Release
## 1.02 02-OCT-2003 dbezemer Wrap text for text mode output
## Add INDENT for HTML output
## 2.36 05-NOV-2003 svarga Added to the core file (from ADJinitDiag115.sh),
## using font class and removed JAWS condition, added $
{LINE_FEED}
##
Next_Sub_Section
if [ "${internal_output}" = "html" ]; then
$ECHO "<font class=warning>$1</font>" | tee -a $OUT_DIR/${PRD}_${REPORT}.htm
else
# No auto CR/LF at the end of the line (same as HTML)
WrapText " " "${1}" | tee -a $OUT_DIR/${PRD}_${REPORT}.txt
fi
SectionHeader ()
{
##
## Procedure Name: SectionHeader
##
## Usage:
## SectionHeader "txt"
##
## Parameters:
## $1 - Title of the section
##
## Description:
## Outputs "txt" with class=sectionbold to left margin
## both the screen and a report file.
##
## Examples:
## SectionHeader "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 rstead Initial Release
## 2.04 13-JUN-2002 dbezemer Added empty lines for text output
## 2.05 29-JUL-2002 dbezemer Slight header change
## 2.06 24-DEC-2002 dbezemer Print TAG with header for quicklinks
## 2.07 10-JAN-2003 dbezemer Use 'MakeTag' API for creating Tag
## 2.36 12-NOV-2003 svarga Added line of dashes under header (from
ADPatchSetupCheck115.sh)
## 2.60 31-MAR-2005 svarga Shell adapter related changes
##
SectionPrint ()
{
##
## Procedure Name: SectionPrint
##
## Usage:
## SectionPrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs "txt" with numbering format: class=section, screen and report.
##
## Examples:
## SectionPrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.04 28-JUN-2002 dbezemer Added text support for NUMBERING=OFF
## 2.36 20-NOV-2003 svarga Replace core api with local api (from
ADJinitDiag115.sh):
## Autowrap text for text output
## 16-DEC-2003 svarga Added <B class=section> into the NUMBERING=OFF
section,
## removed the final ${LINE_FEED}s from the html
section
##
Tab0Print ()
{
##
## Procedure Name: Tab0Print
##
## Usage:
## Tab0Print "txt" [NO_LIST_TAG]
##
## Parameters:
## $1 - Text to print
## $2 - Empty or NO_LIST_TAG (<LI> HTML tag will be not printed)
##
## Description:
## Outputs "txt" with class=tab0, wit no indentation on left to report and
screen.
##
## Examples:
## Tab0Print "Hello World"
##
## Returns:
## None.
##
## Notes:
## NO_LIST_TAG parameter is useful when showing output of executables (e.g.
lsnrctl)
## when numbering is switched off (use Begin_Pre NO_LIST_TAG before and End_Pre
NO_LIST_TAG
## after the call of this api).
##
## Version History:
## 2.36 07-NOV-2003 svarga Added to the core file (initial release), to be
## in synch with the PLSQL core, added NO_LIST_TAG
## parameter, autowrap text for text output
## 2.41 01-MAR-2004 svarga Modified API header
##
Tab1Print ()
{
##
## Procedure Name: Tab1Print
##
## Usage:
## Tab1Print "txt" [NO_LIST_TAG]
##
## Parameters:
## $1 - Text to print
## $2 - Empty or NO_LIST_TAG (<LI> HTML tag will be not printed)
##
## Description:
## Outputs "txt" with class=tab1 margin on left to report and screen.
##
## Examples:
## Tab1Print "Hello World"
##
## Returns:
## None.
##
## Notes:
## NO_LIST_TAG parameter is useful when showing output of executables (e.g.
lsnrctl)
## when numbering is switched off (use Begin_Pre NO_LIST_TAG before and End_Pre
NO_LIST_TAG
## after the call of this api).
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.04 28-JUN-2002 dbezemer Added text support for NUMBERING=OFF
## 2.05 16-JAN-2003 dbezemer Replaced '\t' with ${INDENT}
## 2.36 12-NOV-2003 svarga Added NO_LIST_TAG parameter, autowrap text for text
output
## (using spaces instead of ${INDENT} because of an
issue with WrapText)
## 2.41 01-MAR-2004 svarga Modified API header
##
Tab2Print ()
{
##
## Procedure Name: Tab2Print
##
## Usage:
## Tab2Print "txt" [NO_LIST_TAG]
##
## Parameters:
## $1 - Text to print
## $2 - Empty or NO_LIST_TAG (<LI> HTML tag will be not printed)
##
## Description:
## Outputs "txt" with class=tab2 margin on left to report and screen.
##
## Examples:
## Tab2Print "Hello World"
##
## Returns:
## None.
##
## Notes:
## NO_LIST_TAG parameter is useful when showing output of executables (e.g.
lsnrctl)
## when numbering is switched off (use Begin_Pre NO_LIST_TAG before and End_Pre
NO_LIST_TAG
## after the call of this api).
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.04 28-JUN-2002 dbezemer Added text support for NUMBERING=OFF
## 2.05 16-JAN-2003 dbezemer Replaced '\t' with ${INDENT}
## 2.36 12-NOV-2003 svarga Added NO_LIST_TAG parameter, autowrap text for text
output
## (using spaces instead of ${INDENT} because of an
issue with WrapText)
## 2.41 01-MAR-2004 svarga Modified API header
##
Tab3Print ()
{
##
## Procedure Name: Tab3Print
##
## Usage:
## Tab3Print "txt" [NO_LIST_TAG]
##
## Parameters:
## $1 - Text to print
## $2 - Empty or NO_LIST_TAG (<LI> HTML tag will be not printed)
##
## Description:
## Outputs "txt" with class=tab3 margin on left to report and screen.
##
## Examples:
## Tab3Print "Hello World"
##
## Returns:
## None.
##
## Notes:
## NO_LIST_TAG parameter is useful when showing output of executables (e.g.
lsnrctl)
## when numbering is switched off (use Begin_Pre NO_LIST_TAG before and End_Pre
NO_LIST_TAG
## after the call of this api).
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.03 26-JUN-2002 dbezemer added two more tabs for text output
## 2.04 28-JUN-2002 dbezemer Added text support for NUMBERING=OFF
## 2.05 16-JAN-2003 dbezemer Replaced '\t' with ${INDENT}
## 2.36 12-NOV-2003 svarga Added NO_LIST_TAG parameter, autowrap text for text
output
## (using spaces instead of ${INDENT} because of an
issue with WrapText)
## 2.41 01-MAR-2004 svarga Modified API header
##
Plain_FooterPrint ()
{
##
## Procedure Name: Plain_FooterPrint
##
## Usage:
## Plain_FooterPrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs txt in the footer class to screen and report - non-bolded
##
## Examples:
## Plain_FooterPrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.36 20-NOV-2003 svarga Autowrap text for text output
##
Plain_SectionPrint ()
{
##
## Procedure Name: Plain_SectionPrint
##
## Usage:
## Plain_SectionPrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs "txt" in section class to screen and report - bolded
##
## Examples:
## Plain_SectionPrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.36 20-NOV-2003 svarga Autowrap text for text output, added ${LINE_FEED}
##
Plain_ErrorPrint ()
{
##
## Procedure Name: Plain_ErrorPrint
##
## Usage:
## Plain_ErrorPrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs "txt" with red print to screen and report (using error class).
##
## Examples:
## Plain_ErrorPrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 02-AUG-2002 dbezemer Initial Release
## 2.36 20-NOV-2003 svarga Autowrap text for text output, added ${LINE_FEED},
## and ${INDENT}
##
RedPrint ()
{
##
## Procedure Name: RedPrint
##
## Usage:
## RedPrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs txt with red print to screen and report
##
## Examples:
## RedPrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.36 20-NOV-2003 svarga Autowrap text for text output
##
## Deprecation Notice:
## This API will be removed in the next major release
Plain_BluePrint ()
{
##
## Procedure Name: Plain_BluePrint
##
## Usage:
## Plain_BluePrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs txt with blue print to screen and report
##
## Examples:
## Plain_BluePrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 rstead Initial Release
## 2.36 20-NOV-2003 svarga Autowrap text for text output
##
## Deprecation Notice:
## This API will be removed in the next major release
ErrorPrint ()
{
##
## Procedure Name: ErrorPrint
##
## Usage:
## ErrorPrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs ERROR - "txt" with class=errorbold to screen and report
##
## Examples:
## ErrorPrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.36 20-NOV-2003 svarga Autowrap text for text output
##
ActionErrorPrint ()
{
##
## Procedure Name: ActionErrorPrint
##
## Usage:
## ActionErrorPrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs ACTION - txt with class=errorbold to screen and report
##
## Examples:
## ActionErrorPrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.36 20-NOV-2003 svarga Autowrap text for text output
##
Plain_WarningPrint ()
{
##
## Procedure Name: Plain_WarningPrint
##
## Usage:
## Plain_WarningPrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs text with class=warning to both the screen and report
##
## Examples:
## Plain_WarningPrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.36 20-NOV-2003 svarga Autowrap text for text output
##
ActionWarningPrint ()
{
##
## Procedure Name: ActionWarningPrint
##
## Usage:
## ActionWarningPrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs ACTION - txt with class=warningbold sreen and report
##
## Examples:
## ActionWarningPrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.36 20-NOV-2003 svarga Autowrap text for text output
##
ActionPrint ()
{
##
## Procedure Name: ActionPrint
##
## Usage:
## ActionPrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs txt as an Action Print to report and screen, def. style
##
## Examples:
## ActionPrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.36 20-NOV-2003 svarga Autowrap text for text output
## 16-DEC-2003 svarga using $ECHO in html mode to be consistent
##
SuccessPrint ()
{
##
## Procedure Name: SuccessPrint
##
## Usage:
## SuccessPrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs a Success output with standards colors, currently black one tab
## with class=tab1 style.
##
## Examples:
## SuccessPrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 25-JUL-2002 dbezemer Add NUMBERING_OFF + text output support
## 2.03 16-JAN-2003 dbezemer Replaced '\t' with ${INDENT}
## 2.36 20-NOV-2003 svarga Autowrap text for text output
## 16-DEC-2003 svarga Replaced ${INDENT} with spaces (WrapText issue)
##
GreenPrint ()
{
##
## Procedure Name: GreenPrint
##
## Usage:
## GreenPrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs green text to screen and report
##
## Examples:
## GreenPrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.36 20-NOV-2003 svarga Autowrap text for text output
##
## Deprecation Notice:
## This API will be removed in the next major release
BlackPrint ()
{
##
## Procedure Name: BlackPrint
##
## Usage:
## BlackPrint "txt"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs txt to report and screen in black
##
## Examples:
## BlackPrint "Hello World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.36 20-NOV-2003 svarga Autowrap text for text output
##
## Deprecation Notice:
## This API will be removed in the next major release
Begin_Pre ()
{
##
## Procedure Name: Begin_Pre
##
## Usage:
## Begin_Pre [NO_LIST_TAG]
##
## Parameters:
## $1 - Empty or NO_LIST_TAG (UL tag will be not printed)
##
## Description:
## Outputs <PRE> to report and screen.
##
## Examples:
## Begin_Pre
## Begin_Pre NO_LIST_TAG
##
## Returns:
## None.
##
## Notes:
## Nothing needs to go to Report.txt for this...html only message. NO_LIST_TAG
parameter is
## useful when showing output of executables (e.g. lsnrctl) when numbering is
switched off.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.04 28-JUN-2002 dbezemer Do nothing for text mode, even when numbering is off
## 2.36 12-NOV-2003 svarga Added NO_LIST_TAG parameter
##
End_Pre ()
{
##
## Procedure Name: End_Pre
##
## Usage:
## End_Pre [NO_LIST_TAG]
##
## Parameters:
## $1 - Empty or NO_LIST_TAG (UL tag will be not printed)
##
## Description:
## Outputs </PRE> to report and screen.
##
## Examples:
## End_Pre
## End_Pre NO_LIST_TAG
##
## Returns:
## None.
##
## Notes:
## Nothing needs to go to Report.txt for this...html only message. NO_LIST_TAG
parameter is
## useful when showing output of executables (e.g. lsnrctl) when numbering is
switched off.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.04 29-JUN-2002 dbezemer Do nothing for text mode, even when numbering is off
## 2.36 12-NOV-2003 svarga Added NO_LIST_TAG parameter
##
Insert_HTML ()
{
##
## Procedure Name: Insert_HTML
##
## Usage:
## Insert_HTML "html string"
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs text with html tags to report and screen. For test output the
## HTML codes will be removed and the remaining string will be printed.
##
## Examples:
## Insert_HTML "<B>Hello World</B>"
##
## Returns:
## None.
##
## Notes:
## *Warning* -- Using this API, there is a higher risk that the test needs
## to be manually updated if changes take place where the OUTPUT
## does not work with the Standards.
## ie. TEXT Only OUTPUT is planned and this API would make it
## hard to support that.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.05 02-JUL-2002 dbezemer Added <HR> to filter out for text output
## 2.05 08-JUL-2002 dbezemer Added '\c' text output, now not automatically going
to newline
## Added <HTML> and </HTML> to be stripped in text
mode.
## 2.06 30-JAN-2003 dbezemer Removing '\c' sed adds it anyway and xpg4 sed gives
error on it
##
CsvPrint ()
{
##
## Procedure Name: CsvPrint
##
## Usage:
## CsvPrint "text, text2, etc."
##
## Parameters:
## $1 - Text to print
##
## Description:
## Outputs to a csv saved file $OUT_CSV
##
## Examples:
## CsvPrint "Hello, World"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
##
## Deprecation Notice:
## This API will be removed in the next major release
Insert_Style_Sheet ()
{
##
## Procedure Name: Insert_Style_Sheet
##
## Usage:
## Insert_Style_Sheet "filename"
##
## Parameters:
## $1 - file name to append Style - sheet into
##
## Description:
## Insert the style sheet in the output file and on screen. Using a style sheet
## makes it easier to adjust standards. All colors for error, warning, tables are
## defined in the style sheet.
##
## Examples:
## Insert_Style_Sheet "mystyles.css"
## Insert_Style_Sheet "myscript.htm"
##
## Returns:
## None.
##
## Notes:
## HTML output only.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 27-JAN-2003 dbezemer Made background color of TH and TD same
## 2.36 04-NOV-2003 svarga Added notice-noticebold-tab0 fonts,
## 16-DEC-2003 svarga adjusted SECTION_BOLD_OVERIDE check and modified
## B.section in JAWS section
## 2.37 19-JAN-2004 svarga Modified style definitions
##
else
$ECHO "
<head>
<style type=\"text/css\">
th.OraTableRowHeader {font-family:Arial,Helvetica,Geneva,sans-serif;font-
size:10pt;font-weight:bold;text-align:right;background-color:#cccc99;color:#336699}
BODY {BACKGROUND-COLOR: white}
table {font-family:Arial, Helvetica, Geneva, sans-serif;
color:#000000;
font-size:10pt
line-height:1.5;
padding:2px;
text-align:left}
# removed bold from section style (SECTION_BOLD_OVERIDE will replace this)
B.section {font:10pt Arial; color: #333333}
B.footer {font:10pt Arial; color: #333333}
B.sectionbold {font:bold 10pt Arial; color: #333333}
DIR.tab0 {font: 10pt Arial; color: #333333}
DIR.tab1 {font: 10pt Arial; text-indent: .25in; color: #333333}
DIR.tab2 {font: 10pt Arial; text-indent: .5in; color: #333333}
DIR.tab3 {font: 10pt Arial; text-indent: 1.0in; color: #333333}
DIR.section {font: 10pt Arial; text-indent: .25in; color: #333333}
LI {font: 10pt Arial; color: #333333}
FONT.error {font:normal 10pt Arial; color: #cc0000}
FONT.errorbold {font:bold 10pt Arial; color: #cc0000}
FONT.warning {font: 10pt Arial; color: #336699}
FONT.warningbold {font:bold 10pt Arial; color: #336699}
FONT.notice {font:italic 10pt Arial; color: #663366}
FONT.noticebold {font:bold italic 10pt Arial; color: #663366}
PRE.raw {font: 10pt Arial; text-indent: .25in; color: #333333}
H1, H2, H3, H4, PRE {font-family:Arial, Helvetica, Geneva, sans-
serif;color:#336699}
H3 {font-size:16pt}
TD.OraTableCellText {font-family:Arial,Helvetica,Geneva,sans-serif;text-
align:right;font-size:10pt;background-color:#f7f7e7;color:#000000;vertical-
align:baseline}
TD {background-color:#f7f7e7;font:normal 10pt/12pt Arial}
TH {background-color:#f7f7e7;font:normal 10pt/12pt Arial}
TR {background-color:#f7f7e7;color:#663300;font:bold 10pt/12pt;font-
family:Arial,Helvetica,Geneva}
TD.parm {background-color:#f7f7e7;text-indent:10;font:normal 10pt/12pt Arial}
TD.shaded {background-color:#f7f7e7;font:normal 10pt/12pt Arial}
TR.heading {background-color:#f7f7e7;font:bold 10pt/12pt Arial;color:#663300}
TR.shaded {background-color:#f7f7e7;font:normal 10pt/12pt Arial}
TD.issue {background-color:#b26804;font:normal 10pt/12pt Arial}
</style>
</head>
" | tee -a "$1"
fi
MakeTag ()
{
##
## Procedure Name: MakeTag
##
## Usage:
## MakeTag <string>
##
## Parameters:
## $1 - text for making a html tag
##
## Description:
## Convert the given string into a HTML tagname.
##
## Examples:
## MakeTag "Profiles Values"
##
## Returns:
## None.
##
## Notes:
## Internal, private API, called automaticaly by Show_Header
## Build the table for 'QuickLinks'; HTML only.
##
## Version History:
## 2.01 10-JAN-2003 dbezemer Initial Release
##
QuickLinks ()
{
##
## Procedure Name: QuickLinks
##
## Usage:
## QuickLinks
##
## Parameters:
## None.
##
## Description:
## Search the source file of the running program for Section headers.
## Make the headers into an HTML tag and display the tags in a table.
## Usually this table will be at the top of the output (file).
##
## Examples:
## QuickLinks
##
## Returns:
## None.
##
## Notes:
## HTML Only
##
## Version History:
## 2.01 20-DEC-2002 svarga Initial Release
## 2.02 24-DEC-2002 dbezemer Do not check local APIs. Here we assume that all
local
## APIs have been defined before the call to
'Setup_Env'.
## 2.03 10-JAN-2003 dbezemer Use 'MakeTag' for creating tags
## 2.04 15-JAN-2003 dbezemer Add Header to the table for 508 standards
## 2.05 27-JAN-2003 dbezemer Removed BGCOLOR in TR tag
##
Doc ()
{
##
## Procedure Name: Doc
##
## Usage:
## Doc
##
## Parameters:
## None.
##
## Description:
## This API is used when calling "program?webdoc=y" via the web.
## It is meant for building the Online Documentation of this core file.
##
## Examples:
## Doc
##
## Returns:
## None.
##
## Notes:
## Private Procedure.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
##
if [ -r "${API_FILE}" ];then
OK=y
else
API_FILE=$Program
fi
if [ -r "${API_FILE}" ];then
Plain_SectionPrint "<H3>API File: $API_Version</H3>"
End_Pre
$ECHO "<TABLE BORDER=6 summary=\"API Listing Table\"><TR>"
# grep "Procedure Name:" ${API_FILE} | grep -v grep | awk -F":" '{print
"<TD>"$2"</TD>"}'
j=0
for i in `grep "## Procedure Name:" ${API_FILE} | grep -v grep | awk -F":"
'{print $2}'`
do
j=`expr $j + 1`
$ECHO "<TD headers=\"Procedure Name - click to get details\"><A href=#$
{i}>$i</TD>"
if [ $j = 4 ];then
j=0
$ECHO "<TR>"
fi
done
$ECHO "</TR></TABLE>"
DocD ()
{
##
## Procedure Name: DocD
##
## Usage:
## DocD
##
## Parameters:
## None.
##
## Description:
## Display the documentation lines from the running diagnostic test
##
## Examples:
## DocD
##
## Returns:
## None.
##
## Notes:
## Private Procedure
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
##
## #############################################
## <H3>Core Library APIs Section - Starting Here</H3>
## #############################################
Next_Section ()
{
##
## Procedure Name: Next_Section
##
## Usage:
## Next_Section
##
## Parameters:
## None.
##
## Description:
## Increases Section Numbering by 1 and resets sub section numbering
## to 0 for next Section.
##
## Examples:
## Next_Section
##
## Returns:
## Section, Sub_Section, and Bullet (Section.Sub_Section)
##
## Notes:
## This Feature is controlled by a Global Variable: NUMBERING
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
##
Next_Sub_Section ()
{
##
## Procedure Name: Next_Sub_Section
##
## Usage:
## Next_Sub_Section
##
## Parameters:
## None.
##
## Description:
## Increases Sub Section Numbering by 1.
##
## Examples:
## Next_Sub_Section
##
## Returns:
## Sub_Section, and Bullet (Section.Sub_Section)
##
## Notes:
## This Feature is controlled by a Global Variable: NUMBERING
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
##
Parse_CGI_Args ()
{
##
## Procedure Name: Parse_CGI_Args
##
## Usage:
## Parse_CGI_Args
##
## Parameters:
## None.
##
## Description:
## Parses through $QUERY_STRING and assigns the values to Parm_Name#/Parm_Value#
## ordered pair.
##
## Examples:
## Parse_CGI_Args
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 04-MAR-2003 svarga Increased the number of parameters to 20 (from 7,
like in Setup_Env)
## 2.03 18-MAR-2003 svarga Decreased the num. of par. to 10 because of hanging
problems on NT
## 2.49 23-MAR-2004 svarga Security modification: LOGIN_ID & LOGIN_PW are not
in support.cfg anymore
##
fi
Get_Password ()
{
##
## Procedure Name: Get_Password
##
## Usage:
## Get_Password OracleApps_DB_UserID
##
## Parameters:
## $1 - Product Short Name
##
## Description:
## Try to get the password for the given user ($1). This can then be used to
## connect to the database with any other (API) calls. The "Prod_pw" is read
## from the support.cfg file if present, else sets the default passwords,
## i.e. apps/apps
##
## Example:
## Get_Password GL
##
## Returns:
## SQL_Login_Password=${1}/${Prod_pw};
##
## Notes:
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.03 07-JUN-2002 svarga support.cfg directory was not correct
## 2.04 14-MAR-2003 dbezemer Needed to change the directory for support.cfg
## Simplied the code for HR
##
# At this point the password file will only work with PER as HR HR, not PER HR
if [ -r $FND_TOP/secure/support.cfg ];then
Log "In Get_Password: Can READ: supp.conf setting up: ${1} "
Prod_pw=`grep -i "^${1}_PW" $FND_TOP/secure/support.cfg | awk -F"=" '{print
$2}'`
else
Prod_pw=${Prod_pw_default:=$1}
SQL_Login_Password=${1}/${Prod_pw}; export SQL_Login_Password
Log "Using Default pw for $Prod: Prod_pw=$1"
fi
Show_Table ()
{
##
## Procedure Name: Show_Table
##
## Usage:
## Show_Table "Col, Value" "Col2, Value2" "Col3, Value3" ... "Col9, Value9"
##
## Parameters:
## $1 First Col,Value Pair
## $2 First Col,Value Pair
## $3 First Col,Value Pair
## ... up to 9
## color=#CCFFCC (optional background color - defaults to #CCFFFF)
## color="lightblue"
## size=1-7 (optional table border size - defaults to 5)
##
## Description:
## Show two-column table of the supplied arguments.
##
## Examples:
## Show_Table "Machine, Sun Solaris" "CPU, 300Mz"
##
## Returns:
## None
##
## Notes:
## -implemented the text show_table with good alignment but this seems to
## have problems on Solaris. Moved back to the simple TABs. May need to sort out
## at a later stage.
## -Currently no table/column headers are displayed
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.03 13-JUN-2002 dbezemer Added text support and removed useless </TR> from
html output
## 2.04 16-OCT-2002 dbezemer Remove table header code; added </TR> at end of rows
## 2.05 15-JAN-2003 dbezemer Add table headers for 508 standards
## 2.36 06-NOV-2003 dbezemer Remove TABs from output
## 2.47 11-MAR-2004 svarga Replaced "wc -m" with "wc -c" on Unix platforms
because
## -m is invalid option on SuSE Linux 7.0 (it works
fine on
## Suse SLES-7)
## 2.60 31-MAR-2005 svarga Using $ECHO everywhere (shell adapter related
change)
##
for Record in "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
do
Title=`$ECHO "$Record" | awk -F"," '{print $1}'`
Data=`$ECHO "$Record" | awk -F"," '{print $2}'`
if [ "$Record" != "" ]; then
printf " %-${ST_COL1_WIDTH}s %-${ST_COL2_WIDTH}s\n" "$Title" "$Data" |
tee -a ${OUT_DIR}/${PRD}_${REPORT}.txt
fi
done
fi
Start_Html ()
{
##
## Procedure Name: Start_Html
##
## Usage:
## Start_Html - Insert starting HTML tags (beginning of the html output)
##
## Parameters:
## None.
##
## Description:
## Print HTML, TITLE & color html tags (it is used at the beginning of the
## output - called from Setup_Env).
##
## Examples:
## Start_Html
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.36 09-OCT-2003 svarga Initial Release, TITLE tag moved back to Show_Header
since the
## $Title is set after calling Setup_Env in the tests
(design issu)
##
Show_Header ()
{
##
## Procedure Name: Show_Header
##
## Usage:
## Show_Header [PARAMSCREEN]
##
## Parameters:
## 1 - PARAMSCREEN for not displaying Quicklinks
##
## Description:
## Print simple header on the screen showing some basic info on the
## diagnostic test and the environment we are running in.
##
## Examples:
## Show_Header
##
## Returns:
## None
##
## Notes:
## None
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.04 26-JUN-2002 dbezemer minor changes to text output
## 2.05 30-JAN-2003 dbezemer Append to output file from the first line
## 2.yy 02-OCT-2003 dbezemer Remove URL from notenumber in text (as a local API
in
## ADJinitDiag115.sh test)
## 2.36 09-OCT-2003 svarga Moved HTML, TITLE, color tags to Start_Html
## 2.50 15-APR-2004 svarga Added test version according to standard change
## 2.54 12-AUG-2004 dbezemer Consistent header in command line and CGI mode
## For use with parameter screen make quicklinks
optional
## Catching empty script_title/title: this can happen
when this
## API is used before defining the actual title in the
test
## 2.58 24-NOV-2004 svarga Shell adapter related changes
## 2.60 31-MAR-2005 svarga Shell adapter changes
## 2.65 17-MAY-2005 svarga Fixed print issue on SUN
## 115.8 10-FEB-2006 svarga Replaced $0 with $Program because of HP issues
## 115.24 06-JUN-2007 dbezemer bug
##
# svarga: for shell adapter
PRINTF_LINEFEED="\n"
if [ "${IZU_OD}" = "Yes" ]; then
PRINTF_LINEFEED=""
ECHO_OLD=${ECHO}
if [ "`${ECHO} -n`" != "-n" ]; then
ECHO="${ECHO} -n"
elif [ "`/usr/ucb/echo -n Hello 2>&1`" = "Hello" ]; then # fix for Solaris
(the error mostly occurs here)
ECHO="/usr/ucb/echo -n"
fi
export ECHO
color="lightyellow"
size=3
# <a href=http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?
p_database_id=NOT&p_id=$1 target=new>$1</a>"
# NOTE_NUMBER=`head -40 $Program | grep "^## " | grep "NOTE:" | awk '{print
$3}' | sed 's/,//g' `
NOTE_NUMBER=`head -40 $Program | grep "^## " | grep "NOTE:" | \
awk '{print "<a
href=http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?
p_database_id=NOT&p_id="$3" target=new>"$3"</A> "}' | \
sed 's/,//g'`
MSG=`head -40 $Program | grep "^## " | grep "NOTE:" | awk -F"," '{print $2}' |
sed 's/,//g'`
NOTE="${NOTE_NUMBER} - $MSG"
# parameter screen does not know the APPS version yet. DB connection cannot be
made yet.
if [ "${1}" = "PARAMSCREEN" ]; then
APPS_VERSION_LINE=""
else
APPS_VERSION_LINE="<B>Apps Version</B>, $APPS_VERSION"
fi
NOTE_NUMBER=`head -40 $Program | grep "^## " | grep "NOTE:" | awk '{print $3}'
| sed 's/,//g'`
MSG=`head -40 $Program | grep "^## " | grep "NOTE:" | awk -F"," '{print $2}' |
sed 's/,//g'`
NOTE="${NOTE_NUMBER} - $MSG"
# if script title not set then use first note description in header for title
if [ "${Script_Title}" != "" ]; then
$ECHO "${LINE_FEED}${Script_Title}" | tee -a $OUT_DIR/${PRD}_${REPORT}.txt
fi
# parameter screen does not know the APPS version yet. DB connection cannot be
made yet.
if [ "${1}" != "PARAMSCREEN" ]; then
$ECHO " Apps Version: $APPS_VERSION" | tee -a $OUT_DIR/${PRD}_${REPORT}.txt
fi
Log ()
{
DAY=`date '+%m%d%y'`
HOUR=`date '+%H:%M'`
DATE=`date '+%m%d%y'`
# $ECHO "pwd=`pwd` LOG_YN=$LOG_YN Inside log $1"
# read ins
if [ "${LOG_YN}" = "Y" ];then
$ECHO "$DATE, $HOUR, $1" >> $LOG
fi
} ### End Procedure Log ###
Package_Files ()
{
##
## Procedure Name: Package_Files
##
## Usage:
## Package_Files [unpack]
##
## Parameters:
## $1 - empty will mean that the files get packaged
## unpack means the compressed file will be unpacked
##
## Description:
## Package all files in current directory starting with the same name as
## the diagnostic test running this API ({PRD}). This API can also reverse that
## process. In that case a zipped file be will unpacked.
##
## Examples:
## Package_Files
## Package_Files unpack
##
## Returns:
## RESULTS - True/False - Created the {PRD}.tar.Z files
## PACKED_OUTPUT_FILES - the resulting zip/compressed file containing all
gathered files
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 19-JUN-2002 dbezemer Added support for NT - mkszip instead of compress
## Added -f flag (force) to both compress and mkszip
## 20-JUN-2002 dbezemer Changed uncompressing of files to handle .gz files
too.
## 2.04 26-JUN-2002 dbezemer Improved check for deleting existing compressed tar
file.
## 2.05 05-DEC-2002 ssandrew Remove the .Z files at the end if: REMOVE_ZIP=on
## 2.06 17-JAN-2003 svarga Fixed "tar: ... same as archive file" error with
## checking for tar file too (not only for compressed
files)
## 2.07 14-MAR-2003 dbezemer Now check if we want to use compress or zip
## 2.54 13-AUG-2004 dbezemer Add PACKED_OUTPUT_FILES variable for 'zip' file
## 2.57 22-SEP-2004 svarga Added test source to the zip file
## 2.60 31-MAR-2005 svarga Added output file location text
## 2.61 21-APR-2005 svarga Using .ZIP extension instead of .zip (Linux) to
allow download packed
## output file also after FND.H as well (removed notice
as well)
##
STARTING_DIR=`pwd`
cp ${PRD_SOURCE} ${OUT_DIR}/${PRD_SOURCE}
cd $OUT_DIR
if [ -r ${PACKED_OUTPUT_FILES} ]; then
# REMOVE THE .zips at the end. - sdf_core api param.
# REMOVE_ZIP=off; export REMOVE_ZIP
if [ "${REMOVE_ZIP}" = "on" ]; then
rm ${PACKED_OUTPUT_FILES}
RESULTS=False
else
OUTPUT_FILE_LOCATION_TEXT="Generated output file is located at: $
{PACKED_OUTPUT_FILES}"
Plain_FooterPrint "${LINE_FEED}${OUTPUT_FILE_LOCATION_TEXT}"
RESULTS=True
fi
else
RESULTS=False
fi
fi
Show_Link ()
{
##
## Procedure Name: Show_Link
##
## Usage:
## Show_Link {Note#|Bug#|URL|Apps_Help_Link} {Metalink|WebIV|Download|AddLink|
Help|DAD} {Hot-Link}
## [Message] [outputmode]
##
## Parameters:
## $1 - NOTE#, BUG, URL
## $2 - Metalink|WebIV|Download|AddLink|[Help or DAD](Current System)|apps_help
## $3 - Hot-Link when providing URL as $1 and AddLink as $2
## $4 - Message to pre-pend the See Note: Link..
## $5 - [SILENT|{VERBOSE}|ERROR|WARNING]
##
## Description:
## For HTML output this API display or creates a link so the use can click
## on it to be redirected to another webpage, testpage or metalink.
## For text output, only the URL is returned. This can be copied into the
## address of a browser and should result in the same page.
##
## Examples:
## Show_Link 120223.1 Metalink
## Show_Link BUG# Metalink
## Show_Link "http://machine:port/" AddLink "Help" "For Workflow Help, "
## Show_Link "Concurrent Processing" apps_help "Help_Link"
## Show_Link "/fndgfm/fnd_help.get/US/FND/@aolpo#aolpo" DAD "Help"
## "<B>Solution</B> - For Profile Settings, "
## Show_Link "Concurrent Processing" apps_help "Help_Link" "" SILENT
## Show_Link 1203333.1 Metalink "" "" SILENT
## Show_Link 153960.1 Metalink "" "For information on X Server" ERROR
##
## Returns: None
##
## Notes:
## - SILENT will only return/echo the html code (with the hyperlink)
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 20-JUN-2002 rstead Added the Silent Option as (optional) parameter $5
## 2.05 03-JUL-2002 dbezemer Added text support
## 2.06 29-JUL-2002 svarga Added Warning, Error print support (blue and red
link)
## 2.07 09-AUG-2002 dbezemer No 'tee' when in SILENT mode
## 2.08 06-JAN-2003 svarga Modified the Show_Link to correct indentation
## 2.09 14-JAN-2003 dbezemer Added SL_URL_END="" for SILENT text mode
## 2.10 05-MAR-2003 svarga Added action to the warning statement
## 2.36 31-OCT-2003 svarga Replace core api with local api (from
FNDGSMDiag115.sh: changed
## text output to show URLs): download uses
updates.oracle.com,
## merged DAD_CHECK if statements
## 2.41 01-MAR-2004 svarga Changed version history
## 115.9 23-MAR-2006 dbezemer Fixed download link from metalink
##
case $2 in
Metalink|METALINK)
SL_URL_BEGIN="<a href="
SL_URL="http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?
p_database_id=NOT&p_id=$1"
SL_URL_END=" target=new>$1</a>"
SL_TEXT_URL="${4} Please see Note: "
;;
WebIV|WEBIV)
SL_URL_BEGIN="<a href="
SL_URL="http://webiv.oraclecorp.com/cgi-bin/webiv/do.pl/Get?WwwID=note:$1"
SL_URL_END=" target=new>$1</a>"
SL_TEXT_URL="${4} Please see Note: "
;;
Download|DOWNLOAD)
SL_URL_BEGIN="<a href="
# SL_URL="http://updates.oracle.com/ARULink/SearchForm/process_form?
search_type=patch&patch_number=${1}"
SL_URL="http://updates.oracle.com/ARULink/PatchDetails/process_form?
patch_num=${1}"
SL_URL_END=">${1}</a>"
SL_TEXT_URL="${4} Please go to Metalink to review and download patch "
;;
AddLink|ADDLINK)
SL_URL_BEGIN="<a href="
SL_URL="$1"
SL_URL_END=" target=new>$3</a>"
SL_TEXT_URL="${4} "
;;
help|Help|HELP|DAD|dad|Dad)
if [ "${APPS_WEB_AGENT}" = "" ]; then
Show_Profile_Option Name "APPS_WEB_AGENT" SILENT
APPS_WEB_AGENT="`$ECHO $Value | grep -i http | tail -1 | sed 's/ //g'`"
else
DAD_SET=y
fi
#
# Check to make sure the DAD profile setting has at least an http in it..
# NOTE: This is not foolproof, may want to add the machine name as
secondary
# check....
#
DAD_CHECK=`$ECHO ${APPS_WEB_AGENT} | grep http`
Check_Process ()
{
##
## Procedure Name: Check_Process
##
## Usage:
## Check_Process Program_Name [VERBOSE|COUNT|{BASIC}|SILENT]
##
## Parameters:
## $1 - Program_Name to check for process with ps
## $2 - VERBOSE | COUNT | {BASIC} | SILENT
## $3 - Process owner
##
## Description:
## Check if a process is running matching the given pattern ($1).
## If the process is not running the PS_OUTPUT is empty.
##
## Examples:
## Check_Process http VERBOSE
## Check_Process FNDLIBR COUNT applmgr
##
## Returns:
## PS_OUTPUT - list of processes
## PS_COUNT - number of processes
## OSPID - process id
## OSPPID - parent process id
## CMD - command line from process table - ie. IF NULL, not running
##
## Notes:
## FOR AIX or LINUX:
## ps -eo "%u %p %P %y %y %x %a" | grep httpd
## or
## ps -eo user,pid,ppid,args | grep httpd
##
## Maybe the default command 'ps -ef' will also work on AIX.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 14-JUN-2002 dbezemer Changed command for AIX since the old one did not
work
## 2.02 18-JUN-2002 dbezemer Added SILENT option
## 2.05 03-JUL-2002 dbezemer Now using the PS_EF command as setup by Setup_OS
## 08-JUL-2002 dbezemer Remove ${PAGEBREAK} from output
## 2.06 29-JUL-2002 dbezemer get correct CMD, using envvar does not seem to work
## 2.07 03-FEB-2003 svarga Corrected awk error because of long PS_OUTPUTs
## 2.08 14-MAR-2003 dbezemer Not displaying error when process not running
## 2.36 03-NOV-2003 svarga Adding process owner parameter, changed output text
## 2.43 04-MAR-2004 svarga Not setting CMD when there are more running
processes,
## modified CMD as well (the old one could result more
rows because it did
## not check the process id column but the whole ps
line)
##
case ${2:=BASIC} in
VERBOSE)
if [ "${internal_output}" = "html" ]; then
def_color=${color:=#CCFFFF}
$ECHO "<table WIDTH=640 BORDER=$border CELLSPACING=0 CELLPADDING=0
summary=\"Table of Processes\">" | tee -a $OUT_DIR/${PRD}_${REPORT}.htm
$ECHO "<TR WIDTH=520><TD ALIGN=LEFT BGCOLOR=$def_color WIDTH=520
headers=\"process
details\"><b><small>$SPACE$SPACE<PRE>$PS_OUTPUT</PRE></small></b></TD>" | tee -a
$OUT_DIR/${PRD}_${REPORT}.htm
$ECHO "</TR></table>" | tee -a $OUT_DIR/${PRD}_${REPORT}.htm
else
$ECHO "Table of Processes" | tee -a $OUT_DIR/${PRD}_${REPORT}.txt
$ECHO " ... process details" | tee -a $OUT_DIR/${PRD}_${REPORT}.txt
$ECHO "$PS_OUTPUT" | tee -a $OUT_DIR/${PRD}_${REPORT}.txt
fi
;;
COUNT) Tab1Print "${LINE_FEED}Process Count: `$ECHO $PS_COUNT`"
;;
*) DoNothing=y
;;
esac
else
Tab1Print "Program $1 ${PROCESS_OWNER}is not running"
fi
End_Pre
fi
Check_Forms_Process ()
{
##
## Procedure Name: Check_Forms_Process
##
## Usage:
## Check_Forms_Process [VERBOSE|COUNT|{BASIC}|SILENT]
##
## Parameters:
## $1 - VERBOSE | COUNT | BASIC (default) | SILENT
##
## Description:
## Check runing Forms Server processes and Forms Web Runtime with
## userexits processes.
##
## Examples:
## Check_Forms_Process VERBOSE
## Check_Forms_Process COUNT
##
## Returns:
## OSPID_SERVER - Forms Server process id
## OSPID_CLIENT - Forms Web Runtime with userexits process id
##
## Notes:
## FOR AIX or LINUX:
## ps -eo "%u %p %P %y %y %x %a" | grep httpd
## or
## ps -eo user,pid,ppid,args | grep httpd
##
## Maybe the default command 'ps -ef' will also work on AIX.
##
## Version History:
## 2.36 12-NOV-2003 svarga Added to the core file (from FNDNCAInstVerify115.sh)
## 2.37 19-JAN-2004 svarga Modified messages, modified printing runtime process
info
##
sid=`Get_AutoConfig_Value s_db_serv_sid`
host=`Get_AutoConfig_Value s_hostname`
appsWebFileName="${OA_HTML}/bin/appsweb_${sid}_${host}.cfg"
if [ ! -f $appsWebFileName ]; then
appsWebFileName="${OA_HTML}/bin/appsweb.cfg"
fi
PS_ERROR=False
case ${OS_NAME} in
Windows_NT)
PS_OUTPUT_SERVER=`$PS_EF | grep $GREP_CASESENS_FLAG $FORMS60_SRV_EXE | grep
"port=$FormsServerPort"`; export PS_OUTPUT_SERVER
if [ "${PS_OUTPUT_SERVER}" = "" ];then
PS_SERVER_CHECK=`$PS_EF | grep $GREP_CASESENS_FLAG $FORMS60_SRV_EXE | wc |
awk '{print $1}'`
if [ "${PS_SERVER_CHECK}" = "1" ];then
PS_OUTPUT_SERVER=`$PS_EF | grep $GREP_CASESENS_FLAG $FORMS60_SRV_EXE`
else
PS_ERROR=True
fi
fi
;;
Linux)
PS_OUTPUT_SERVER=`$PS_EF | grep $GREP_CASESENS_FLAG $FORMS60_SRV_EXE | grep
"port $FormsServerPort"`; export PS_OUTPUT_SERVER
;;
*)
PS_OUTPUT_SERVER=`$PS_EF | grep $GREP_CASESENS_FLAG $FORMS60_SRV_EXE | grep
"port=$FormsServerPort"`; export PS_OUTPUT_SERVER
;;
esac
Get_Process_Details ()
{
##
## Procedure Name: Get_Process_Details
##
## Usage:
## Get_Process_Details PID [VERBOSE|{SILENT}]
##
## Parameters:
## $1 - Process_ID
## $2 - VERBOSE | {SILENT}
##
## Description:
## Get details (parent, memory usage, cpu usage, etc) of a certain process.
##
## Examples:
## Get_Process_Details $PID
##
## Returns:
## PID, PPIDA, CPU, MEMORY, COMMAND as Variables
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
##
# This Temp1 could return two variables from the ps listing... need awk.
Temp1=`ps -e -o pid,ppid,pcpu=C -o vsz,comm,args | awk '$1 ~ /'$1'/ {print $0}'`
# $ECHO "Working on: $1 or $* Temp1=$Temp1"
Show_Footer ()
{
##
## Procedure Name: Show_Footer
##
## Usage:
## Show_Footer
##
## Parameters:
## None.
##
## Description:
## Display default footer with versions of diagnostic test and core file. Also
give
## possibility here to give feedback on the diagnostic test via 'mailto'-link.
Bugs
## in the diagnostic test can be reported via a SR in Metalink "Support
Diagnostics
## Project" (ID=1332).
##
## Examples:
## Show_Footer
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 07-JUN-2002 svarga Changed text feedback
## 2.02 18-JUN-2002 dbezemer Fixed small typo in feedback text
## 2.03 26-JUN-2002 svarga $OUT_DIR/${PRD}.tar.Z to $OUT_DIR/${PRD}.tar.*
## (required for NT)
## 26-JUN-2002 svarga Changed footer for text output (compressed file)
## 2.05 02-JUL-2002 dbezemer Improved text output; made it more readable
## 2.06 01-AUG-2002 dbezemer Improved web output
## 2.07 30-SEP-2002 rstead Improved web output
## 2.08 06-JAN-2003 rstead Improved text output after final QA, in order to
## make more readable
## 2.09 03-MAR-2003 svarga $Core_Version is replaced by $API_Version
## 2.41 01-MAR-2004 svarga Modified Text part to have similar logic as HTML
part (text
## output checks the ZIP environment variable as well
etc.)
## 2.52 30-JUL-2004 dbezemer Changed footer text according to new standards
## 2.53 02-AUG-2004 dbezemer Text version amended also
## 2.54 12-AUG-2004 dbezemer Use new variable PACKED_OUTPUT_FILES
## 2.60 31-MAR-2005 svarga Removed output file location text
## 2.61 21-APR-2005 svarga Not showing the webdoc text in OD
## 2.68 13-SEP-2005 svarga Changed feedback message according to new standards
(ENH: 4580037)
##
$ECHO "If you have any question related to support diagnostics tools
installation," | tee -a $OUT_DIR/${PRD}_${REPORT}.txt
$ECHO "execution, usage or availability you can ask us using the Metalink
forum" | tee -a $OUT_DIR/${PRD}_${REPORT}.txt
$ECHO "for \"Support Diagnostics Project\"." | tee -a $OUT_DIR/${PRD}_$
{REPORT}.txt
Check_Patch ()
{
##
## Procedure Name: Check_Patch
##
## Usage:
## Check_Patch Patch# "Purpose Message" "More Detailed Message/Download"
[{VERBOSE}|SILENT]
##
## Parameters:
## $1 - Patch Number to Check
## $2 - Simple Narative of why/whats the purpose (whether fails to find or not)
## $3 - More Information as to why it should be applied if not present or
## link to download it.
## $4 - {VERBOSE} | BASIC | SILENT
##
## Description:
## Checks if a certain patch has been applied.
##
## Examples:
## Check_Patch 1344802 "Latest Workflow Mailer" "Fixes abc see Note: xyz"
## Check_Patch 1344802 "Latest Workflow Mailer" "Fixes abc see Note: xyz" SILENT
##
## Returns:
## APPLPTCH=True can read the applptch.txt file or false cant
## SOURCE=[applptch.txt|ad_bugs] - source of patches matched
## PATCH_FNDA="" (empty when patch not applied)
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 13-JUN-2002 dbezemer Enhanced feedback when patchinfo is read from
database
## 2.05 03-JUL-2002 dbezemer Added SILENT option
## 2.06 07-AUG-2002 svarga Added red and blue print support (ERROR or WARNING)
## x.yy 26-SEP-2003 dbezemer Revised API; Changed incorrect text
## 02-OCT-2003 dbezemer Changed header; added basic option (no description)
## 2.36 31-OCT-2003 svarga Replace core api with local api (from
FNDGSMDiag115.sh):
## not displaying where the info came from
applptch.txt,
## or AD_BUGS, description only printed in VERBOSE mode
## 115.9 23-MAR-2006 dbezemer First try database, then old method applptch.txt
ERROR_NAME=${ERROR_TITLE:=WARNING}
# Process part
APPLPTCH=False
SQL="select bug_number from ad_bugs where bug_number = '${1}'"
Run_SQL
PATCH_FNDA=`grep ${1} ${OUT_DIR}/${OUT_FILE}.txt`
SOURCE=ad_bugs
if [ "`grep 'ORA-00942' ${OUT_DIR}/${OUT_FILE}.txt`" != "" -a -r $
{APPL_TOP}/admin/${APPS_DBSID}/applptch.txt ];then
APPLPTCH=True
PATCH_FNDA=`grep ${1} ${APPL_TOP}/admin/${APPS_DBSID}/applptch.txt`
SOURCE=applptch.txt
fi
export APPLPTCH SOURCE PATCH_FNDA
# Output part
if [ "$4" != "SILENT" ]; then
Begin_Pre
SectionPrint "Patch ${1}"
if [ "$4" != "BASIC" ]; then
Tab1Print "Description: ${2}"
fi
ERROR_NAME=""
} ### End Procedure Check_Patch ###
Run_SQL ()
{
##
## Procedure Name: Run_SQL
##
## Usage:
## SQL="sql statement"; Run_SQL [ADVCOUNT]
##
## Parameters:
## $1 - Empty or ADVCOUNT (if feedback off then count/deduct # records)
## Additionally, these environment variables need to be set:
## SQL - "sql statement"
## SQL_Login_Password - username/password combination
## SetOption - SQL*Plus settings (optional)
##
## Description:
## Run the statement 'SQL' in SQL*Plus.
##
## Examples:
## SQL="select * from v\$latchholder"
## Run_SQL
## $ECHO "Below is from: V\$LATCHHOLDER Table" > $OUT_DIR/${PRD}_vlatchholder.txt
## cat $OUT_DIR/$OUT_FILE.txt >> $OUT_DIR/${PRD}_vlatchholder.txt
##
## Returns:
## $OUT_DIR/$OUT_FILE.txt with the spooled sql output
## RECORDS_RETURNED_COUNT - number of records returned from SQL
##
## Notes:
## 1) If the x row(s) selected. is not desired in the output
## add: set feedback off; at the top of the SQL=
## ie. Just for this SQL
## SQL="set feedback off
## select username from fnd_user"
## or
## To Globally change the default
## SetOption="set feedback off"
## SQL="select username from fnd_user"
## 2) Current Defaults:
## set arraysize 4
## set pagesize 1000
## set pause off
## set linesize 80
## set feedback on
## set heading on
## The SetOption allows to set ANY "set" commands globally.
## 3) Lines should not be wrapped when doing the ADVCOUNT
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 11-JUN-2002 dbezemer Changed support for NT, made it more global
## 2.03 05-DEC-2002 ssandrew Added an error trap when no spool file gets created.
## 2.04 14-JAN-2003 dbezemer Do the error trap before anything else
## 2.36 12-NOV-2003 svarga Replace core api with local api (from
FNDEBIDiagnostic115.sh):
## added ADVCOUNT parameter (count/deduct # records) +
changed
## text by db connection failure
## 2.49 23-MAR-2004 svarga Modified an error text to not mention support.cfg
(LOGIN_ID, LOGIN_PW
## are now required input parameters)
## 2.50 15-APR-2004 svarga Merge core api with local api (from
FNDFlexfieldDiag115.sh):
## fix problem in ADVCOUNT with too large SQL error
##
if [ ! -r ${OUT_DIR}/${OUT_FILE}.txt ]; then
# ErrorPrint "FAILED DB connection problem, Run_SQL gave no readable spool
file, $TWO_TASK"
# ErrorPrint "Note: Expected file: $OUT_DIR/$OUT_FILE.txt"
ErrorPrint "Database connection to $TWO_TASK failed, there is no readable spool
file"
ActionErrorPrint "Check if:\
${LINE_FEED}${INDENT} - The database with listener is running\
${LINE_FEED}${INDENT} - The APPS username/password input parameters are correctly
specified\
${LINE_FEED}${INDENT} - The user running this test has valid permissions on the
directory containing this test"
exit 1
fi
RECORDS_RETURNED_COUNT=""
RECORDS_RETURNED_COUNT=`grep " selected." ${OUT_DIR}/${OUT_FILE}.txt | awk
'{print $1}'`
if [ "${RECORDS_RETURNED_COUNT}" = "" ]; then
# Check pages[ize]
SETPAGESIZE=`echo $SQL |
$AWK '{
i=index($0,"set pages");
if (i!=0) {
str=substr($0,i+10);
str=substr(str,index(str," ")+1);
printf("%s",substr(str,1,index(str," ")));
} }' | tr [:lower:] [:upper:]`
if [ "$SETPAGESIZE" = "" ]; then
# Set to the default when not set in $SQL
SETPAGESIZE=1000
fi
Run_PLSQL ()
{
##
## Procedure Name: Run_PLSQL
##
## Usage:
## SQL="plsql statement"; Run_PLSQL
##
## Parameters:
## None; but these environment variables need to be set:
## SQL - "plsql statement"
## SQL_Login_Password - username/password combination
## SetOption - SQL*Plus settings (optional)
##
## Description:
## Run the statement 'SQL' in SQL*Plus.
##
## Examples:
## SQL="select * from v\$latchholder"
## Run_PLSQL
## $ECHO "Below is from: V\$LATCHHOLDER Table" > $OUT_DIR/${PRD}_vlatchholder.txt
## cat $OUT_DIR/$OUT_FILE.txt >> $OUT_DIR/${PRD}_vlatchholder.txt
##
## Returns:
## $OUT_DIR/$OUT_FILE.txt with the spooled sql output
## RECORDS_RETURNED_COUNT - number of records returned from SQL
##
## Notes:
## 1) If the x row(s) selected. is not desired in the output
## add: set feedback off; at the top of SQL=
##
## 2) This is the exact same as Run_SQL except that it does not put
## a ";" at the end of the SQL when it runs it. This means the
## SQL= should have END; then / inside it at the end.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 11-JUN-2002 dbezemer Changed support for NT, made it more global
##
if [ ! -r ${OUT_DIR}/${OUT_FILE}.txt ]; then
# ErrorPrint "FAILED DB connection problem, Run_PLSQL gave no readable spool
file, $TWO_TASK"
# ErrorPrint "Note: Expected file: $OUT_DIR/$OUT_FILE.txt"
ErrorPrint "Database connection to $TWO_TASK failed, there is no readable spool
file"
ActionErrorPrint "Check if:${LINE_FEED}${INDENT} - Database with listener is up
and running${LINE_FEED}${INDENT} - user running this diagnostic test can write to:
$OUT_DIR"
exit 1
fi
RECORDS_RETURNED_COUNT=""
RECORDS_RETURNED_COUNT=`grep " selected." $OUT_DIR/$OUT_FILE.txt | awk '{print
$1}'`
if [ "${RECORDS_RETURNED_COUNT}" = "" ];then
RECORDS_RETURNED_COUNT=0;
fi
export RECORDS_RETURNED_COUNT
Check_SQLPLUS_Connection ()
{
##
## Procedure Name: Check_SQLPLUS_Connection
##
## Usage:
## Check_SQLPLUS_Connection <login un/pw> <sql statement> <output mode>
##
## Parameters:
## $1 - login/password@ConnectString
## $2 - SQL statement, else: select count(*) from dual (optional)
## $3 - VERBOSE|{COUNT}|SILENT
##
## Description:
## This API checks if we can successfully connect to the database and execute
## a given ($2) or default SQL statement.
##
## Examples:
## Check_SQLPLUS_Connection apps/apps@PROD "select count(*) from dba_users" COUNT
##
## Returns:
## $OUT_DIR/$OUT_FILE.txt - outpu
## $Number_Lines - from SQL ie. wc -l $OUT_DIR/$OUT_FILE.txt
## $ORA_ERRORS - Any ORA- Errors
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 11-JUN-2002 dbezemer Added support for NT (sqlplus command)
## 2.05 08-JUL-2002 dbezemer Added SILENT option and improved text output (no
HTML)
## 2.06 10-JAN-2003 dbezemer No longer display the password in connect string
## 2.07 05-MAR-2003 svarga Modified error texts (added action, added ERROR to
links)
## 2.36 04-NOV-2003 svarga Modified Begin_Pre-End_Pre locations
## 2.41 01-MAR-2004 svarga Changed SQLPLUS section (to hide un/pwd from the
output
## of ps -ef command on unix)
## 2.42 03-MAR-2004 svarga Replaced '| grep NoThING' with '> /dev/null'
because it caused
## strange errors on Win2000 (not on WinNT or on unix)
##
if [ -r ${OUT_DIR}/${OUT_FILE}.txt ];then
rm ${OUT_DIR}/${OUT_FILE}.txt
fi
if [ "${2}" = "" ]; then
SQL="select count(*) from dual"
else
SQL="`$ECHO ${2}`"
fi
if [ -r ${OUT_DIR}/${OUT_FILE}.txt ];then
SOMETHING_IN_FILE=y
NUMBER_LINES=`wc -l ${OUT_DIR}/${OUT_FILE}.txt | awk '{print $1}'`
ORA_ERRORS=`egrep -i 'ORA-|PLS-|ERROR|unknown|ignore' ${OUT_DIR}/$
{OUT_FILE}.txt`
else
SOMETHING_IN_FILE=n
NUMBER_LINES=0
ORA_ERRORS=""
Log "CANNOT READ ${OUT_DIR}/${OUT_FILE}.txt"
fi
Run_SQL_File ()
{
##
## Procedure Name: Run_SQL_File
##
## Usage:
## Run_SQL_File "full path to sql file" "[Parameter(s)1 2 3...]"
## SHOW|SAVE|SILENT|{NEITHER}|SCRIPTSPOOL [Save File] [accept1] ...
[accept5]
##
## Parameters:
## $1 - SQLFILE (with full path)
## $2 - Any parmeters (if, two or more, or blank, put in double quotes
## $3 - SHOW: show output using cat
## SAVE: copy the resulting file to another file
## SILENT:
## nothing: do nothing with the output
## SCRIPTSPOOL: copy ${4} output file to ${PRD}_${4}
## $4 - if 3 = SAVE, then Provide File name to save as and dont SHOW.
## if 3=SCRIPTSPOOL; provide filename that the SQL script is spooling to
## $5-9 if SQL script asks for values (accept) you can specify them here
##
## Description:
## Run the specified SQL file using SQL*Plus
##
## Examples:
## Run_SQL_File /tmp/xyz.sql "Jones%" SHOW
##
## Returns:
## $OUT_DIR/$OUT_FILE.txt - the spooled output file from SQL execution.
## RECORDS_RETURNED_COUNT - number of records returned from SQL
##
## Notes:
## The SQL file can have 'insert/update/delete/truncate/drop/create' statements
## inside. We check for these and display a message if there is.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 11-JUN-2002 dbezemer Added support for NT (plus80)
## 2.03 14-MAR-2003 dbezemer Added check for 'forbidden' commands in SQL file
## 2.04 19-MAR-2003 dbezemer Bug fix (*.sql instead of $1)
## 2.36 10-NOV-2003 svarga Added SILENT option and Begin_Pre and End_Pre (in
## particular with the numbering set to off), splitted
## code into process and output part, modified section
## title
## 16-DEC-2003 svarga Removed ${LINE_FEED} from 'Saved to ..' message
## 2.39 27-JAN-2004 dbezemer Added arguments to pass through to accept in SQL
file
## Up to 5 input value can be supplied.
## Added SCRIPTSPOOL. If script spools output to
another
## file, this option copies the (known) filename (${4})
## to ${PRD}_${4} filename
## 30-JAN-2004 svarga Replaced the sqplus line with the original format
(grep NoThING),
## more modifications because of NT (replacing accept
statements
## with variabel definition)
## 2.40 12-FEB-2004 svarga Modified API to delete only the temporary created
sql file
## 2.41 01-MAR-2004 svarga Changed SQLPLUS section (to hide un/pwd from the
output
## of ps -ef command on unix), fixed some typos, added
log messages
## 2.42 03-MAR-2004 svarga Replaced '| grep NoThING' with '> /dev/null'
because it caused
## strange errors on Win2000 (not on WinNT or on unix)
## 2.54 12-AUG-2004 dbezemer Amend header; added check to see if file exists
##
# Process part
# Check if file really exists
if [ "${1}" != "" -a -r ${1} ]; then
# Check for insert, update, delete, drop, truncate and create
Log "Entered Run_SQL_File"
GREPRES=""
for chk in insert update delete drop truncate create alter
do
GREPRES=`grep -i "^[ ]*$chk " $1`
if [ "$GREPRES" != "" ]; then
break;
fi
done
# begin of accept replacing part (to be able to pass parameters where the SQL
uses accept)
sql_file=${1}
if [ "${5}" != "" ]; then
Log "The SQL script contains ACCEPT statement"
if [ -r ${OUT_DIR}/${OUT_FILE}.sql ];then
rm ${OUT_DIR}/${OUT_FILE}.sql
fi
if [ -r ${OUT_DIR}/${OUT_FILE}.txt ];then
rm ${OUT_DIR}/${OUT_FILE}.txt
fi
$AWK '
BEGIN {
accept[1] = "'${5}'";
accept[2] = "'${6}'";
accept[3] = "'${7}'";
accept[4] = "'${8}'";
accept[5] = "'${9}'";
accept_number = 1;
}
{
line = $0;
first_word = $1;
parameter_name = $2;
if ( first_word == "accept" || first_word == "Accept" || first_word ==
"ACCEPT" )
{
printf("%s%s%s%s\n","Define ",parameter_name," =
",accept[accept_number]);
if ( ++accept_number == 6 )
{
exit 9;
}
}
else
{
printf("%s\n",line);
}
}' ${sql_file} >> ${OUT_DIR}/${OUT_FILE}.sql
ACCEPT_ERROR=$?
Log "ACCEPT_ERROR=$ACCEPT_ERROR when modifying the SQL file"
if [ $ACCEPT_ERROR = 9 ]; then
ErrorPrint "The SQL file '${1}' contains more than 5 accept statement but
the api can handle maximum 5"
ActionErrorPrint "Please report the error to the diagnostic team: support-
diagnostics_ww@oracle.com"
exit 1
fi
sql_file="${OUT_DIR}/${OUT_FILE}.sql"
# To avoid any kind of deleting the input parameter sql file
sql_file_bak="${OUT_DIR}/${OUT_FILE}.sql"
fi
Log "sql_fileR=$sql_file"
fi
# Output part
if [ "${3}" != "SILENT" ];then
Log "Printing output"
Begin_Pre
if [ "${2}" != "" ];then
SectionPrint "Result of SQL File '${1}' With Parameters: ${2}"
else
SectionPrint "Result of SQL File '${1}'"
fi
RECORDS_RETURNED_COUNT=""
RECORDS_RETURNED_COUNT=`grep " selected." ${OUT_DIR}/${OUT_FILE}.txt | awk
'{print $1}'`
if [ "${RECORDS_RETURNED_COUNT}" = "" ];then
RECORDS_RETURNED_COUNT=0;
fi
fi
End_Pre
fi
fi
export RECORDS_RETURNED_COUNT
Check_Send_Mail ()
{
##
## Procedure Name: Check_Send_Mail
##
## Usage:
## Check_Send_Mail "email address" "Subject Text" "Body Text" Send|Build_Script
##
## Parameters:
## $1 - EmailTo
## $2 - Subject
## $3 - Mail Message
## $4 - Send, Build_Script, Test
##
## Description:
## This API is used for sending an email or building a script which contains the
## commands for sending the emails.
##
## Examples:
## Check_Send_Mail Steve.Andrew@oracle.com "Testing Send Mail" "Im in body" Send
##
## Returns:
## None.
##
## Notes:
## Mail Message can be: "`cat $OUT_DIR/$OUT_FILE.txt`"
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
##
case $4 in
Send|SEND|send)
mailx -s "$2" $1 << Zen
$3
.
Zen
;;
Build_Script|BUILD_SCRIPT|build_script)
SectionPrint "Inside: BUILD_SCRIPT: OUTPUT to: $OUT_DIR/${PRD}_Build_Send.sh"
$ECHO "mailx -s \"$2\" $1 << Zen
$3
.
Zen" >> $OUT_DIR/${PRD}_Build_Send.sh
;;
*) DONOTHING=y ;;
esac
Send_Email ()
{
##
## Procedure Name: Send_Email
##
## Usage:
## Send_Email
##
## Parameters:
## None, but these environment variables need to be set:
## $SendEmail - sends email if set to y
## $EmailTo - name of one or more addresses to email
## $MailMesg - Body of the mail / Actual message
## $EmailSubject - Subject of the mail
##
## Description:
## Send an email
##
## Examples:
## SendEmail=y; Email_To=root; EmailSubject="Demo Send_Email";
## MailMesg="Have a nice day"; Send_Email
##
## Returns:
## None.
##
## Notes:
## Allows for an optional (SendEmail=y/n) to send an email
## report back to oracle ie. EmailTo=Steve.Andrew@oralc.com)
## Optionally, the subject: of them mail can be set to: EmailSubject
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 04-MAR-2003 svarga Removed error message
##
Get_RDBMS_Header ()
{
##
## Procedure Name: Get_RDBMS_Header
##
## Usage:
## Get_RDBMS_Header [SILENT|{VERBOSE}]
##
## Parameters:
## 1 - Silent will not print any info, Verbose will display all
##
## Description:
## Get the database version and name from the database. Display this
## on the screen.
##
## Examples:
## Get_RDBMS_Header
## Get_RDBMS_Header SILENT
##
## Returns:
## RDBMS_VERSION - version of the RDBMS from v$version
##
## Notes:
## Requires no params, gets the Version and Name of the RDBMS
## based on: SQL_Login_Password connection found in the supp.conf
## file. - Effectively tests the database connectivity
##
## SQL_Login_Password=apps/apps@${TWO_TASK:=$ORACLE_SID}
## SQL="select user_name from fnd_user where user_name like 'S%'"
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 13-NOV-2002 dbezemer Changed the section header (removed the v$version)
## 2.03 16-JAN-2003 dbezemer Add 'exit 1' when cannot connect to RDBMS
## 115.7 15-DEC-2005 svarga 10g related fix
## 115.9 23-MAR-2006 dbezemer Add SILENT option; fix above comments; SetOption
removed
##
# Process part
SQL="set heading off
set feedback off
select banner from v\$version where banner like 'Oracle%'"
Run_SQL
# Output part
if [ "${1}" != "SILENT" ]; then
Insert_HTML "<P>"
Begin_Pre
SectionPrint "Database Name ${BEGIN_DELIM}${APPS_DBSID}${END_DELIM} in v\
$database"
Run_SQL
OUT="`cat $OUT_DIR/$OUT_FILE.txt | grep -v '^$'`"
Tab1Print "$OUT"
End_Pre
else
End_Pre
ErrorPrint "Unable to connect to the database"
ActionErrorPrint "Make sure the database and listener are started"
exit 1
fi
fi
Compare_SQL_Data ()
{
##
## Procedure Name: Compare_SQL_Data
##
## Usage:
## SQL="sql statement";
## ERROR_MESSAGE="Plz fix this setup by changing the XYZ Profile Value... "
## Compare_SQL_Data "Blue Header Message" "String to Match" "{=}|!=" SILENT
##
## Parameters:
## Setup SQL="sql statement to match strings in results of"
## $1 - Message in Header as to what this checks
## $2 - STRING to MATCH
## $3 - Condition: != or = (default)
## $4 - SILENT|{NORMAL}|VERBOSE
##
## Description:
## This API runs the previously set SQL statement and compares the outcome
## with a string ($2).
##
## Examples:
## SQL="select user_name from fnd_user where user_name like 'SYSA%'";
## Compare_SQL_Data "for defined user in FND_USERS" "SYSADMIN" "=" VERBOSE
##
## Returns:
## $CHECK - the Matched line from the sql output that matches the string
## $RESULTS - True/False (Match Condition)
## $OUT_DIR/$OUT_FILE.txt - output from the sql statement
##
## Notes:
## Optionally, set an OK_MESSAGE or ERROR_MESSAGE that
## will show up based on RESULTS being True or False.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.41 01-MAR-2004 svarga Changed condition statement of the error message
##
Run_SQL
CHECK=`cat $OUT_DIR/$OUT_FILE.txt | grep ${2}`
# SILENT MODE
else
if [ "${CHECK}" "$cmp" "" ]; then
RESULTS=True; export RESULTS
else
RESULTS=False; export RESULTS
fi
fi
Get_File ()
{
##
## Procedure Name: Get_File
##
## Usage:
## Get_File "full path to file" "file name to save in OUT_DIR" <output mode>
##
## Parameters:
## $1 - File to Get
## $2 - Name to keep it as in the $OUT_DIR
## $3 - {VERBOSE}|SILENT
##
## Description:
## Copy file ($1) to the local directory where the diagnostic test runs from.
## This can be used for copying logfiles to current directory with the name of
## the test. This way these files get packaged into the tar.Z file and uploaded.
##
## Examples:
## Get_File $APPL_TOP/DB.env ${PRD}_DB.env
##
## Returns:
## Failed - returns y if file cannot be copied
## FILE_COPIED - returns the error code what can be
## "not_exist", "not_readable" or the number of the error code (0
by successful copy)
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.36 07-NOV-2003 svarga Not repeating the file name in the title and in the
section
## text, output part was simplifed (splited into
process and
## output part so making the same validation in Silent
mode as
## well), not writing permission info by File not exist
error,
## changed errors to warnings
## 16-DEC-2003 svarga Added others branch to cp error handling
## 19-JAN-2004 svarga Modified some action prints
## 2.51 28-APR-2004 svarga Corrected Failed settings, updated header
## 2.52 31-JAN-2005 sciobanu Modified to be able to get files containing spaces
in the name
## 115.7 15-DEC-2005 svarga Copied to the core from ADJinitDiag115.sh 115.3
## 115.8 10-FEB-2006 svarga Small textual change
##
# Process part
# The following resets Failed to 'n' in case a previous copy failed
Failed=n
if [ -r "${OUT_DIR}/$2" ];then
rm "${OUT_DIR}/$2"
fi
if [ -f "$1" ]; then
if [ -r "$1" ];then
cp "$1" "${OUT_DIR}/$2"
FILE_COPIED="$?"
else
FILE_COPIED="not_readable"
fi
else
FILE_COPIED="not_exist"
fi
# Output part
case "${FILE_COPIED}" in
"0")
SuccessPrint "File copied"
End_Pre
;;
"not_readable")
End_Pre
WarningPrint "Cannot read $1"
ActionWarningPrint "Please verify that the file has appropriate
permissions${LINE_FEED}${INDENT}File permissions:${LINE_FEED}${INDENT}`ls -l ${1}`"
$ECHO "Cannot read $1" > $OUT_DIR/$2
$ECHO "File permissions:" >> $OUT_DIR/$2
ls -l "${1}" >> "${OUT_DIR}/$2"
;;
"not_exist")
End_Pre
WarningPrint "File $1 does not exist"
ActionWarningPrint "Please verify that the source directory exists"
$ECHO "File $1 does not exist" > "$OUT_DIR/$2"
;;
*)
End_Pre
WarningPrint "File was not copied because of cp command error: $
{FILE_COPIED}"
ActionWarningPrint "Please verify that both source and destination
directories exist and that the disk of target directory is not full"
$ECHO "Cp command error: ${FILE_COPIED}" > "$OUT_DIR/$2"
;;
esac
fi
Check_Apps_Version ()
{
##
## Procedure Name: Check_Apps_Version
##
## Usage:
## Check_Apps_Version "Version1|Version2|...|VersionN" "" "" <output mode>
## OR:
## Check_Apps_Version "" <compare oper> <compare with> <output mode>
##
## Parameters:
## $1 - Version(s) separated by "|" to check for
## $2 - == >= <= > < !=
## $3 - Version to compare with if $2 is set
## $4 - VERBOSE|{SILENT}
##
## Description:
## This API finds the applications version. It will also check if it meets
## the required version ($3 with $2 or $1).
##
## Examples:
## Check_Apps_Version "10.7|11.5.1"
## Check_Apps_Version "" == 11.5.2 VERBOSE
##
## Returns:
## APPS_VERSION - Version of Oracle Applications found in applptch.txt
## APPLPTCH=True/False - Is there an applptch.txt file or not
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.05 02-JUL-2002 dbezemer not necessary to read applptch.txt file
## 2.06 25-JUL-2002 dbezemer APPS_VERSION in message text is missing a $
## 2.36 16-DEC-2003 svarga Added silent option when first parameter was not
entered
## 2.37 19-JAN-2004 svarga Changed some error messages (e.g. removed
Applications Version)
## 115.9 23-MAR-2006 dbezemer First check database, then on applptch.txt
##
# If no version is retrieved
if [ "${APPS_VERSION}" = "" -a -r $APPL_TOP/admin/${APPS_DBSID}/applptch.txt ];
then
APPLPTCH=True; export APPLPTCH
APPS_VERSION=`head -2 $APPL_TOP/admin/${APPS_DBSID:=$ORACLE_SID}/applptch.txt |
tail -1 | awk '{print $2}'`
fi
export APPS_VERSION
Check_File_Version ()
{
##
## Procedure Name: Check_File_Version
##
## Usage:
## Check_File_Version "File Name" "Operator" "Version" "Failed Message" "Search
for" "Note"
##
## Parameters:
## $1 - File to Search
## $2 - Comparison Operator == <= >= > < !=
## $3 - Version to Compare with
## $4 - Message if Wrong
## $5 - Object File or another string in Header
## $6 - if Failed Note (Optional)
## $OUTMODE SILENT|{VERBOSE}|BASIC
##
## Description:
## Get the version of the file ($1) and check if that matches the required one
($3).
##
## Examples:
## Check_File_Version $FND_TOP/bin/WFMAIL ">=" 115.12 "No Match" "" 112234
##
## Returns:
## FILE_VERSION - File name and version of the File Found by adident in the
Header
## VERSION - Version number of the specified file
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 12-JUN-2002 dbezemer Adjusted for Windows NT
## 13-JUN-2002 dbezemer Check the usage of ADIDENT first (pattern needed ?)
## dbezemer Added SILENT|VERBOSE|BASIC option
## dbezemer Added logic when adident comes back with three
columns
## 2.03 23-JUL-2002 dbezemer Improved output / moved Begin_Pre and End_Pre out of
SILENT mode
## svarga SILENT is now silent
## 30-JUL-2002 dbezemer when adident does not result in version, use
'strings'
## 2.04 19-DEC-2002 dbezemer Use Get_File_Version for getting the actual version
## dbezemer Parameter 5 can be empty now (list all versions
found)
## 2.05 05-MAR-2003 svarga Added actions to the error statements
## 2.37 19-JAN-2004 svarga Changed an error message
##
Get_File_Version ()
{
##
## Procedure Name: Get_File_Version
##
## Usage:
## Get_File_Version "File Name" "Version to Compare" "Failed Match Message"
"Object" "output mode"
##
## Parameters:
## $1 - File to Search
## $2 - Pattern to ident match
## $3 - Message if Wrong
## $4 - Object File or another string in Header (Optional)
## $5 - SILENT|{VERBOSE}|BASIC (Optional)
##
## Description:
## Get the version of certain file using adident or strings -a. Since APPS
executables
## and forms may contain many versions use 4th argument for making a
subselection.
##
## Examples:
## Get_File_Version $FND_TOP/bin/WFMAIL 115.12 "No Match"
## Get_File_Version $FND_TOP/bin/WFMAIL "" "Always match, just get versions" ""
SILENT
##
## Returns:
## FILE_VERSION - File name and Version of the File Found by adident in the
Header
## VERSION - Version of the file
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 12-JUN-2002 dbezemer Added support for NT - added $AD_TOP to 'adident'
command
## 13-JUN-2002 dbezemer Check the usage of ADIDENT first (pattern needed ?)
## 2.03 29-JUL-2002 dbezemer Added SILENT option
## 2.04 19-DEC-2002 dbezemer Add strings option and filter version from it
## 2.05 15-JAN-2003 dbezemer Do grep for $2 and $4 in one time, otherwise 'awk'
problems
## 2.06 30-JAN-2003 dbezemer Use $GREP to avoid error with strings command (Sun,
xpg4)
## 2.07 05-MAR-2003 svarga Added action to the error statement
## 2.36 10-NOV-2003 svarga Output part was simplifed (splited into process and
## output part), not writing permission info by File
not exist error,
## returns will be n/a when file can not be read,
showing section
## title by read error as well, changed messages
## 2.37 19-JAN-2004 svarga Changed some error messages
## 2.39 27-JAN-2004 dbezemer Changed strings command for NT and FNDSQF.pll
specifically
## 2.56 03-SEP-2004 dbezemer Add support for 11.5.10 where adident has different
output
## 115.16 13-SEP-2006 svarga Modified sed command to fixing ARCS/SCM issue BUG:
5526218
##
## Deprecation Notice:
## Comparison in this API will be deprecated in the next release. For comparing
## use Check_File_Version instead.
# Process part
if [ -r ${1} ]; then
# Due to problem with recent adident on NT we need this ...
if [ "${OS_NAME}" = "Windows_NT" ]; then
FILE2CHECK="`echo ${1} | sed 's#/#\\\\\\\\#g'`"
else
FILE2CHECK="${1}"
fi
# Sometimes the version is in third part; check for it: always starts with 11
or 10
VERSION=`$ECHO ${FILE_VERSION} | awk '{print $2}'`
MAJOR_VERSION="`$ECHO ${VERSION} | cut -c1-2`"
if [ "${MAJOR_VERSION}" != "11" -a "${MAJOR_VERSION}" != "10" ]; then
VERSION=`$ECHO ${FILE_VERSION} | awk '{print $3}'`
fi
else
VERSION="n/a"
FILE_VERSION="n/a"
fi
export VERSION FILE_VERSION
# Output part
if [ "${5}" = "" ]; then
GFV_OUTMODE="VERBOSE"
else
GFV_OUTMODE="${5}"
fi
Compare_Values ()
{
##
## Procedure Name: Compare_Values
##
## Usage:
## Compare_Values <ValueA> <operator> <ValueB>
##
## Parameters:
## $1 - ValueA
## $2 - Comparison Operations: == <= >= != or -eq -ge -le -ne
## $3 - ValueB
## $4 - VERBOSE|{SILENT}
##
## Description:
## Compare two versions with the supplied operator. Environment variable
## ANSWER will be set with the result of the compare.
##
## Examples:
## Compare_Values 115.12.113 ">=" 115.12
## Compare_Values 12.2 ">=" 12.28
## Compare_Values 8.1.6.0 "==" 8.1.6.03
## Compare_Values 8.1.6.0 "<=" 8.1.6.03
## Compare_Values 8.1.6.0 ">=" 8.1.6.03 VERBOSE
## Compare_Values 6.0.8.8.1 "<=" 6.0.8.14.0 VERBOSE
##
## Returns:
## ANSWER=[True|False]
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.06 11-JUL-2002 dbezemer Bug fix when comparing 115.12.115.2 with 115.12
## 2.07 12-JUL-2002 dbezemer Comparing 115.12 with 115.12.115.2 gave incorrect
result
## Also made additional change for NT (wc -m)
## 2.08 15-OCT-2002 dbezemer Completely revised; added support for '>' and '<'
## No more limitation to the number of arguments.
## 2.09 13-NOV-2002 dbezemer Bug fix for getting the n-th digit (empty when it
does
## not exist.
## 2.10 20-DEC-2002 dbezemer Now able to compare characters too (e.g. 5.5.2C with
5.5.2)
## 2.11 05-MAR-2003 svarga Added action to the error statement
##
FULL_ANSWER=""
Count=`expr ${Count} + 1`
done
ANSWER=""
case "$2" in
"-ge"|">=")
if [ $AA -ge $BB ]; then
ANSWER="True"
else
ANSWER="False"
fi
;;
"-gt"|">")
if [ $AA -gt $BB ]; then
ANSWER="True"
else
ANSWER="False"
fi
;;
"-le"|"<=")
if [ $AA -le $BB ]; then
ANSWER="True"
else
ANSWER="False"
fi
;;
"-lt"|"<")
if [ $AA -lt $BB ]; then
ANSWER="True"
else
ANSWER="False"
fi
;;
"-eq"|"="|"==")
if [ $AA -eq $BB ]; then
ANSWER="True"
else
ANSWER="False"
fi
;;
"-ne"|"!="|"<>")
if [ $AA -ne $BB ]; then
ANSWER="True"
else
ANSWER="False"
fi
;;
esac
Get_Package_Version ()
{
##
## Procedure Name: Get_Package_Version
##
## Usage:
## Get_Package_Version <name> <package|body> <compare> <Version_to_Match> <output
mode>
##
## Parameters:
## $1 - Package Name to find version information from Header
## $2 - Package or Body to extract Version on
## $3 - Compare with == >= <= > < !=
## $4 - Version to Compare to Match
## $5 - {VERBOSE}|SILENT
##
## Description:
## Get version of the package stored in the database.
##
## Examples:
## Get_Package_Version "FND_CONCURRENT" PACKAGE ">=" 115.5
##
## Returns:
## SOURCE_VERSION - Version returned from DBA_SOURCE from the Header line
##
## Notes:
## This procedure gets and checks the Package or Package Body Version with
## that which is provided. It allows showing the Details of Hiding with just
## the resulting match.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 16-JAN-2003 dbezemer added SILENT option
##
# NOTE: Had to get rid of leading and trailing spaces... with sed command.
SOURCE_VERSION=`grep Header $OUT_DIR/$OUT_FILE.txt | awk '{print $4}' | sed
's/ //g'`
# Old tricks..
# A=`$ECHO $SOURCE_VERSION | sed 's/\.//g'`
# B=`$ECHO $4 | sed 's/\.//g'`
Compare_Values $SOURCE_VERSION $3 $4
Check_Disk_Space ()
{
##
## Procedure Name: Check_Disk_Space
##
## Usage:
## Check_Disk_Space <Volume to check> <free amount> [SILENT|VERBOSE]
##
## Parameters:
## $1 - Volume to check OR 'all' for all volumes
## $2 - Free Amt
## $3 - SILENT | VERBOSE (default)
##
## Description:
## Use 'df' to list available diskspace on the system and display only those
## volumes that have a higher percentage freespace then required ($2).
##
## Examples:
## Check_Disk_Space /tmp
##
## Returns:
## FULL_DISKS : # volumes not meeting required free diskspace
##
## Notes:
## none
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.03 05-JUN-2002 svarga Added support for NT
## svarga Now check for amount of diskspace free
## 14-JUN-2002 dbezemer Added support for AIX (other columns in df -k
command)
## 14-JUN-2002 dbezemer Added support for HP-UX (df -kP gives same layout as
on Sun)
## Added TABs (\t) in text output for better alignment
## 26-JUN-2002 dbezemer Removed the $SPACE-s from the output.
## 2.04 28-JUN-2002 dbezemer Revised cause of $SPACE and  
## 2.36 05-NOV-2003 dbezemer Added SILENT; simplified procedure
## 2.60 31-MAR-2005 svarga Shell adapter change (awk print)
##
# def_color="#CCFFFF"
def_color="lightyellow"
border=3
limit=$2
if [ "${1}" = "all" ]; then
volumes2grep="."
else
volumes2grep="$1"
fi
Check_Path ()
{
##
## Procedure Name: Check_Path
##
## Usage:
## Check_Path <program> <to add> <output mode>
##
## Parameters:
## $1 - Path Value to Check
## $2 - PATH to Fix
## $3 - OUTPUT MODE {VERBOSE}|SILENT
##
## Description:
## Check the PATH environment variable for existance of certain executable
## ($1). If this does not exist the 2nd parameter gives the path which should
## be added to fix it.
##
## Examples:
## Check_Path sendmail /usr/lib
## Check_Path sendmail /usr/lib SILENT
##
## Returns:
## FOUND = y/n - if file is found in the PATH
##
## Notes:
## Had a big problem with standard which.
## Added advantage, shows if in path multiple times.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 20-JUN-2002 rstead Suppressing errors from being seen in STD_OUT
## when running from the command line.
## 2.03 21-JUN-2002 dbezemer Added support for Windows NT
## (directory seperator is different)
## 2.06 11-JUL-2002 dbezemer Bug fix: displaying path on text mode looks ok now
## 2.07 05-MAR-2003 dbezemer Changed the error part of the code because of
LINE_FEED
##
WHICH_PATH=""
FOUND="n"
for ck in "${DIRLIST}"
do
# Added 2>/dev/null in order to supress errors from being seen
# when running from the command line.
Run_tnsping ()
{
##
## Procedure Name: Run_tnsping
##
## Usage:
## Run_tnsping <tns alias> "User Name" <output mode> <nr of pings>
##
## Parameters:
## $1 - Connect_String to tnsping or (adres...(port=xyz)) to test Names Server
## $2 - Personalized Name ie. "from CONNECT variable"
## $3 - Output Mode VERBOSE|BRIEF|SILENT (Defaults: BRIEF)
## $4 - tnsping Warning Value if Greater than this..
## $5 - Number of times to TNSPING the system (Optional Parameter)
##
## Description:
## Run tnsping using the supplied tns alias ($1). This API can also check if
## the pingtime is within specified boundaries ($4) and can executed the ping
## a specified number of times ($5).
##
## Examples:
## Run_tnsping ${TWO_TASK:=$ORACLE_SID} ""
## Run_tnsping PROD "" VERBOSE 100 5
## Run_tnsping "(address=(protocol=tcp)(host=fido)(port=1575))"
##
## Returns:
## TNSPING_MS - tnsping time in ms
## TNSPING_OUTPUT - Full Output from tnsping
## TNSPING_SUCCESS=True/False
## TNSPING_CONNECT_LINE - if successful
## TNSPING_MS_SUCCESS - True or False, if TNSPING_MS GT $4 - Returns False
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 11-JUN-2002 dbezemer Added support for NT
## 2.03 10-JAN-2003 dbezemer Result of 'TNSPING_MS_SUCCESS' was incorrect
## Have a 'code' part and an 'output' part
## 2.04 05-MAR-2003 svarga Added action to the warning statement
##
TNSPING_MS=""
TNSPING_OUTPUT=""
TNSPING_SUCCESS=""
TNSPING_CONNECT_LINE=""
TNSPING_MS_SUCCESS=""
TNSPING_OUTPUT=`${TNSPING} $1 $5`
OK=`$ECHO $TNSPING_OUTPUT | grep OK`
else
End_Pre
ErrorPrint "tnsping to ${BEGIN_DELIM}${1}${END_DELIM} failed"
ActionErrorPrint "Please check Metalink for following error messages:"
for a in `$ECHO $TNSPING_OUTPUT`
do
ERROR=`$ECHO $a | grep "TNS-"`
if [ "${ERROR}" != "" ];then
TNS_ERROR=`$ECHO $ERROR | sed 's/://g' | sed 's/TNS-//g'`
Plain_ErrorPrint `oerr TNS $TNS_ERROR`
fi
done
Show_Link 120223.1 Metalink "" "" ERROR
fi
fi
Check_Permissions ()
{
##
## Procedure Name: Check_Permissions
##
## Usage:
## Check_Permissions <file> <permissions> <output mode>
##
## Parameters:
## $1 - Path Value to Check
## $2 - permissions required (rwx or r-- or r-w etc)
## $3 - Output Mode VERBOSE|{BRIEF}|SILENT
## $4 - Permissions to check {OWNER}|GROUP|OTHER
##
## Description:
## Check permissions of the given file and see if it meets the requirements as
## supplied ($2).
##
## Examples:
## Check_Permissions sendmail rwx
##
## Returns:
## FILE_FOUND - True/False
##
## Version History:
## 2.01 ssandrew Initial Release
## 2.02 05-JUN-2002 svarga Made it work all the way
## 2.07 27-JUL-2002 svarga Added $4 parameter to check GROUP, OTHER permissions
## 31-JUL-2002 dbezemer Now NT also detects if the file is not there
## 2.08 15-JAN-2003 dbezemer Added above check for HP, IBM, Tru64 and Linux
## 2.36 06-NOV-2003 svarga Not repeating the file name in the title and in the
section
## text, output part was simplifed
## *2.61 21-APR-2005 svarga Changed grep to $GREP -e because of error on newer
MKS versions
## *2.37 31-JAN-2005 sciobanu Modified to be able to check files containing spaces
in the name
## 115.7 15-DEC-2005 svarga Merged version 2.61 from the core with version 2.37
## from ADJinitDiag115.sh 115.3
##
BEGIN_DELIM_TMP=$BEGIN_DELIM
END_DELIM_TMP=$END_DELIM
BEGIN_DELIM="\""
END_DELIM="\""
# Process part
GROUP=""
OWNER=""
OTHER=""
OWNER_EXACT_MATCH=""
OWNER_READ=""
OWNER_WRITE=""
OWNER_EXECUTE=""
GROUP_EXACT_MATCH=""
GROUP_READ=""
GROUP_WRITE=""
GROUP_EXECUTE=""
OTHER_EXACT_MATCH=""
OTHER_READ=""
OTHER_WRITE=""
OTHER_EXECUTE=""
CHECK_READ=""
CHECK_WRITE=""
CHECK_EXECUTE=""
LSL_COUNT=""
LSL=""
FILE_FOUND=""
GOOD=""
SELECTED_READ=""
SELECTED_WRITE=""
SELECTED_EXECUTE=""
SELECTED_NAME=""
LSL=`ls $LS_OPTION "$1" 2>&1 | grep -v "No such" | grep -v "not found" | grep -v
"does not exist"`
# LSL_COUNT=`ls -l $1 | grep -v "No such" | wc -c`
# Tab1Print "LSL=ls -l $1 | grep -v \"No such\""
# Tab1Print "${LSL}"
case "$PERM" in
OWNER*)
SELECTED=$OWNER
SELECTED_READ=$OWNER_READ
SELECTED_WRITE=$OWNER_WRITE
SELECTED_EXECUTE=$OWNER_EXECUTE
SELECTED_NAME="owner ${FILE_OWNER}"
CHECK_READ=`ls $LS_OPTION "$1" | cut -c2-2 | $GREP -e "${O_CHECK_READ}"`
CHECK_WRITE=`ls $LS_OPTION "$1" | cut -c3-3 | $GREP -e "${O_CHECK_WRITE}"`
CHECK_EXECUTE=`ls $LS_OPTION "$1" | cut -c4-4 | $GREP -e "$
{O_CHECK_EXECUTE}"`
;;
GROUP*)
SELECTED=$GROUP
SELECTED_READ=$GROUP_READ
SELECTED_WRITE=$GROUP_WRITE
SELECTED_EXECUTE=$GROUP_EXECUTE
SELECTED_NAME="group"
CHECK_READ=`ls $LS_OPTION "$1" | cut -c5-5 | $GREP -e "${O_CHECK_READ}"`
CHECK_WRITE=`ls $LS_OPTION "$1" | cut -c6-6 | $GREP -e "${O_CHECK_WRITE}"`
CHECK_EXECUTE=`ls $LS_OPTION "$1" | cut -c7-7 | $GREP -e "$
{O_CHECK_EXECUTE}"`
;;
OTHER*)
SELECTED=$OTHER
SELECTED_READ=$OTHER_READ
SELECTED_WRITE=$OTHER_WRITE
SELECTED_EXECUTE=$OTHER_EXECUTE
SELECTED_NAME="other"
CHECK_READ=`ls $LS_OPTION "$1" | cut -c8-8 | $GREP -e "${O_CHECK_READ}"`
CHECK_WRITE=`ls $LS_OPTION "$1" | cut -c9-9 | $GREP -e "${O_CHECK_WRITE}"`
CHECK_EXECUTE=`ls $LS_OPTION "$1" | cut -c10-10 | $GREP -e "$
{O_CHECK_EXECUTE}"`
;;
*)
;;
esac
READ_YES=na
WRITE_YES=na
EXECUTE_YES=na
if [ "${SELECTED_READ}" != "" -a "${CHECK_READ}" = "r" -o "${O_CHECK_READ}" =
"-" ]; then
READ_YES=r
fi
if [ "${SELECTED_WRITE}" != "" -a "${CHECK_WRITE}" = "w" -o "${O_CHECK_WRITE}"
= "-" ]; then
WRITE_YES=w
fi
if [ "${SELECTED_EXECUTE}" != "" -a "${CHECK_EXECUTE}" = "x" -o "$
{O_CHECK_EXECUTE}" = "-" ]; then
EXECUTE_YES=x
fi
if [ "${READ_YES}" = "r" -a "${WRITE_YES}" = "w" -a "${EXECUTE_YES}" = "x" ];
then
GOOD=y
else
GOOD=n
fi
else
FILE_FOUND=False
GOOD=n
fi
Log "SETTING: FILE_FOUND = $FILE_FOUND GOOD=$GOOD"
# Output part
if [ "${3}" != "SILENT" ]; then
Begin_Pre
SectionPrint "Required ${2} permissions on ${BEGIN_DELIM}${1}${END_DELIM} for
$SELECTED_NAME"
fi
BEGIN_DELIM=$BEGIN_DELIM_TMP
END_DELIM=$END_DELIM_TMP
Execute_URL ()
{
##
## Procedure Name: Execute_URL
##
## Usage:
## Execute_URL <URL to run> <pattern> <CONTAINED|NOT_CONTAINED> <output mode>
##
## Parameters:
## $1 - Path Value to Check
## $2 - Match Pattern in html output for SUCCESS,
## (use double quotes with nothing if not doing pattern match)
## $3 - CONTAINED|NOT_CONTAINED, Similar to grep vs. grep -v
## $4 - Output Mode VERBOSE|BRIEF|SILENT (Defaults: BRIEF)
##
## Description:
## Run the given URL and optionally check for certain pattern in the (HTML)
output.
## This API will handle both http and https (SSL) requests. http requests are
executed
## using DB package utl_http and the https requests are executed using specific
java
## code delivered in the 'jsphttps.jar'.
##
## Examples:
## Execute_URL http://poseidon:7777/shtml/ APPS CONTAINS VERBOSE
## Execute_URL http://zen/pls/coe/owa_util.print_cgi_env SCRIPT_NAME CONTAINED
VERBOSE
## Execute_URL
http://poseidon.us.oracle.com:7500/pls/VIS1155/owa_util.print_cgi_env
## "" CONTAINED BRIEF
##
## Returns:
## URL_RUN - URL tested
## URL_ATTEMPTED - SQLPLUS ran, but not necessarily the URL succeeded.
## URL_OUTPUT - output from utl_http.request('$URL')
## URL_MATCH - Matched Line from Search of html output
## URL_MATCH_FOUND - True/False
## URL_START_TIME - beginning of URL execution
## URL_END_TIME - end of URL execution
## URL_RUN_TIME - how long it takes to run the URL request in seconds
## URL_RETURNED_LINES - number of lines returned from the utl_http.request
## URL_RETURNED_BYTES - number of bytes returned from the utl_http.request
## WRONG_SSL_MESSAGE - text string with message that https call was not ok
## ORA - ORA error which occured when URL was run (when not using SSL)
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 31-JUL-2002 dbezemer Added settings (pagesize, linesize, trimspool)
## to the SQL statement
## 2.03 14-JAN-2003 svarga Minor textual changes
## 2.04 06-FEB-2003 dbezemer Add https support with special JAVA call
## / svarga (Jar file jsphttps.jar needed)
## Added 'tee -a', only one place for 'sectionprint',
## modified messages because of Final QA
## 2.05 03-MAR-2003 svarga Changed urls to URLs
## 2.36 31-OCT-2003 svarga Patterns in double quotes instead of in parents,
## not repeating pattern in the output
## 2.46 11-MAR-2004 svarga Enhanced API to work correctly with ORA errors
## (like 'ORA-01890: NLS error detected' related to
BUG:2003657)
## 2.54 12-AUG-2004 dbezemer Add check for SSLException
## 07-DEC-2005 dbezemer Change https code to use new ExecuteURL java class
## 115.9 04-APR-2006 dbezemer Ignore error calculating time to run URL
## 115.24 23-MAY-2007 dbezemer Avoid possible syntax error: bug 6067078
##
BEGIN_DELIM_TMP=$BEGIN_DELIM
END_DELIM_TMP=$END_DELIM
BEGIN_DELIM="\""
END_DELIM="\""
URL_RUN=""
URL_ATTEMPTED=""
URL_OUTPUT=""
URL_MATCH=""
URL_MATCH_FOUND=""
URL_RUN="$1"
URL_SEARCH_PATTERN="$2"
WRONG_SSL_MESSAGE=""
ORA=""
# Added the following line to be able to check for ORA errors (like ORA-01890:
NLS error detected)
ORA=`grep "ORA-" $OUT_DIR/$OUT_FILE.txt`
ORA_NUMBER=`$ECHO $ORA | awk -F":" '{print $1}'`
else
if [ "$JVM" = "" ]; then
if [ "${OS_NAME}" = "Windows_NT" ]; then
JVM=`grep "wrapper.bin=" $APACHE_TOP/../Jserv/etc/jserv.properties | grep
-v "^#" | \
sed 's#\\\#/#g' | awk -F"=" '{print $2}'`
else
JVM=`grep "wrapper.bin=" $APACHE_TOP/../Jserv/etc/jserv.properties | grep
-v "^#" | \
awk -F"=" '{print $2}'`
fi
fi
# From 11.5.9 and above the jserv.properties uses java.sh for starting up the
jserv.
# However, Windows NT does not use this and still contains the java executable.
# Just to make sure we check Windows NT for java.cmd
Compare_Values "$APPS_VERSION" "-gt" "11.5.8"
if [ "${OS_NAME}" != "Windows_NT" -a "${ANSWER}" = "True" ]; then
JVM=`grep "JSERVJAVA=" ${JVM} | grep -v "^#" | awk -F"=" '{print $2}'`
else
# check again but now for the 'java.sh' in the JVM line (Windows will not
have this)
# Note that we still use 'JSERVJAVA' to get the real java executable
if [ "${OS_NAME}" != "Windows_NT" -a "`echo ${JVM} | grep 'java\.sh'`" !=
"" ]; then
JVM=`grep "JSERVJAVA=" ${JVM} | grep -v "^#" | awk -F"=" '{print $2}'`
fi
fi
#URL_END_TIME=`date '+%H:%H:%M:%S'`
URL_END_TIME=" END_TIME: `date '+%m-%d-%C%y %H:%M:%S'`"
# Only do this when there is no SSLException (SSL Only) otherwise this will
fail
if [ "${SSLEXCEPTION}" = "" -a "${URL_RUN_TIME}" != "" ]; then
# if negative, add 60 and do again..
if [ $URL_RUN_TIME -lt 0 ]; then
TEMP1=`expr $END_SEC + 60`
END_SEC=$TEMP1
URL_RUN_TIME=`expr $END_SEC - $START_SEC`
fi
fi
Log "END_SEC - START_SEC = RUN_TIME ($END_SEC-$START_SEC=$URL_RUN_TIME)"
else
URL_ATTEMPTED="False"
URL_OUTPUT=""
URL_START_TIME=""
fi
export URL_ATTEMPTED
# To allow the API to work without doing a PATTERN MATCH, just running the URL
if [ "${URL_SEARCH_PATTERN}" != "" ]; then
case "$3" in
CONTAIN*|contain*)
URL_MATCH=`grep "$2" $OUT_DIR/$OUT_FILE.txt`
OutWords="contained"
;;
NOT_CONTAIN*|not_contain*)
URL_MATCH=`grep "$2" $OUT_DIR/$OUT_FILE.txt`
OutWords="not contained"
if [ "${URL_MATCH}" != "" ];then
URL_MATCH=""
else
#DEBUG Needed to evaluate NOT_CONTAINED to TRUE
URL_MATCH="<*Not Used* - but cannot be empty string>"
fi
;;
*)
URL_MATCH=`grep "$2" $OUT_DIR/$OUT_FILE.txt`
;;
esac
else
# RAN THE URL with no pattern MATCHING
OutWords="not checked for keyword"
URL_MATCH="not done"
fi
Tab1Print "URL_OUTPUT="
$ECHO "$URL_OUTPUT" | sed
's/'$URL_SEARCH_PATTERN'/<B>'$URL_SEARCH_PATTERN'<\/B>/g' | tee -a ${OUT_DIR}/$
{PRD}_${REPORT}.htm
else
Tab1Print "To see the HTML output use this URL: ${1}"
fi
else
if [ "${internal_format}" = "html" ]; then
Tab1Print "$URL_OUTPUT"
else
Tab1Print "To see the HTML output use this URL: ${1}"
fi
fi
BEGIN_DELIM=$BEGIN_DELIM_TMP
END_DELIM=$END_DELIM_TMP
Check_Config_File ()
{
##
## Procedure Name: Check_Config_File
##
## Usage:
## Check_Config_File "File to Search" "Param_Name to Match" "Delimiter" "Value to
Match"
## <pattern|<READ|WRITE|EXECUTE>> <compare oper> <note nr>
<special Yes/No>
## <recommended value> <output mode>
##
## Parameters:
## $1 - file with full path, can use Env Variables
## $2 - Param_Name ie. CONNECT
## $3 - Delimitor ie. "=", " ", ":"
## $4 - Value contained in Value of Param, (Ignores Case Currently)
## or
## if a FILE is returned, permissions can be checked
## READ, WRITE, EXECUTE (to check permissions)
## $5 - Comparison operator used with $4. (-gt, -lt, -eq) (Optional)
## $6 - Related Note# on Metalink (Optional)
## $7 - Special content, ie.: "Yes", the default is no special content
## (the value is after the second delimiter):
## wrapper.bin.parameters=-DFND_TOP=/u10/visappl/fnd/11.5.0
## $8 - Text for recommended value (optional)
## $9 - Output mode {VERBOSE}|BASIC|SILENT (optional)
##
## Description:
## This API will get a parameter / setting from a file and will retrieve the
value.
## It also can check if the value needs to meet certain requirements ($4). This
includes
## checking for pattern and checking if the retrieved filename can be found,
read, etc.
## If something is wrong, FAILED will be set accordingly.
##
## Examples:
## Check_Config_File init.ora "db_block_buffers" "="
## Check_Config_File $FND_TOP/resource/wfmail.cfg "REPLYTO" "=" "@"
## Check_Config_File /apps11i/vis11icomn/util/Apache/Apache/conf/httpd.conf
## "MaxKeepAliveRequests" " " 101 "-gt"
## Check_Config_File $APACHE_TOP/../Jserv/etc/zone.properties "session.timeout"
## "=" "" "" 186247.1 "" "Use value from the profile."
## Check_Config_File $APACHE_TOP/../Jserv/etc/jserv.properties "-
Dcz.uiservlet.templateurl"
## "=" "" "" 186247.1 "Yes" ""
## Check_Config_File $APACHE_TOP/../Jserv/etc/jserv.properties "-
Dcz.uiservlet.templateurl"
## "=" "" "" 186247.1 "Yes" "" SILENT
##
## Returns:
## Name - Name of the Parameter Searched for in config file
## Value - the value of the Name Parameter
## FAILED - MISSING_VALUE|WRONG_VALUE|FILE_ACCESS|NON_MATCHING_VALUE|
NO_$4_PERMISSION
##
## Notes:
## None.
##
## Version History:
## 2.01 ssandrew Initial Release
## 2.02 rstead added support ERROR_TITLE
## 04-JUN-2002 dbezemer Changed BluePrint to Plain_WarningPrint
## 2.05 28-JUN-2002 dbezemer For Windows NT replace all '\' with '/'
## 2.06 11-JUL-2002 dbezemer Bug fix: Changes returning FAILED flag (FILE_ACCESS
-> WRONG_VALUE)
## Bug fix: Changed message text when comparing values
(2nd compare)
## 2.07 11-JUL-2002 svarga Added $7 parameter to handle variables what come
after the
## second delimiter
## 29-JUL-2002 svarga Added $8 parameter to show recommended value
## 30-JUL-2002 dbezemer Changed the flow of the API
## Added SILENT option as argument 9
## 2.08 15-OCT-2002 dbezemer Added End_Pre for certain cases
## 2.09 10-JAN-2003 svarga Updated to use Show_Link API differently (because of
indentation)
## 2.36 03-NOV-2003 svarga Removed "Checking", removed parens, removed "Found",
## placed "=" between name and value
## 115.24 16-MAY-2007 dbezemer fix for bug 6050470
##
# Make sure we can read the file to grep for the Param $3
if [ -r "${1}" ]; then
# Possible to read the Name of the VARIABLE from the config file ?
if [ "${Name}" != "" ];then
compare=n
else
# Cannot Find Value in Config file, but can read file
if [ "${9}" != "SILENT" ]; then
End_Pre
$ProblemPrintAPI "$2 is not set."
if [ "${8}" = "" ]; then
$ActionPrintAPI "Please set $2 accordingly."
else
$ActionPrintAPI "Please set $2 accordingly. $LINE_FEED $8"
fi
fi
FAILED=MISSING_VALUE
fi
else
# Cannot read the config file at all
if [ "${9}" != "SILENT" ]; then
Begin_Pre
SectionPrint "Value of \"${2}${3}\" Parameter${LINE_FEED}${INDENT}in File:
${1}"
End_Pre
$ProblemPrintAPI "Cannot read file \"${1}\""
$ActionPrintAPI "Check and/or reset permissions on the file"
fi
FAILED=FILE_ACCESS
fi
export FAILED
if [ "${FAILED}" != "" -a "$6" != "" -a "$9" != "SILENT" ]; then
if [ "${ERROR_NAME}" = "WARNING" ]; then
Show_Link $6 Metalink "" "" WARNING
else
Show_Link $6 Metalink "" "" ERROR
fi
fi
ERROR_TITLE=""
Process_Options ()
{
##
## Procedure Name: Process_Options
##
## Usage:
## Process_Options
##
## Parameters:
## None.
##
## Description:
## When running on the web this API will make sure that the extra options
## like the documentation inside the diagnostic test (created with the #D) is
displayed.
##
## Examples:
## Process_Options
##
## Returns:
## None.
##
## Notes:
## Called to process "extra" command-line/web options. Internal Procedure *ONLY*
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.03 26-JUN-2002 svarga Insert_Style_Sheet is called only from html mode
## 2.04 15-JAN-2003 dbezemer Insert_Style_Sheet already called in Setup_Env
## 2.50 15-APR-2004 svarga Removed doc parameter checking (it was never used)
since Doc is designed
## to call by webdoc parameter, made webdoc parameter
checking more robust
## (also merged with debug parameter checking),
disabled help parameter
##
Parse_CGI_Args
Plain_SectionPrint "<H3>Settings</H3>"
$ECHO "<DIR><B>Directory</B>: `pwd`"
$ECHO "<B>APACHE_TOP</B>: $APACHE_TOP"
$ECHO "<B>APPL_TOP</B>: $APPL_TOP"
$ECHO "<B>ORACLE_HOME</B>: $ORACLE_HOME"
$ECHO "<B>TWO_TASK</B>: $TWO_TASK"
$ECHO "<B>TNS_ADMIN</B>: $TNS_ADMIN"
$ECHO "<B>LD_LIBRARY_PATH</B>: $LD_LIBRARY_PATH"
$ECHO "<B>HTTP_COOKIE</B>: $HTTP_COOKIE"
$ECHO "</DIR>"
$ECHO
Plain_SectionPrint "<H3>Mod_PLSQL Check</H3>"
$ECHO "USING: $HTTP_HOST/pls/${APPS_DBSID}/owa_util.print_cgi_env"
$ECHO "Click to <a href=http://$HTTP_HOST/pls/$
{APPS_DBSID}/owa_util.print_cgi_env>Test</a>"
$ECHO
Plain_SectionPrint "<H3>Mod_Jserv Check</H3>"
$ECHO "USING: $HTTP_HOST/servlets/Hello"
$ECHO "Click to <a href=http://$HTTP_HOST/servlets/Hello>Test</a>"
$ECHO
Plain_SectionPrint "<H3>Perl Check</H3>"
which perl
perl -v
$ECHO
Plain_SectionPrint "<H3>Key Env</H3>"
env | egrep 'HTTP|CGI|FORMS|ORACLE|TWO|REPORT|SERVER|TMP|TNS|LIB' | sort
# $ECHO "Prod_pw=$Prod_pw"
# $ECHO ""
# Get_Password SYSTEM
# $ECHO "Prod_pw=$Prod_pw SQL_Login_Password=$SQL_Login_Password"
$ECHO
Plain_SectionPrint "<H3>Full Current Env</H3>"
env | sort | egrep -v 'Password|LOGIN_PW'
$ECHO ""
Plain_SectionPrint "<H3>APPL_TOP ls -l | head -10</H3>"
ls -l $APPL_TOP | head -10
$ECHO ""
Plain_SectionPrint "<H3>ORACLE_HOME ls -l | head -10</H3>"
ls -l $ORACLE_HOME | head -10
$ECHO ""
Plain_SectionPrint "<H3>APACHE_TOP ls -l or OUT_DIR if APACHE_TOP not setup
(top 10 lines)</H3>"
ls -l $APACHE_TOP | head -10
Insert_HTML "</PRE>"
Show_Footer
exit
elif [ "$webdoc" != "" ]; then
ErrorPrint "Invalid webdoc parameter ${BEGIN_PRE}${webdoc}${END_PRE}"
ActionErrorPrint "Restart the test with valid webdoc parameter (e.g. help)"
exit 1
fi
# svarga: this is just for future use, other APIs like Setup_Login,
Get_Command_Parms, Get_Web_Parms_Secure
# are already prepared for the help parameter so we need to validate this
Show_Profile_Option ()
{
##
## Procedure Name: Show_Profile_Option
##
## Usage:
## Show_Profile_Option {Name|Value} {<Match>} [HTML|csv|text|{SILENT}] [LOOKUP]
[<Profile level>] [YES|{NO}] [<Level value>]
##
## Parameterss:
## $1 - Name or Value to Match of the Profile Option
## $2 - Pattern to Match the Profile Name or Value
## $3 - Output options HTML,csv,text or SILENT (default)
## $4 - Return ValueLong as meaning of Value (Optional)
## $5 - Profile level : { SITE } | APPL | RESP | USER | ALL
## $6 - List user profile option name instead of profile option name : YES | {NO}
## $7 - Level value (Optional): application_id, responsibility_id or user_id if
$5 is set to
## APPL, RESP or USER (e.g. if searching for USER level profile options of
SYSADMIN user
## then the 7. parameter must be 0 because the user_id of SYSADMIN is 0)
##
## Description:
## Get all profiles and their values that match the pattern ($2) in either
## name or value ($1).
## The output is stored in the $OUT_DIR/$OUT_FILE.txt file (SQL*Plus output file)
## and can be displayed automatically using 'HTML' in $3. This will work in both
## text and HTML because the Show_Table API is handling this.
##
## Examples:
## Show_Profile_Option Name "%AGENT%" HTML
## Show_Profile_Option Name "FND%" VERBOSE LOOKUP RESP "" 20420
##
## Return:
## $OUT_DIR/$OUT_FILE.txt - full txt output in csv format
## name, value
## Name - Returns the Name of the Searched Profile Setting
## Value - Returns the Value of the Returned Profile Setting
## ValueLong - Returns the Lookup Value (visible_option_value) of Value
##
## Notes:
## - NEED to Add Error Traping... if no comma, then records not returned from the
sql.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 30-JUL-2002 dbezemer Optionally return the meaning of the '$Value' ($4)
## 2.36 06-NOV-2003 dbezemer remove TABs from output, simplify API
## 07-NOV-2003 dbezemer print only the site profile options by default
## 10-NOV-2003 svarga Added $6 parameter to be able to list user profile
option names,
## modified Name-Value parameter setting
## 2.38 22-JAN-2004 svarga / Modified because of an HP Unix (sh-posix)
## dbezemer problem (setting FSI to LF is not working)
## 2.40 12-FEB-2004 svarga Rewritten API to be able to list LOOKUP values and
handle
## $7 parameter
## 2.50 15-APR-2004 svarga Added (+) to levels to show 'empty' profiles as
well, modified
## place of End_Pre in VERBOSE mode
##
Name=""
Value=""
ValueLong=""
ProfileId=""
ApplicationId=""
SectionPrint_text="Profile Options"
case "${5}" in
"USER") if [ "${7}" = "" ];then
# svarga: added (+) to show not set profiles as well
if [ "${1}" = "Name" ];then
Where=" and level_id (+) =10004"
else
Where=" and level_id=10004"
fi
SectionPrint_text="User Level Profile Options"
else
# svarga: added (+) to show not set profiles as well
if [ "${1}" = "Name" ];then
Where=" and level_id (+) =10004 and level_value (+) =${7}"
else
Where=" and level_id=10004 and level_value=${7}"
fi
UserName=`$SQLPLUS -silent <<EOF
${SQL_Login_Password}
set pages 0
set lines 1000
set heading off
select user_name
from fnd_user
where user_id = ${7}
/
exit
EOF
` # The above lines have to be at the far left in order for the SQL*Plus to work.
SectionPrint_text="User Level Profile Options of ${UserName} User"
fi
;;
"RESP") if [ "${7}" = "" ];then
# svarga: added (+) to show not set profiles as well
if [ "${1}" = "Name" ];then
Where=" and level_id (+) =10003"
else
Where=" and level_id=10003"
fi
SectionPrint_text="Responsibility Level Profile Options"
else
# svarga: added (+) to show not set profiles as well
if [ "${1}" = "Name" ];then
Where=" and level_id (+) =10003 and level_value (+) =${7}"
else
Where=" and level_id=10003 and level_value=${7}"
fi
ResponsibilityName=`$SQLPLUS -silent <<EOF
${SQL_Login_Password}
set pages 0
set lines 1000
set heading off
select responsibility_name
from fnd_responsibility_tl
where responsibility_id = ${7}
and language = 'US'
/
exit
EOF
` # The above lines have to be at the far left in order for the SQL*Plus to work.
SectionPrint_text="Responsibility Level Profile Options of $
{ResponsibilityName} Responsibility"
fi
;;
"APPL") if [ "${7}" = "" ];then
# svarga: added (+) to show not set profiles as well
if [ "${1}" = "Name" ];then
Where=" and level_id (+) =10002"
else
Where=" and level_id=10002"
fi
SectionPrint_text="Application Level Profile Options"
else
# svarga: added (+) to show not set profiles as well
if [ "${1}" = "Name" ];then
Where=" and level_id (+) =10002 and level_value (+) =${7}"
else
Where=" and level_id=10002 and level_value=${7}"
fi
ApplicationName=`$SQLPLUS -silent <<EOF
${SQL_Login_Password}
set pages 0
set lines 1000
set heading off
select application_name
from fnd_application_tl
where application_id = ${7}
and language = 'US'
/
exit
EOF
` # The above lines have to be at the far left in order for the SQL*Plus to work.
SectionPrint_text="Application Level Profile Options of $
{ApplicationName} Application"
fi
;;
"ALL") Where=""
;;
*) # svarga: added (+) to show not set profiles as well
if [ "${1}" = "Name" ];then
Where=" and level_id (+) =10001"
else
Where=" and level_id=10001"
fi
;;
esac
Set_Apps_SQL $2
Run_SQL
unset Where
# End of processing part however the output variables are set in the output part
# (because of handling multi rows queries like: Show_Profile_Option "Name"
"FLEXFIELD%" VERBOSE LOOKUP
Show_Profile_Option_Lookup ()
{
##
## Procedure Name: Show_Profile_Option_Lookup
##
## Usage:
## ProfileId=<ProfileId>
## ApplicationId=<ApplicationId>
## Value="<Value>"
## Show_Profile_Option_Lookup
##
## Parameters:
## None but these environment variables need to be set:
## ProfileId - Id of the profile
## ApplicationId - Id of the application
## Value - "Value for what the API searches the lookup"
##
## Description:
## The API gives back the lookup value (visible_option_value from the result of
the sql statement
## of the sqlvalidation column) for the profile value input parameter. This API
is used
## by the Show_Profile_Option API.
##
## Examples:
## ProfileId=65
## ApplicationId=279
## Value="SELF_SERVICE_USER"
## Show_Profile_Option_Lookup
## $ECHO "Site Use = $visible_option_value"
##
## Returns:
## visible_option_value - which is the lookup value of the entered profile value
## lookup_error - it contains the error message by any error (it is empty
otherwise)
##
## Notes:
## None.
##
## Version History:
## 2.40 27-FEB-2004 svarga Initial release
##
##
lookup_error=""
visible_option_value=""
if [ $? -eq 0 ]; then
eval $Fixed_SqlValidation_temp
# The column names and aliases do not contain INTO word so the following
works fine
Into_orig=`$ECHO $SQL | sed '{ s/[Ii][Nn][Tt][Oo]/INTO/g; s/[Ff][Rr][Oo]
[Mm]/FROM/g; }' | ${AWK} -F"INTO" '{print $2}' | ${AWK} -F"FROM" '{print $1}'`
Into_new=`$ECHO $Into_orig | tr [:lower:] [:upper:] | sed '{ s/://g;
s/NULL/TEMP/g; }'`
SQL_new=`$ECHO $SQL | sed "{ s/[Ii][Nn][Tt][Oo] *$Into_orig//; }"`
BEGIN
-- STR := '${SQL_new}';
-- OPEN CURS FOR STR;
OPEN CURS;
LOOP
FETCH CURS INTO ${Into_new};
EXIT WHEN CURS%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(PROFILE_OPTION_VALUE||'XXX'||VISIBLE_OPTION_VALUE);
END LOOP;
CLOSE CURS;
END;
/" # This slash has to be at the far left in order for the PLSQL to work.
Run_PLSQL
visible_option_value=`$AWK '
BEGIN {
FS = "XXX";
value_pattern = "'${Value}'";
}
{
value_word = $1;
visible_option_value_word = $2;
if ( value_word == value_pattern )
{
printf(visible_option_value_word);
}
}' $OUT_DIR/$OUT_FILE.txt`
else
lookup_error="The content of the sqlvalidation files is corrupt"
fi
fi
Set_Apps_SQL ()
{
##
## Procedure Name: Set_Apps_SQL
##
## Usage:
## apps=Internal_Keyword (found in Set_Apps_SQL procedure)
## Set_Apps_SQL
## Run_SQL
##
## Parameters
## None.
##
## Description:
## Define SQL statement for specific purpose. Set the 'apps' environment
## var to the 'purpose' and then this API will set the SQL environment
## variable to the appropriate SQL statement.
##
## Example:
## apps=profile;
## Set_Apps_SQL;
## Run_SQL
##
## Returns:
## SQL - corresponding SQL Statement set
##
## Note:
## The apps= is an Internal only short same of the SQL, used by API only.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 25-JUL-2002 hakkinap modified format value for 'Level' and
'Responsibility'
## 2.03 22-JAN-2003 sasarumu Changed the SQL under "$apps" = "profile_name"
## 2.36 07-NOV-2003 dbezemer line length profile_name_short, profile_value_short
## svarga Added profile_name_short_userprofilename and
## profile_value_short_userprofilename part to list
user
## profile option name
## 2.37 19-JAN-2004 svarga Put default values for decode statements (cosmetic
change)
## 2.40 12-FEB-2004 svarga Replaced hardcoded "APPS." usernames with $
{LOGIN_ID), modified
## the first part (form, table, view, menu, conc
selects) removed
## ${FNDNAM}-s etc., modified
profile_name_short_userprofilename,
## profile_value_short_userprofilename,
profile_name_short,
## profile_value_short to show profile_option_id and
application_id as well
## 2.50 15-APR-2004 svarga Modified profile_name_short and
profile_name_short_userprofilename
## part to show empty (unset) profiles as well
##
select fpo.profile_option_name||','||
fpov.profile_option_value||','||fpov.profile_option_id||','||
fpov.application_id
from ${LOGIN_ID}.fnd_profile_option_values fpov,
${LOGIN_ID}.fnd_profile_options fpo,
${LOGIN_ID}.fnd_application fa,
${LOGIN_ID}.fnd_responsibility_vl fr,
${LOGIN_ID}.fnd_user fu,
${LOGIN_ID}.fnd_logins fl
where fpo.profile_option_id=fpov.profile_option_id
and fa.application_id(+)=fpov.level_value
and fr.application_id(+)=fpov.level_value_application_id
and fr.responsibility_id(+)=fpov.level_value
and fu.user_id(+)=fpov.level_value
and fl.login_id(+) = fpov.LAST_UPDATE_LOGIN
and fpov.profile_option_value like '$1'"
select fpow.user_profile_option_name||','||
fpov.profile_option_value||','||fpov.profile_option_id||','||
fpov.application_id
from ${LOGIN_ID}.fnd_profile_option_values fpov,
${LOGIN_ID}.fnd_profile_options_vl fpow
where fpow.profile_option_id = fpov.profile_option_id
and fpow.application_id = fpov.application_id
and fpow.start_date_active <= SYSDATE
and (nvl(fpow.end_date_active,SYSDATE) >= SYSDATE)
and fpov.profile_option_value like '$1'"
select fpo.profile_option_name||','||
fpov.profile_option_value||','||fpov.profile_option_id||','||
fpov.application_id
from ${LOGIN_ID}.fnd_profile_option_values fpov,
${LOGIN_ID}.fnd_profile_options fpo,
${LOGIN_ID}.fnd_application fa,
${LOGIN_ID}.fnd_responsibility_vl fr,
${LOGIN_ID}.fnd_user fu,
${LOGIN_ID}.fnd_logins fl
where fpo.profile_option_id=fpov.profile_option_id (+)
and fa.application_id(+)=fpov.level_value
and fr.application_id(+)=fpov.level_value_application_id
and fr.responsibility_id(+)=fpov.level_value
and fu.user_id(+)=fpov.level_value
and fl.login_id(+) = fpov.LAST_UPDATE_LOGIN
and fpo.profile_option_name like '$1'"
select fpow.user_profile_option_name||','||
fpov.profile_option_value||','||fpov.profile_option_id||','||
fpov.application_id
from ${LOGIN_ID}.fnd_profile_option_values fpov,
${LOGIN_ID}.fnd_profile_options_vl fpow
where fpow.profile_option_id = fpov.profile_option_id (+)
and fpow.application_id = fpov.application_id
and fpow.start_date_active <= SYSDATE
and (nvl(fpow.end_date_active,SYSDATE) >= SYSDATE)
and fpow.profile_option_name like '$1'"
SELECT
o.owner||'.'||o.object_name objname,
o.object_type,
o.created,
o.last_ddl_time,
o.status
FROM sys.dba_objects o
WHERE o.owner LIKE '$owner%'
AND o.object_name LIKE '$name'
AND o.object_type LIKE upper('$type%')
AND status = 'INVALID'
ORDER BY o.owner,o.object_name"
prompt $LINE_FEED</pre>
prompt </body></html>"
elif [ "$apps" = "workers" ]; then
SQL="
set lines 90
ttitle 'Running adctrl Worker Sessions'
col worker_id format 999900 heading 'WORKER'
col phase format a10 heading 'PHASE NAME'
col starttime format a19 heading 'LOGON'
col endtime format a19 heading 'END'
col restarttime format a19 heading 'RESTART'
col filehead format a12 heading 'FILENAME'
col statuscode format a15 heading 'STATUS'
col restarts format 99999900 heading 'RESTARTS'
select worker_id,
decode(status,'W',null,filename) filehead,
decode(status,'R',to_char(start_time, 'hh24:mi:ss mm/dd/yyyy'),
'Y',to_char(restart_time, 'hh24:mi:ss mm/dd/yyyy'),
'W',null,
null) starttime,
decode(status,'R','Running',
'F','Failed',
'Y','Restarted',
'W','Wait',
null) statuscode,
decode(status,'W',null,phase_name) phase,
restart_count
from applsys.fnd_install_processes
where worker_id != 0
and control_code = 'R'
and status in ('R','F','Y','W')
order by 1"
else
$ECHO "Should not be here"
fi
export SQL
Check_Jinitiator_Version ()
{
##
## Procedure Name: Check_Jinitiator_Version
##
## Usage:
## Check_Jinitiator_Version <Version_to_Match> <compare statement> [output mode]
##
## Parameters:
## $1 - Version to Compare to Match
## $2 - Compare with == >= <= > < !=
## $3 - {SILENT}|SHORT|BRIEF|VERBOSE
##
## Description:
## Check if the detected JInitiator version meets the required one. Also
## gets registered version of JInitiator for use with workflow (WF). Running
## in VERBOSE mode will also display messages accordingly (See steps 1-12 in
## the code below).
##
## Examples:
## Check_Jinitiator_Version "1.1.8.16" "==" VERBOSE
## Check_Jinitiator_Version "1.1.8.16" ">=" VERBOSE
## Check_Jinitiator_Version "1.1.8.16" ">=" SHORT
## Check_Jinitiator_Version "1.1.8.16" ">=" SHORT
## Check_Jinitiator_Version "1.1.8.16" ">=" SILENT
##
## Returns:
## Answer - True, if meeting the required version indicated via arguments
## False, otherwise
## PATH_OAJINIT - Full path to the oajinit.exe run-time or executable
## OAJINIT_VER - JInitiator Version found zipped up in $PATH_OAJINIT
## LATEST_JINIT_VERSION - Latest available JInitiator version
## LATEST_JINIT_CLASSID - Classid of latest available JInitiator
## APPSWEB_VERSION - JInitiator version found in $OA_HTML/bin/appsweb.cfg
## CLSID - CLSID string found in the $OA_HTML/bin/appsweb.cfg
## WF_PLUGIN, WF_CLASSID, WF_ADMIN, RESPONSIBILITY - Workflow parameters
##
## Notes:
## Although checking for new 1.3 JINIT currently not fully supported by this API.
##
## Version History:
## 115.9 27-MAR-2006 dbezemer Add support for 1.3.1.21-23-24-25, 1.1.8.25 and SUN
1.5.0_06
## 115.12 07-JUN-2006 dbezemer Fix issues with messages when using SUN 1.5
## 115.24 30-MAY-2007 dbezemer Improve support for appsweb.cfg
## 115.26 16-JUL-2007 dbezemer Fix check on 1631309 and oajinit.exe in
Check_Jinitiator_Version
## Add support for 1.3.1.29
##
appsWebFileName=`Get_AutoConfig_Value s_f60webcfg`
if [ "${appsWebFileName}" = "" ]; then
appsWebFileName="appsweb_${CONTEXT_NAME}.cfg"
else
appsWebFileName=`${ECHO} ${appsWebFileName} | ${AWK} -F"/" '{ print $NF }'`
fi
if [ ! -f ${OA_HTML}/bin/${appsWebFileName} ]; then
appsWebFileName="appsweb.cfg"
fi
# If the WF_ADMIN is a username then the value should not have a ":", so we set
# the FND_RESP_ID to a value that is absurd.
FND_RESP_ID=`$ECHO ${WF_ADMIN} | awk -F":" '{print $2}'`; export FND_RESP_ID
FND_RESP_ID=${FND_RESP_ID:=-99}; export FND_RESP_ID
case ${3} in
SHORT|BRIEF)
Begin_Pre
SectionPrint "JInitiator Version in \$OA_HTML/oajinit.exe"
if [ "${ANSWER}" = "True" ]; then
Tab1Print "Version $OAJINIT_VER is $2 then expected $1"
End_Pre
else
End_Pre
ErrorPrint "JInitiator Version $OAJINIT_VER is not $2 ${1}"
ActionErrorPrint "Upgrading to $LATEST_JINIT_VERSION is recommended."
fi
;;
VERBOSE)
Next_Section
SectionHeader "Certified JInitiator Versions"
#
# 1) JInitiator Versions certified for Oracle Applications 11i
# 1.1.7.27 | 1.1.7.32 | 1.1.8.3 | 1.1.8.7 | 1.1.8.11 | 1.1.8.13 | 1.1.8.16 |
1.1.8.19 | 1.1.8.20 | 1.1.8.22 | 1.1.8.24 |
# 1.3.1.24 | 1.3.1.9 | 1.3.1.14 | 1.3.1.18 | 1.3.1.21 | 1.3.1.23 | 1.3.1.24 |
1.3.1.25 | 1.3.1.28 | 1.3.1.29
# SUN 1.5.0_06
#
old_table_width=$table_width # remember current value
table_width="80%" # Set new one
Show_BigTable "JInitiator versions Certified with Oracle Applications 11i"
"11" "7" \
"JInitiator,Win95,Win98,WinNT,Win2000,WinXP,ClassID" \
"1.1.7.27,Y,Y,Y,Y,N,093501ce-d290-11d3-a3d6-00c04fa32518" \
"1.1.7.32,Y,Y,Y,Y,N,aa44da02-7f61-11d4-a3e1-00c04fa32518" \
"1.1.8.3 ,Y,Y,Y,Y,N,a2001dd0-c7bd-11d4-a3e1-00c04fa32518" \
"1.1.8.7 ,Y,Y,Y,Y,N,ff348b6e-fd21-11d4-a3f0-00c04fa32518" \
"1.1.8.11,Y,Y,Y,Y,N,86ecb6a0-400a-11d5-b638-00c04faedb18" \
"1.1.8.13,Y,Y,Y,Y,N,ed54a7b0-6c1c-11d5-b63d-00c04faedb18" \
"1.1.8.16,Y,Y,Y,Y,Y,9b935470-ad4a-11d5-b63e-00c04faedb18" \
"1.1.8.19,N,Y,Y,Y,Y,5e2a3510-4371-11d6-b64c-00c04faedb18" \
"1.1.8.20,N,Y,Y,Y,Y,e2258010-b53c-11d6-b64d-00c04faedb18" \
"1.1.8.22,N,Y,Y,Y,Y,332bd5a0-8000-11d7-b657-00c04faedb18" \
"1.1.8.24,N,N,Y,Y,Y,e79bc654-8fc6-4bb9-bfb8-8860779ae213" \
"1.1.8.25,N,N,N,Y,Y,7c2c94f0-7991-42b4-8d5f-4cb15b490657" \
"1.3.1.9 ,N,Y,Y,Y,Y,CAFECAFE-0013-0001-0009-ABCDEFABCDEF" \
"1.3.1.14,N,Y,Y,Y,Y,CAFECAFE-0013-0001-0014-ABCDEFABCDEF" \
"1.3.1.18,N,N,Y,Y,Y,CAFECAFE-0013-0001-0018-ABCDEFABCDEF" \
"1.3.1.21,N,N,N,Y,Y,CAFECAFE-0013-0001-0021-ABCDEFABCDEF" \
"1.3.1.23,N,N,N,Y,Y,CAFECAFE-0013-0001-0023-ABCDEFABCDEF" \
"1.3.1.24,N,N,N,Y,Y,CAFECAFE-0013-0001-0024-ABCDEFABCDEF" \
"1.3.1.25,N,N,N,Y,Y,CAFECAFE-0013-0001-0025-ABCDEFABCDEF" \
"1.3.1.28,N,N,N,Y,Y,CAFECAFE-0013-0001-0028-ABCDEFABCDEF" \
"1.3.1.29,N,N,N,Y,Y,CAFECAFE-0013-0001-0029-ABCDEFABCDEF" \
"1.5.0_06,N,N,N,Y,Y,CAFEEFAC-0015-0000-0006-ABCDEFFEDCBA"
table_width=$old_table_width # put remembered value back
Begin_Pre
SectionPrint "JInitiator Version set in \$OA_HTML/bin/${appsWebFileName}"
SuccessPrint "The JInitiator Plugin Version required to access Oracle
Applications is JInitiator version "${APPSWEB_VERSION}
End_Pre
#
# 2) Jinitiator settings in $OA_HTML/bin/${appsWebFileName}
#
Begin_Pre
SectionPrint "Jinitiator Settings from \$OA_HTML/bin/${appsWebFileName}"
SHOW=`cat ${APPSWEB_CFG} | grep jinit_`
for Y in `echo ${SHOW} | awk -F"^" '{print $1}'`
do
SuccessPrint "$Y"
done
End_Pre
#
# 3) Verifies which JInitiator Executables are located in the
$COMMON_TOP/util/jinitiator directory
#
Begin_Pre
if [ "${STREAM}" = "1.5" ]; then
SectionPrint "Available Executables Found in the Directory $
{JINITIATOR_LOC}"
if [ "${internal_output}" = "html" ]; then
SHOW2=`ls ${JINITIATOR_LOC}/*.exe 2>/dev/null | awk '{ for (i = NF; i >
0; i--) printf("<fontcolor=black>%s</font>\n", $i)}'`
else
SHOW2=`ls ${JINITIATOR_LOC}/*.exe 2>/dev/null | awk '{ for (i = NF; i >
0; i--) printf("%s\n", $i)}'`
fi
JINIT_COUNT=`ls ${JINITIATOR_LOC}/*.exe 2>/dev/null | wc | awk '{print
$1}'`
SuccessPrint "${SHOW2}"
Tab1Print "found ${JINIT_COUNT} executable(s)"
End_Pre
else
SectionPrint "Available JInitiator Executables Found in the Directory $
{JINITIATOR_LOC}"
if [ "${internal_output}" = "html" ]; then
SHOW2=`ls ${JINITIATOR_LOC}/jinit*.exe 2>/dev/null | awk '{ for (i = NF;
i > 0; i--) printf("<fontcolor=black>%s</font>\n", $i)}'`
else
SHOW2=`ls ${JINITIATOR_LOC}/jinit*.exe 2>/dev/null | awk '{ for (i = NF;
i > 0; i--) printf("%s\n", $i)}'`
fi
JINIT_COUNT=`ls ${JINITIATOR_LOC}/jinit*.exe 2>/dev/null | wc | awk '{print
$1}'`
if [ ${JINIT_COUNT} -le 0 ]; then
End_Pre
ErrorPrint "The correct JInitiator executable is missing"
ActionErrorPrint "Please download the latest jinitiator executable from
Metalink via note \
`Show_Link 124606.1 METALINK "" "" SILENT` and upload to: ${JINITIATOR_LOC}"
else
SuccessPrint "${SHOW2}"
Tab1Print "found ${JINIT_COUNT} JInitiator executable(s)"
End_Pre
fi
fi
#
# 4a) Compares the appsweb.cfg settings to the JInitiator executable found in the
JInitiator Plugin oajinit.exe
# For Jinitiator 1.1.x.y
#
if [ "$STREAM" = "1.1" ]; then
Begin_Pre
SectionPrint "JInitiator Download Plugin \$OA_HTML/oajinit.exe"
# Customer is = or > the latest Version
if [ "${APPSWEB_VERSION}" = "${OAJINIT_VER}" ];then
SuccessPrint "Found version ${OAJINIT_VER} zipped inside ${PATH_OAJINIT}"
SuccessPrint "which correctly matches version ${APPSWEB_VERSION} defined in
\$OA_HTML/bin/${appsWebFileName}"
End_Pre
else
# Incorrect JInitiator executable stored in the oajinit.exe - We recommend
repackaging the JInitiator again, or upgrading to the latest certified JInitiator
here...
End_Pre
ErrorPrint "The JInitiator Executable version ${OAJINIT_VER} zipped up in
JInitiator Plugin ${PATH_OAJINIT} \
does not match the JInitiator Executable version ${APPSWEB_VERSION} defined in \
$OA_HTML/bin/${appsWebFileName}"
ActionErrorPrint "Repackage the JInitiator Plugin using the \
$AD_TOP/bin/ADJBUILD.sh command to include \
the JInitiator version ${APPSWEB_VERSION} found in \$OA_HTML/bin/$
{appsWebFileName}"
if [ "${internal_output}" = "html" ]; then
Plain_ErrorPrint "${INDENT}Please follow <a
href=http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?
p_database_id=NOT&p_id=124606.1 target=_blank> Upgrading Oracle Applications
JInitiator 11i - (Note: 124606.1)</a> \
Step 3: Repackage Oracle JInitiator with appropriate digital certificate"
else
Plain_ErrorPrint "${INDENT}Please follow \"Upgrading Oracle Applications
JInitiator 11i\" - Note: 124606.1 \
Step 3: Repackage Oracle JInitiator with appropriate digital certificate"
fi
fi
elif [ "$STREAM" = "1.3" ]; then
#
# 4b) Compares the appsweb.cfg settings to the JInitiator executable
# and verifies if the jinitiator executable is the same as the oajinit.exe
# For Jinitiator 1.3.x.y
#
Begin_Pre
SectionPrint "JInitiator Download Plugin \$OA_HTML/oajinit.exe"
CHK1=`cksum ${OA_HTML}/oajinit.exe | awk '{ print $1 }'`
JINIT13_EXE="${JINITIATOR_LOC}/jinit`echo ${APPSWEB_VERSION} | sed
's/\.//g'`.exe"
CHK2=`cksum $JINIT13_EXE | awk '{ print $1 }'`
if [ "$CHK1" = "$CHK2" ];then
SuccessPrint "Detected that ${PATH_OAJINIT} is version ${APPSWEB_VERSION}"
SuccessPrint "which correctly matches \$OA_HTML/bin/${appsWebFileName}"
End_Pre
else
# Customer does not have the correct JInitiator executable copied to
oajinit.exe - recommend copying the executable
End_Pre
ErrorPrint "Detected that the ${OA_HTML}/oajinit.exe is different from
$JINIT13_EXE or one of these files does not exist"
ActionErrorPrint "Make sure both files exist and that they are the same."
if [ "${internal_output}" = "html" ]; then
Plain_ErrorPrint "${INDENT}Please follow <a
href=http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?
p_database_id=NOT&p_id=124606.1 target=_blank> Upgrading Oracle Applications
JInitiator 11i - (Note: 124606.1)</a>"
else
Plain_ErrorPrint "${INDENT}Please follow \"Upgrading Oracle Applications
JInitiator 11i\" - Note: 124606.1"
fi
fi
# Not doing anything when STREAM = 1.5
fi
#
# 5) JInitiator parameter CLSID (used by Internet Explorer) is a valid certified
version for Oracle Applications 11i
#
Begin_Pre
SectionPrint "CLSID Certification"
End_Pre
Begin_Pre
# The CLSID matches a certified version CERTIFY_CLSID for Oracle Applications
if [ "${CERTIFY_CLSID}" = "${CLSID}" ];then
SuccessPrint "The clsid ${BEGIN_DELIM}${CLSID}${END_DELIM} correctly
matches the certified version for Oracle Applications."
End_Pre
else
# Customer does not have the correct CLSID for the version of JInitiator -
We recommend updating these values to ${CERTIFY_CLSID}
End_Pre
WarningPrint "The CLSID is not certified for the version of JInitiator
defined in \$OA_HTML/bin/${appsWebFileName}"
ActionWarningPrint "Please change/update the CLSID in the \$OA_HTML/bin/$
{appsWebFileName}:\
${INDENT}from : jinit_classid=clsid:${CLSID} \
${INDENT}to : jinit_classid=clsid:${CERTIFY_CLSID}"
fi
#
# 6) Compares the appsweb.cfg files found in two different places match
#
Begin_Pre
OAHTML_APPSWEB=`cat ${OA_HTML}/bin/${appsWebFileName} | awk '$1 ~/^jinit_/
{print $0}' | egrep -v 'url|download|jinit_name'`
FNDTOP_APPSWEB=`cat ${FND_TOP}/resource/${appsWebFileName} | awk '$1
~/^jinit_/ {print $0}' | egrep -v 'url|download|jinit_name'`
SectionPrint "Different ${appsWebFileName} Files"
if [ "${OAHTML_APPSWEB}" = "${FNDTOP_APPSWEB}" ];then
SuccessPrint "The ${appsWebFileName} files in \$OA_HTML/bin and \
$FND_TOP/resource are in sync"
End_Pre
else
End_Pre
WarningPrint "The ${appsWebFileName} files in \$OA_HTML/bin and \
$FND_TOP/resource are not in sync"
ActionWarningPrint "Oracle recommends whenever upgrading JInitiator
versions to update the \$FND_TOP/resource/${appsWebFileName} \
to match \$OA_HTML/bin/${appsWebFileName} which is actually used so they are in
SYNC."
if [ "${internal_output}" = "html" ]; then
Plain_WarningPrint "Please follow <a
href=http://metalink.oracle.com/metalink/plsql/ml2_documents.showNOT?
p_id=124606.1&p_showHeader=1&p_showHelp=1#config target=_blank>Step 4: Configure
Applications 11i to Use a Specific Version of Oracle JInitiator</a> in Note
124606.1 - Upgrading Oracle Applications JInitiator 11i."
else
Plain_WarningPrint "Please follow \"step 4: Configure Applications 11i to
Use a Specific Version of Oracle JInitiator\" \
${INDENT}from note 124606.1 \"Upgrading Oracle Applications JInitiator 11i\" \
${INDENT}(http://metalink.oracle.com/metalink/plsql/ml2_documents.showNOT?
p_id=124606.1&p_showHeader=1&p_showHelp=1#config)"
fi
fi
#
# 7) Settings found in $FND_TOP/resource/appsweb.cfg
#
Begin_Pre
SectionPrint "\$FND_TOP/resource/${appsWebFileName} Settings"
for Y in `echo ${FNDTOP_APPSWEB} | awk -F"^" '{print $1}'`
do
Tab1Print "$Y"
done
End_Pre
#
# 8) Settings found in $OA_HTML/bin/appsweb.cfg
#
Begin_Pre
SectionPrint "\$OA_HTML/bin/${appsWebFileName} Settings"
for Y in `echo ${OAHTML_APPSWEB} | awk -F"^" '{print $1}'`
do
Tab1Print "$Y"
done
End_Pre
#
# 9) Verifies which JInitiator Version is set in the Global Preferences page on the
# Self Service Applications screen.
#
Begin_Pre
SectionPrint "Access to Global Preferences as the Workflow Administrator"
if [ "${WF_ADMIN}" = "*" ];then
WFTYPE="any User"
End_Pre
WarningPrint "The Workflow Administrator is set to an asterisk * which
allows every Oracle Application User this access."
ActionWarningPrint "It is recommended that this be changed to a single user
or responsibility."
else
if [ ${FND_RESP_ID} -ne -99 ]; then
WFTYPE="the Responsibility"
Tab1Print "The Workflow Administrator is set to the Responsibility \"$
{RESPONSIBILITY}\" in the WF_RESOURCES table."
End_Pre
else
WFTYPE="the User"
Tab1Print "The Workflow Administrator is set to the User \"$
{RESPONSIBILITY}\" in the WF_RESOURCES table."
End_Pre
fi
fi
#
# 10) Compares the appsweb.cfg settings to the Self Service Web Applications
JInitiator Version WF_PLUGIN value set in wf_resources
#
Begin_Pre
SectionPrint "Oracle Self Service Web Application's Workflow JInitiator
Plugin"
# Self Service Web Applications has the correct JInitiator Plugin Setting
if [ "${APPSWEB_VERSION}" = "${WF_PLUGIN}" ];then
SuccessPrint "Version Found ${BEGIN_DELIM}${WF_PLUGIN}${END_DELIM} $2
Expected Version ${BEGIN_DELIM}${APPSWEB_VERSION}${END_DELIM}"
SuccessPrint "The OSSWA Workflow JInitiator Plugin Version ${WF_PLUGIN}
matches the one set in the \"${appsWebFileName}\""
End_Pre
else
# Customer does not have the correct Self Service Web Applications
JInitiator Version.
# We recommend updating these values to match the ones set in the
$OA_HTML/bin/appsweb.cfg
End_Pre
ErrorPrint "The Workflow JInitiator Plugin Version ${WF_PLUGIN} does not
match version ${APPSWEB_VERSION} set in the \$OA_HTML/bin/${appsWebFileName}"
ActionErrorPrint "Please update the following Global Preferences entries
below :"
Plain_ErrorPrint "${INDENT}JInitiator Classid: ${WF_CLASSID}"
Plain_ErrorPrint "${INDENT}JInitiator Version: ${WF_PLUGIN}"
Plain_ErrorPrint "to match these values that are set in the \$OA_HTML/bin/$
{appsWebFileName} as listed below:"
for line in ${OAHTML_APPSWEB}
do
Plain_ErrorPrint "${INDENT}$line"
done
#
# 11) Display Summary of Jinitiator settings
#
Begin_Pre
SectionPrint "Summary of JInitiator Settings"
End_Pre
Show_Table "Oracle Applications 11i Version, ${APPS_VERSION}" \
"Oracle Applications Forms Patchset ${Forms_Patch} Version, $
{FORMS_VERSION}" \
"JInitiator Version set in ${appsWebFileName}, ${APPSWEB_VERSION}" \
"JInitiator Version set in the actual Plugin OAJINIT.exe, $
{OAJINIT_VER}" \
"JInitiator Version set in Workflow Global Preferences, $
{WF_PLUGIN}" \
"clsid set in ${appsWebFileName}, clsid:${CLSID}" \
"clsid set in Workflow Global Preferences, clsid:${WF_CLASSID}"
Begin_Pre
if [ "${internal_output}" = "html" ]; then
Tab1Print "For more information please follow <a
href=http://metalink.oracle.com/metalink/plsql/ml2_documents.showNOT?
p_id=124606.1&p_showHeader=1&p_showHelp=1#addl \
target=_blank>Step 6: Perform additional steps and review known issues</a> in note
124606.1 - Upgrading Oracle Applications JInitiator 11i."
else
Tab1Print "For more information please follow \"Step 6: Perform additional
steps and review known issues\" in \
Note 124606.1 - Upgrading Oracle Applications JInitiator 11i."
fi
End_Pre
;;
SILENT|*)
;;
esac
Check_JVM_Version ()
{
##
## Procedure Name: Check_JVM_Version
##
## Usage:
## Check_JVM_Version <Version_to_Match> <compare oper> [output mode]
##
## Parameters:
## $1 - Version to Compare to Match
## $2 - Compare with == >= <= > < !=
## $3 - {SILENT}|SHORT|VERBOSE|BRIEF
##
## Description:
## Get the Java Virtual Machine (JVM) version via wrapper.bin parameter as stored
## in jserv.properties. Also check if this detected version meets the required
## version (1st argument). Print messages accordingly if not in SILENT mode.
##
## Examples:
## Check_JVM_Version "1.1.8" "==" VERBOSE
## Check_JVM_Version "1.2.2" ">=" VERBOSE
## Check_JVM_Version "1.1.8" ">=" SHORT
## Check_JVM_Version "1.1.8" ">=" SHORT
## Check_JVM_Version "1.1.8" ">=" SILENT
##
## Returns:
## JVM_VERSION / VERSION - Version returned forms run-time httpd or httpds
(running process)
## JVM - the full path to the java run-time or executable
## Answer - True: meeting requirements mentioned in arguments
## False: otherwise
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.03 14-JUN-2002 svarga NT Support - sed needed on NT to clean the path from
special characters
## \\\ needed in the variable for sed
## $OUT_DIR instead of /tmp
## 2.04 17-JUN-2002 dbezemer Changed <BR> into ${LINE_FEED}
## Added BRIEF (same as SHORT) option to be consistent
with other APIs
## 2.05 05-MAR-2003 svarga Added actions to the error statements
##
VERSION=`eval $JVM -version 2>&1 | head -1 | awk '{print $3}' | sed 's/"//g'`
export VERSION
JVM_VERSION=$VERSION
export JVM_VERSION
case ${3} in
BRIEF|SHORT)
Begin_Pre
SectionPrint "JVM Version for: ${BEGIN_DELIM}${2} ${1}${END_DELIM}"
if [ ${ANSWER} = "True" ]; then
Tab1Print "Version Found: $VERSION is $2 the Expected: $1"
End_Pre
else
End_Pre
ErrorPrint "JVM Version $VERSION is not $2 ${1}"
ActionErrorPrint "Install the expected version"
fi
;;
VERBOSE)
Begin_Pre
SectionPrint "JVM Applications Server Version: ${2} ${BEGIN_DELIM}${1}$
{END_DELIM}"
# RedPrint "1st= $1 2nd = $2"
Tab1Print "The JVM is used for mod_jserv and jsp scripts. Current versions
are either: 1.1.8 or 1.2.2 or 1.3"
Show_Table "JVM Version found with, ${JVM} -version" "Current JVM version, $
{VERSION}"
# Tab1Print "Using JVM found with: <B>${JVM} -version</B>"
# Tab1Print "Found JVM Version (${VERSION})"
Tab1Print "As of June 2001 all Oracle Applications are certified with JDK
1.3${LINE_FEED}\
${INDENT}Since Self Service Framework Applications require JDK1.3., please use$
{LINE_FEED}\
${INDENT}the jdbc drivers rehosted by Oracle Applications. In other words, it is
necessary${LINE_FEED}\
${INDENT}to use the jdbc12.zip file which can be found under OA_JAVA for the
environment."
SILENT)
;;
esac
Check_Apache_Version ()
{
##
## Procedure Name: Check_Apache_Version
##
## Usage:
## Check_Apache_Version <Version_to_Match> <compare oper> [output mode]
##
## Parameters:Version to Compare to Match
## $1 - Version to Compare to Match
## $2 - Compare with == >= <= > < !=
## $3 - {SILENT}|SHORT|VERBOSE
##
## Description:
## Get the Apache version and check if this meets the required value as indicated
## by the first argument.
##
## Examples:
## Check_Apache_Version "1.3.9" "==" VERBOSE
## Check_Apache_Version "1.3.9" ">=" VERBOSE
## Check_Apache_Version "1.3.9" ">=" SHORT
## Check_Apache_Version "1.4.0" ">=" SHORT
## Check_Apache_Version "1.4.0" ">=" SILENT
##
## Returns:
## VERSION - Version returned forms run-time httpd or httpds (running process)
## MAIN_APACHE_PROCESS - the full path to the httpd or httpds process includes
runtime
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 17-JUN-2002 dbezemer Added support for Windows NT
## Changed the way of getting the apache executable
## 2.03 05-MAR-2003 svarga Added actions to the error messages
##
# Do it via APACHE_HOME
if [ "${OS_NAME}" = "Windows_NT" ]; then
MAIN_APACHE_PROCESS="${APACHE_TOP}/Apache"
else
if [ -r ${APACHE_TOP}/bin/httpd ]; then
MAIN_APACHE_PROCESS="${APACHE_TOP}/bin/httpd"
else
MAIN_APACHE_PROCESS="${APACHE_TOP}/bin/httpds"
fi
fi
VERSION=`${MAIN_APACHE_PROCESS} -v | head -1 | awk '{print $3}' | sed
's/Apache\///g'`
export VERSION
case ${3} in
SHORT)
Begin_Pre
SectionPrint "Apache Version: ${BEGIN_DELIM}${2} ${1}${END_DELIM}"
Check_Developer_Version ()
{
##
## Procedure Name: Check_Developer_Version
##
## Usage:
## Check_Developer_Version {FORMS|REPORTS} <compare oper> <compare with> [output
mode]
##
## Parameters:
## $1 - FORMS or REPORTS
## $2 - Compare with == >= <= > < !=
## $3 - Version to Compare to Match
## $4 - {SILENT}|SHORT|BASIC|VERBOSE
##
## Description:
## Determines the installed version of forms and reports. Based on that also
## determines which interoperability patch should have been applied if the
## developer software is patched.
## If not running in SILENT mode the given version is compared to the detected
## version and messages are displayed accordingly.
##
## Examples:
## Check_Developer_Version FORMS ">=" 6.0.8.8.0 VERBOSE
## Check_Developer_Version REPORTS ">=" 6.0.8.8.0 VERBOSE
##
## Returns:
## FORMS_VERSION - Version returned forms run-time oh/bin/f60run
## REPORTS_VERSION - Version returned reports run-time oh/bin/
## Req_IO_Patch - Required Interoperability patchnr for developer
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 17-JUN-2002 dbezemer Added support for Windows NT
## Changed retrieval of reports version on UNIX slightly
## Some minor changes to the text
## Added BASIC to the output mode options
## 2.03 23-JUL-2002 dbezemer Added patchset 10 to the list of patches
## Improved handling of 'unknown' patchset
## Changed hardcoded URL into Show_Link (better text
support)
## 31-JUL-2002 dbezemer Include batch=yes for reports charmode to avoid menu
and get version
## Check for libjava.so error when getting Reports
version
## 2.04 10-JAN-2003 svarga Updated to use Show_Link API differently (because of
indentation)
## 2.05 28-JAN-2003 dbezemer Add support for newer versions of Developer
## 2.06 04-MAR-2003 svarga Replaced InterOp with Interoperability, added actions
to
## the error statement
## 2.07 08-JUL-2003 dbezemer (as local API in ADJinitDiag115.sh) Add support for
newer version
## of Developer Changed IO patches to correct ones
## 2.36 20-OCT-2003 svarga Replace core api with local api (from
ADJinitDiag115.sh),
## removed "To confirm" from text, removed versions from
section titles,
## no tabs in output, changed JInitiator related
message, replaced Co-req,
## removed "Checks for"
## 16-DEC-2003 svarga Typo fix, added new versions
## 2.50 15-APR-2004 svarga Fixed BUG by Reports version testing (synchronized
FORMS and REPORTS testing)
## 2.54 12-AUG-2004 dbezemer Enhanced text messages
## 2.55 27-AUG-2004 dbezemer Support patchset 16
## 115.9 25-MAR-2006 dbezemer Support patchset 17 and 18
## 115.24 23-MAY-2007 dbezemer Fix typo in patchno (bug 6058499)
##
case $FORMS_VERSION in
6.0.8.8*) #$ECHO "base release: 6.0.8.8.X"
Forms_Patch="0";
Req_IO_Patch="None"; export Req_IO_Patch
;;
6.0.8.10*) #$ECHO "$1 Patchset 1 : 6.0.8.10.X"
Forms_Patch="1"
Req_IO_Patch=1524939; export Req_IO_Patch
;;
6.0.8.12*) #$ECHO "$1 Patchset 3 : 6.0.8.12.X"
Forms_Patch="3"
Req_IO_Patch=1634287; export Req_IO_Patch
;;
6.0.8.13*) #$ECHO "$1 Patchset 4 : 6.0.8.13.X"
Forms_Patch="4"
Req_IO_Patch=1719061; export Req_IO_Patch
;;
6.0.8.14*) #$ECHO "$1 Patchset 5 : 6.0.8.14.X"
Forms_Patch="5"
Req_IO_Patch=1741337; export Req_IO_Patch
;;
6.0.8.15*) #$ECHO "$1 Patchset 6 : 6.0.8.15.X"
Forms_Patch="6"
Req_IO_Patch=1524939; export Req_IO_Patch
;;
6.0.8.16*) #$ECHO "$1 Patchset 7 : 6.0.8.16.X"
Forms_Patch="7"
Req_IO_Patch=2115469; export Req_IO_Patch
;;
6.0.8.17*) #$ECHO "$1 Patchset 8 : 6.0.8.17.X"
Forms_Patch="8"
Req_IO_Patch=2115765; export Req_IO_Patch
;;
6.0.8.18*) #$ECHO "$1 Patchset 9 : 6.0.8.18.X"
Forms_Patch="9"
Req_IO_Patch=2161931; export Req_IO_Patch
;;
6.0.8.19*) #$ECHO "$1 Patchset 10 : 6.0.8.19.X"
Forms_Patch="10"
Req_IO_Patch=2283092; export Req_IO_Patch
;;
6.0.8.20*) #$ECHO "$1 Patchset 11 : 6.0.8.20.X"
Forms_Patch="11"
Req_IO_Patch=2616345; export Req_IO_Patch
;;
6.0.8.21*) #$ECHO "$1 Patchset 12 : 6.0.8.21.X"
Forms_Patch="12"
Req_IO_Patch=2601721; export Req_IO_Patch
;;
6.0.8.22*) #$ECHO "$1 Patchset 13 : 6.0.8.22.X"
Forms_Patch="13"
Req_IO_Patch=2699996; export Req_IO_Patch
;;
6.0.8.23*) #$ECHO "$1 Patchset 14 : 6.0.8.23.X"
Forms_Patch="14"
Req_IO_Patch=2906154; export Req_IO_Patch
;;
6.0.8.24*) #$ECHO "$1 Patchset 15 : 6.0.8.24.X"
Forms_Patch="15"
Req_IO_Patch=3102401; export Req_IO_Patch
;;
6.0.8.25*) #$ECHO "$1 Patchset 16 : 6.0.8.25.X"
Forms_Patch="16"
Req_IO_Patch=3392966; export Req_IO_Patch
;;
6.0.8.26*) #$ECHO "$1 Patchset 17 : 6.0.8.26.X"
Forms_Patch="17"
Req_IO_Patch=4138754; export Req_IO_Patch
;;
6.0.8.27*) #$ECHO "$1 Patchset 18 : 6.0.8.27.X"
Forms_Patch="18"
Req_IO_Patch=4888294; export Req_IO_Patch
;;
*) Log "Not sure what ($1) patchset this is: ${VERSION}"
Forms_Patch="Unknown"
Req_IO_Patch="None"; export Req_IO_Patch
;;
esac
# If still using the 'base' version when APPS was installed no need for IO Patch.
# First set the installed version depending on the currently running APPS_VERSION
case $APPS_VERSION in
11.5.10) FORMS_BASE_VERSION="6.0.8.25"
;;
11.5.1) FORMS_BASE_VERSION="6.0.8.10"
;;
11.5.2) FORMS_BASE_VERSION="6.0.8.10"
;;
11.5.3) FORMS_BASE_VERSION="6.0.8.12"
;;
11.5.4) FORMS_BASE_VERSION="6.0.8.12"
;;
11.5.5) FORMS_BASE_VERSION="6.0.8.14"
;;
11.5.6) FORMS_BASE_VERSION="6.0.8.14" # Should not come here
;;
11.5.7) FORMS_BASE_VERSION="6.0.8.18"
;;
11.5.8) FORMS_BASE_VERSION="6.0.8.18"
;;
11.5.9) FORMS_BASE_VERSION="6.0.8.21"
;;
*) Log "CHECK_DEVELOPER_VERSION: APPS Version ($APPS_VERSION) is not known"
;;
esac
case ${4} in
SHORT|BASIC|VERBOSE)
Begin_Pre
SectionPrint "$1 Version"
fi
;;
*) # DEFAULT ENV to SOURCE
;;
esac
Check_Node ()
{
##
## Procedure Name: Check_Node
##
## Usage:
## Check_Node "CON|DBS|ADM|FRM|WEB" [VERBOSE|{SILENT}]
##
## Parameters:
## $1 - CON|DBS|ADM|FRM|WEB
## $2 - VERBOSE | {SILENT}
##
## Description:
## This API determines whether the current node is acting as a node as indicated
## by the first argument (so webserver, formsserver, database, concurrent manager
## or as administrator node). For this purpose we try to find out which nodes are
## running as WEB, FRM, CON, DBS and ADM. We determine this with:
## - Check AutoConfig file
## - Check adconfig.txt
## - Check config.txt (generated by rapidwiz)
## After this we check if the value we found for "CON|DBS|ADM|FRM|WEB" is the
same
## as the current node.
##
## Examples:
## Check_Node "CON" VERBOSE
## Check_Node "WEB" SILENT
##
## Returns:
## NODE=True/False/Failed - True - Node is same as current machine.
## False - This is a separate node or machine
## Failed - cannot find config.txt
## CURRENT_NODE - The node currently running this diagnostic test
## DBS - Database Machine Name/Node
## WEB - Web Machine Name/Node
## ADM - Administrator Machine Name/Node
## FRM - Forms Server Machine Name/Node
## CON - Concurrent Manager Machine Name/Node
## SINGLE_NODE = True/False
##
## Notes:
## All returned nodenames are lowercase
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.03 18-JUN-2002 svarga Changing the letters of CURRENT_NODE to lower case
## 18-JUN-2002 svarga Changing the letters of
DBS,ADM,CON,FRM,WEB,CHECK_NODE
## to lower case
## 2.05 05-JUL-2002 dbezemer Made output consistent and improved text output
## 2.06 23-AUG-2002 dbezemer Added support for AutoConfig (using xml file to get
configuration)
## Changed header to reflect correct usage
## 2.07 05-MAR-2003 svarga Added action to the warning statement
## 2.40 12-FEB-2004 svarga Replaced hardcoded "APPS." usernames with $
{LOGIN_ID}
## 2.41 01-MAR-2004 svarga Modified autoconfig support (new autoconfig has
## ${TWO_TASK}_${CURRENT_NODE}.xml instead of $
{TWO_TASK}.xml)
## 2.58 13-JAN-2005 dbezemer Fix domainname issue: compare without domainname;
return domainnames
## of all tiers too; exclude current_node when checking
for other
## CON nodes in table fnd_concurrent_queues.
## 2.66 25-MAY-2005 dbezemer No longer convert nodename to lowercase
automatically
## 2.67 14-JUL-2005 svarga Added some more logging, changed back lower case
## conversion of CURRENT_NODE and using lower case when
## deriving DBS, ADM etc.(BUG: 4492737)
## 115.9 29-MAR-2006 dbezemer Add variable for webentryhost (load balancing)
##
# set nodename
CURRENT_NODE=`echo ${BNAME} | tr "[A-Z]" "[a-z]"`; export CURRENT_NODE
TIER_DB=`Get_AutoConfig_Value s_isDB`
TIER_ADMIN=`Get_AutoConfig_Value s_isAdmin`
TIER_NODE=`Get_AutoConfig_Value s_isConc`
TIER_FORMS=`Get_AutoConfig_Value s_isForms`
TIER_WEB=`Get_AutoConfig_Value s_isWeb`
# Load balanced ??
if [ "${WEB}" != "${WEBENTRY}" ]; then
SINGLE_NODE=False
LOAD_BALANCE=True
else
LOAD_BALANCE=False
fi
export SINGLE_NODE LOAD_BALANCE
Log "DBS=$DBS DBSDOM=$DBSDOM ADM=$ADM ADMDOM=$ADMDOM"
Log "CON=$CON CONDOM=$CONDOM FRM=$FRM FRMDOM=$FRMDOM"
Log "WEB=$WEB WEBENTRY=$WEBENTRY WEBDOM=$WEBDOM"
Log "LOAD_BALANCE=$LOAD_BALANCE SINGLE_NODE=$SINGLE_NODE"
else
# Not using autoconfig, must use other ways
# First, get the DBS node from tnsnames.ora
# e.g. (ADDRESS=(PROTOCOL=tcp)(HOST=nlsu22)(PORT=9101))
Log "AutoConfig configuration file not detected"
HOSTLINE=`sed -n '/^'$TWO_TASK'/ {p;n;p;n;p;}' $tnsnames_file | grep HOST`
DBS=`echo $HOSTLINE | awk '{line=$0; pos1=index(line,"HOST=")+5;
tmp=substr(line,pos1); pos2=index(tmp,")")-1; res=substr(tmp,1,pos2); print res;}'
| tr "[A-Z]" "[a-z]"`
unset HOSTLINE
# CON is next
if [ "$TIER_NODE" != "" ]; then
CON=$CURRENT_NODE
else
SINGLE_NODE=False; export SINGLE_NODE
if [ "$FOUND_CONFIG" = "y" ]; then
CON=`grep HOST $APPL_TOP/../config.txt | grep CON | awk -F"." '{print $2}'
| awk -F"=" '{print $2}' | tr "[A-Z]" "[a-z]"`
else
CON=`$SQLPLUS -s $SQL_Login_Password <<Zen
set heading off
set pagesize 0
select distinct lower(target_node)
from fnd_concurrent_queues
where lower(target_node) != '${CURRENT_NODE}'
/
Zen
`
fi
fi
Validate_Apps_User ()
{
##
## Procedure Name: Validate_Apps_User
##
## Usage:
## Validate_Apps_User "UserName" "Password" VERBOSE|SILENT
##
## Parameters:
## $1 - Oracle Applications User Name
## $2 - Oracle Applications User Name Password
## $3 - Output options: VERBOSE|SILENT
##
## Examples:
## Validate_Apps_User SYSADMIN SYSADMIN SILENT
## Validate_Apps_User GUEST ORACLE VERBOSE
##
## Returns:
## VALID_USER=True/False True - User_Name is Valid
## VALID_PASSWORD=True/False True - User Password is good or Bad
##
## Notes:
## None.
##
## Version History
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 30-JAN-2003 dbezemer Add action with error and use another note nr.
## 2.03 03-FEB-2003 svarga Corrected End_Pre issue
## 2.36 03-NOV-2003 svarga Replace core api with local api (from
FNDFrameWorkSetup115.sh):
## corrected End_Pre, put ACTION after ERROR (from
Danny's version
## with the new note), corrected Show_Link, corrected
SILENT mode,
## corrected API header
## 2.40 12-FEB-2004 svarga Fixing output part for correct SILENT mode
##
# Process part
SQL="select fnd_WEB_SEC.validate_login('$1','$2') from dual"
Run_SQL
# capture the return
# the variable names were not 'fixed' to keep backward compatibility,
# please do not use these anymore
SYSADMIN_OK=`cat $OUT_DIR/$OUT_FILE.txt | grep "Y "`
SYSADMIN_NOT=`cat $OUT_DIR/$OUT_FILE.txt | grep "N "`
if [ "${SYSADMIN_OK}" != "" ]; then
VALID_USER=True
VALID_PASSWORD=True
else
VALID_USER=False
VALID_PASSWORD=False
fi
export VALID_USER VALID_PASSWORD
# Output part
if [ "${3}" != "SILENT" ]; then
Begin_Pre
SectionPrint "Oracle Applications User $1 Connections"
Get_DB_Apps_Version ()
{
##
## Procedure Name: Get_DB_Apps_Version
##
## Usage:
## Get_DB_Apps_Version
##
## Parameters:
## None
##
## Description:
## Get Oracle Applications version from database.
##
## Examples:
## Get_DB_Apps_Version
##
## Returns:
## AppsVer=11.5.5 - current Oracle Applications Version from fnd_product_groups
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
##
SQL="
set head off
set feedback off
select release_name from fnd_product_groups"
Run_SQL
#
# Returns: ie. 11.5.4
#
AppsVer=`cat $OUT_DIR/$OUT_FILE.txt | egrep '11|12' | sed 's/ //g'`
Get_DB_Patch_List ()
{
##
## Procedure Name: Get_DB_Patch_List
##
## Usage:
## Get_DB_Patch_List "Product_Short_Name" "Bug_Number" "From_Date" [output mode]
##
## Parameters:
## $1 - "Oracle Applications Product Short Name or %" - this is not in use
anymore, but still
## has to set the parameter (to anything) because of backward compatibility
## $2 - like of Oracle Applications Bug_Number or %
## $3 - Greater than Creation Date (defaults to 01-JAN-2001)
## $4 - Output options: {VERBOSE}|SILENT
##
## Description:
## Get list of patched that meet the required boundaries (see parameters) and
## store that list in the file '${PRD}_Patch.csv'.
##
## Examples:
## Get_DB_Patch_List "FND" "1231123" "30-JAN-2001" SILENT
## Get_DB_Patch_List "%" "%" "" VERBOSE
##
## Returns:
## Records_Returned=True/False- True - Records Matched Query
## $OUT_DIR/Patch.csv
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.03 21-JUN-2002 svarga SQL correction (AD_APPLIED_PATCHES instead of
AD_BUGS)
## 21-JUN-2002 svarga Using Show_BigTable
## 21-JUN-2002 svarga Coding Records_Returned part
## 21-JUN-2002 svarga API header modification (SILENT instead of SUMMARY)
## 2.06 11-JUL-2002 dbezemer Added default date (01-01-2001) as mentioned above
## Changed usage text above
## Changed compare operator from '>' to '-gt'
## 2.07 04-MAR-2003 svarga Updated header because the first parameter is not in
use anymore
##
# Called to generate the complete Applied Patches list from the Database
# TABLE USED: AD_APPLIED_PATCHES
#
#SQL="
#set head off
#prompt Patch Listing
#prompt ===================
#prompt Product, Bug
#select application_short_name || ', ' || bug_number || ', ' || creation_date from
ad_bugs
#where
# application_short_name like '$1' and
# bug_number like '$2' and
# creation_date > '$3'
#order by application_short_name"
Run_SQL
cp $OUT_DIR/$OUT_FILE.txt ${PRD}_Patch.csv
totallines=`wc -l ${PRD}_Patch.csv | awk '{print $1}'`
if [ "${totallines}" -gt 0 ]; then
Records_Returned=True
else
Records_Returned=False
fi
export Records_Returned
Check_Table_Count ()
{
##
## Procedure Name: Check_Table_Count
##
## Usage:
## Check_Table_Count <Table_to_Count> <Compare_Operation> <Value> <Suc_Mess>
## <Fail_Mes> [{VERBOSE}|SILENT]
##
## Parameters:
## $1 - Table Name
## $2 - Comparison Operation: -gt -lt -eq
## $3 - Number to compare with
## $4 - Success Message
## $5 - Failed Message or Steps to fix
## $6 - Output options: {VERBOSE}|SILENT (optional)
##
## Description:
## Count the number of records returned by MYSQL. If this is not set, then count
the
## number of records in thetable as indicated by the first argument.
##
## Examples:
## Check_Table_Count "FND_CONCURRENT_REQUESTS" "-gt" 50000 "Success Mes" "Failed"
VERBOSE
## MYSQL="select user_name from fnd_user where user_name like 'SYSADMIN'"
## Check_Table_Count "for FND_USER SYSADMINs" "-lt" 10000 "Success - Kool"
## "Failed - delete some" VERBOSE
##
## Returns:
## RECORDS - returns the number of records in the table
## COMPARISON - True/False
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 04-MAR-2003 svarga Exiting if the comparison operation is not set
##
MYSQL=""
Escape ()
{
##
## Procedure: Escape
##
## Usage:
## Escape Variable_Name
##
## Parameters:
## $1 - Variable or String that Needs to be Escaped ie. + -> Space or %20 (hex)
to Space
##
## Description:
## Replace the 'HTML' equivalents with the real characters.
##
## Example:
## Escape $aparm1
##
## Returns:
## parm1 as the escaped results -
##
## Notes:
## None.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.50 15-APR-2004 svarga Replace core api with local api (from
FNDFlexfieldDiag115.sh):
## added %23 to be converted to '#'
## 115.9 23-MAR-2006 dbezemer Added @ (%40) to the list
##
one=`$ECHO $1 | sed 's/+/ /g' | sed 's/%25/%/g' | sed 's/%27/~/g' | sed 's/
%5C/\\\/g' | sed 's/%23/#/g'`
two=`$ECHO $one | sed 's/%3B//g' | sed 's/%2C/,/g' | sed 's/%24/$/g' | sed 's/
%2F/\//g' | sed 's/%40/@/g'`
three=`$ECHO $two | sed 's/%3D/=/g' | sed 's/%21/!/g' | sed 's/%28/(/g' | sed 's/
%29/)/g'`
parm1=`$ECHO $three | sed 's/%0D//g' | sed 's/%0A//g' | tr "~" "\047" | sed 's/
%5E/^/g' | sed 's/%3A/:/g'`
export parm1
Get_Web_Parms_Secure ()
{
##
## Procedure: Get_Web_Parms_Secure
##
## Usage:
## Get_Web_Parms_Secure
##
## Parameters:
## None.
##
## Description:
## The API is based on the old Get_Web_Parms API but it uses POST method in the
HTML form
## and it asks for APPS parameters as well (not storing these in plain text file
## support.cfg anymore).
##
## Get the required parameters by displaying a parameter screen with a 'Go'
button. When
## this button is pressed the test is executed again with the given parameters as
arguments.
## The header of the test must contain the parameters it needs and its prompt /
description.
## In case the argument 'aparm1' (the first argument) is already supplied we
assume the user
## has already given the required arguments and we continue with the actual test.
##
## Example:
## Get_Web_Parms_Secure
##
## Returns:
## None.
##
## Notes:
## HTML / WEB only.
## PARAMETER_NOTE1, PARAMETER_NOTE2 to print additional messages on the parameter
screen
## PARAMETER_ASTERISK to print asterisk for required parameters
##
## Version History:
## 2.49 23-APR-2004 svarga Initial Release
## 2.54 13-AUG-2004 dbezemer Add usual header to parameter screen; remove
temporary file
## which is created in html to show parameter screen
## 2.56 03-SEP-2004 dbezemer Not printing header, waiting for shell adapter
## *1.07 27-JUL-2004 svarga Copied core API version 2.49, Added pwd parameter
handling
## *1.08 29-JUL-2004 svarga Added instructions, using * for required parameters
## *1.10 05-AUG-2004 dbezemer Changed instructions into notes
## 115.7 15-DEC-2005 svarga Copied version 1.10 from from
WFJavaMailerSetup115.sh 115.5
## and merged it with version 2.56 in core, added note
handling
##
file_name="$SCRIPT_FILENAME"
$ECHO "$LINE_FEED<B>Purpose:</B>$SPACE$SPACE<I>$PURPOSE</i>"
$ECHO "$LINE_FEED<B>Running:</B>$SPACE$SPACE${Run_SH}"
if [ ! -z "${requires_parms}" ]; then
PARAMS=""
PARAMS=`head -100 ${file_name} | egrep -i 'PARM[1-9]|parm[1-9]' | grep -v
aparm | cut -c2-`
$ECHO "$PARAMS" |
while read parm
do
$ECHO "<TR><TD>"
$ECHO "`$ECHO "$parm" | cut -c7-`</TD>"
$ECHO "</TABLE>"
$ECHO "<INPUT TYPE=\"HIDDEN\" NAME=\"asked_for_parameters\" VALUE=\"Y\">"
# cleanup the temp files. This requires Cleanup API to be defined in the
diagnostic test
Cleanup 2>/dev/null
# Just to make sure, remove the html output file here too, ignoring messages
and errors
rm ${PRD_REPORT_FILE} 1>/dev/null 2>/dev/null
exit
fi
Get_Web_Parms ()
{
##
## Procedure: Get_Web_Parms
##
## Usage:
## Get_Web_Parms
##
## Parameters:
## None.
##
## Description:
## Get the required parameters by displaying a parameter screen with a 'Go'
button. When
## this button is pressed the test is executed again with the given parameters as
arguments.
## The header of the test must contain the parameters it needs and its prompt /
description.
## In case the argument 'aparm1' (the first argument) is already supplied we
assume the user
## has already given the required arguments and we continue with the actual test.
##
## Example:
## Get_Web_Parms
##
## Returns:
## None.
##
## Notes:
## HTML / WEB only.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.36 12-NOV-2003 svarga Added to the core file (from
FNDCCMDiagnostic115.sh):
## initiate asked_for_parameters hidden parameter to
not ask for
## parameters if the form was already shown once
## Deprecation Notice:
## This API will be removed in the next major release
## Use Get_Web_Parms_Secure instead of this API
file_name="$SCRIPT_FILENAME"
requires_parms="`head -100 $SCRIPT_FILENAME | grep '# parm1:'`"
Log "CHK: requires_parms = $requires_parms - file_name=$file_name"
$ECHO "$LINE_FEED<B>Purpose:</B>$SPACE$SPACE<I>$PURPOSE</i>"
$ECHO "$LINE_FEED<B>Running:</B>$SPACE$SPACE${Run_SH}"
$ECHO "$PARAMS" |
while read parm
do
$ECHO "<TR><TD>"
$ECHO "`$ECHO "$parm" | cut -c7-`"
$ECHO "<TD>$SPACE$SPACE <INPUT NAME=\"aparm${i}\" SIZE=14></TR>"
i=`expr $i + 1`
done
$ECHO "</TABLE>"
$ECHO "<INPUT TYPE=\"HIDDEN\" NAME=\"asked_for_parameters\" VALUE=\"Y\">"
$ECHO "$LINE_FEED<INPUT TYPE=SUBMIT VALUE=\"Run\" NAME=\"go\">$SPACE</FORM>"
Get_Command_Parms ()
{
##
## Procedure: Get_Command_Parms
##
## Usage:
## Get_Command_Parms
##
## Parameters:
## None.
##
## Description:
## Get the required parameters by prompting the user for them. The header of the
test
## should contain the parameters it needs and its prompt / description. In case a
file
## called "<program>.conf" exists the parameter must be in there.
##
## Example:
## Get_Command_Parms
##
## Returns:
## None.
##
## Notes:
## Command line only
## PARAMETER_NOTE1, PARAMETER_NOTE2 to print additional messages on the parameter
screen
## PARAMETER_ASTERISK to print asterisk for required parameters
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.02 08-JUL-2002 dbezemer For NT replace backslashes '\' by slashes '/'
## 2.03 05-DEC-2002 ssandrew Added support for ScriptName.conf file to get the
parms from
## 2.04 20-DEC-2002 svarga Commented out a debug $ECHO at the end
## 2.49 23-MAR-2004 svarga Security modification: LOGIN_ID & LOGIN_PW are not
in support.cfg anymore
## 2.54 13-AUG-2004 dbezemer Added usual header
## 2.60 31-MAR-2005 svarga Added some '2>/dev/null'-s to avoid errors when
running in OD,
## not calling Show_Header in OD, not showing Purpose
etc. in OD
## 2.61 21-APR-2005 svarga Not showing parameter prompts in OD
## 2.66 23-MAY-2005 dbezemer Fix program name display problem on NT
## 2.67 06-JUN-2005 svarga Enable spaces in the input parameters
## *1.08 29-JUL-2004 svarga Added instructions, using * for required parameters
## *1.10 05-AUG-2004 dbezemer Changed instructions into notes; simplify code
## *1.20 03-MAY-2005 svarga Modified stty commands because of OD, not showing
texts
## 115.7 15-DEC-2005 svarga Copied version 1.20 from from
WFJavaMailerSetup115.sh 115.5
## and merged it with version 2.67 in core
## 115.21 04-MAY-2007 svarga Small FQA fix
## 115.23 11-MAY-2007 dbezemer Fix for bug 6046724
##
file_name="$Program"
Log "PARAMS=$PARAMS"
Log "COUNT=$PARAMS_CNT"
i=1
aparm=`$ECHO "aparm${i}"`
#eval `$ECHO "$aparm=$ValueVar"`
eval "$aparm='$ValueVar'"
Show_BigTable ()
{
##
## Procedure Name: Show_BigTable
##
## Usage:
## Show_BigTable "Title" "#Rows" "#Columns"
## "Row1Col1, Row1Col2, Row1Col3, etc..."
## "Row2Col1, Row2Col2, Row2Col3, etc.."
## ...
##
## Parameters:
## $1 - First Value is always the Title which spans the number of columns
## $2 - The number of Rows
## $3 - The number of Columns
## $4 - Row1Col1, Row1Col2, Row1Col3, etc... (seperated by commas)
## $5 - Row2Col1, Row2Col2, Row2Col3, etc... (seperated by commas)
## $6 - Next Row and Columns etc...
## ... up to n
##
## color=#CCFFCC (optional background color - defaults to #CCFFFF)
## color="lightblue"
## size=1-7 (optional table border size - defaults to 5)
##
## Description:
## Show passed arguments as table. The first three arguments determine the
## layout of the table (title, #columns, #rows).
##
## Examples:
## Show_BigTable "Title" 7 12 \
## "<b>Row1 :</b>, Column2 , Column3 :, Column4 :,Column5 :,\
## Column6 :, Column7 :,Column8 :, etc..." \
## "<b>Row2 :</b>, Column2 , Column3 :, Column4 :,Column5 :,\
## Column6 :, Column7 :,Column8 :, etc..." \
## "<b>Row3 :</b>, Column2 , Column3 :, Column4 :,Column5 :,\
## Column6 :, Column7 :,Column8 :, etc..." \
## "<b>Row4 :</b>, Column2 , Column3 :, Column4 :,Column5 :,\
## Column6 :, Column7 :,Column8 :, etc..." \
## "<b>Row5 :</b>, Column2 , Column3 :, Column4 :,Column5 :,\
## Column6 :, Column7 :,Column8 :, etc..." \
## "<b>Row6 :</b>, Column2 , Column3 :, Column4 :,Column5 :,\
## Column6 :, Column7 :,Column8 :, etc..." \
## "<b>Row7 :</b>, Column2 , Column3 :, Column4 :,Column5 :,\
## Column6 :, Column7 :,Column8 :, etc..."
##
## Examples:
## Show_BigTable "This is my Title" 3 5\
## "<b>Header1</b>,<b>Header2</b>,<b>Header3</b>,\
## <b>Header4</b>,<b>Header5</b>" \
## "<b>Row2 :</b>, Column2 , Column3 :,Col4,Col5" \
## "<b>Row3 :</b>, Column2 , Column3 :,Col4,Col5"
##
## Returns:
## None
##
## Notes:
## -Even though <#Rows> is the second parameter passed in, it is not used.
## But it makes sense to include it in the size of the table being created.
## -Text output is very simple currently. Tabs are used to seperate the fields
## so the fields may not be aligned completely. May need to enhance in the
future.
##
## Version History:
## 2.01 30-APR-2002 ssandrew Initial Release
## 2.05 09-JUL-2002 dbezemer Added (simple) text output support
## 2.08 24-JUL-2002 hakkinap added to take care space problem in netscape
## 2.09 30-JUL-2002 dbezemer Added dynamic width; default (90%) can be overruled
by
## setting envvar 'table_width'
## Removed extra blank line from text output
## 2.36 04-NOV-2003 dbezemer Improved text output support; removed TABs, changed
alignment
## 2.60 31-MAR-2005 svarga Shell adapter changes (PRINTF_LINEFEED)
## 2.62 22-APR-2005 svarga Modified awk to ${AWK} because of a SUN specific
issue
##
count=1
while [ $count -le $cols ]
do
printf "<TH id=\"ColVal${count}\" BGCOLOR=black></TH>${PRINTF_LINEFEED}" |
tee -a $OUT_DIR/${PRD}_${REPORT}.htm
count=`expr $count + 1`
done
while [ $# -gt 0 ];
do
Record="$1"
$ECHO "<TR>" | tee -a $OUT_DIR/${PRD}_${REPORT}.htm
# svarga: modification because of a SUN specific problem
$ECHO $Record |${AWK} -F, '{ for (i=1; i<=NF; i++) printf("<TD ALIGN=LEFT
BGCOLOR=%s headers=ColVal%d>%s </TD>%s",def_color,i,$i,printf_linefeed)}'
def_color="${def_color}" printf_linefeed="${PRINTF_LINEFEED}"| tee -a $OUT_DIR/$
{PRD}_${REPORT}.htm
$ECHO "</TR>" | tee -a $OUT_DIR/${PRD}_${REPORT}.htm
shift
done
$ECHO "</table>$LINE_FEED$LINE_FEED" | tee -a $OUT_DIR/${PRD}_${REPORT}.htm
else
export cols
tmpfile=$OUT_DIR/${PRD}_BT$$.txt
touch $tmpfile
$ECHO " $Title" | tee -a $OUT_DIR/${PRD}_${REPORT}.txt
while [ $# -gt 0 ]
do
$ECHO "$1" >> $tmpfile
shift
done
# Now we know the size of the column; use it to print the columns
$AWK -F, '
BEGIN {
split(ENVIRON["lengths"],collengths," ");
nrcols=ENVIRON["cols"];
colsep=" ";
}
{ for (i = 1;i <= nrcols;i++) {
printf("%s%-*s",colsep,collengths[i],$i);
}
printf("\n");
}' $tmpfile
rm $tmpfile
$ECHO "$LINE_FEED" | tee -a $OUT_DIR/${PRD}_${REPORT}.txt
fi
Empty_Line ()
{
##
## Procedure: Empty_Line
##
## Usage:
## Empty_Line
##
## Parameters:
## None.
##
## Description:
## Leave the current line empty and skip to the next one.
##
## Example:
## Empty_Line
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.05 28-JUN-2002 dbezemer Initial Release
## 2.06 31-JUL-2002 dbezemer Changed the Text echo
## 2.07 05-MAR-2003 dbezemer Changed code to printf
##
Show_SQL_Output ()
{
##
## Procedure Name: Show_SQL_Output
##
## Usage:
## Show_SQL_Output "Filename" "Title" "start col1" "start col2" ... "start coln"
##
## Parameters:
## $1 - Filename to display as table
## $2 - Title at top of table
## $3..$n - starting position of columns
##
## Description:
## Display a text file as (HTML) table. The columns in the table must start
## at the given position(s). Typically, the output of a SQL statement in SQL*Plus
## can be used as input for this API.
##
## Examples:
## Show_SQL_Output $OUT_FILE.txt "Table" 1 21 41 51 61
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 2.01 dbezemer initial release
## 2.02 dbezemer some textual enhancements; bug fixes
## 2.03 23-OCT-2002 dbezemer changed the while loop; now based on nr of lines in
file
## Removed the header fields which contained nothing
anyway
## 2.04 20-NOV-2002 dbezemer Rewrote the code into awk to improve performance
## Changed the way the # of columns is checked
## 2.36 12-NOV-2003 svarga Replace core api with local api (from
ADJinitDiag115.sh):
## check for empty columns in HTML output, always
assume first
## row is header of table (Use TH)
## 2.60 31-MAR-2005 svarga Shell adapter changes (PRINTF_LINEFEED)
##
InputFile="$1"
Title="$2"
shift 2
nrCols=$#
Cols=$*; export Cols
IFSBU=$IFS; IFS="" # Need this for keeping ALL the spaces in the line
nrLinesInFile=`cat $InputFile | wc -l`
Log "nrLinesInFile:$nrLinesInFile"
## Notes
# Skip empty lines
# replace empty columns with ' '
$AWK '
function remove (xx, yy) {
while ((j=index(xx,yy)) != 0) {
xx = sprintf("%s%s",substr(xx,1,j-1),substr(xx,j+1));
}
return xx;
}
BEGIN { SHD="<TH>"; EHD="</TH>"; }
{ line = $0; testline="XX";
if (substr(line,1,1) == "-") {
testline=remove(remove(line,"-")," ");
}
if (line != "" && testline != "") {
strcols=ENVIRON["Cols"];
printf("<TR>");
nrcols = split(strcols,cols," ");
for (i = 1;i <= nrcols;i++) {
startCol=cols[i];
if (i != nrcols) {
endCol=cols[i+1] - 1;
valueCol=substr(line,startCol,endCol-startCol);
} else {
valueCol=substr(line,startCol);
}
if (substr(valueCol,1,1) == " " || valueCol == "" ) {
testline=remove(valueCol," ");
if (testline == "")
valueCol = " ";
}
printf("%s%s%s",SHD,valueCol,EHD);
}
printf("</TR>'${PRINTF_LINEFEED}'");
SHD="<TD>"; EHD="</TD>";
}
}' $InputFile | tee -a $OUT_DIR/${PRD}_${REPORT}.htm
IFS=$IFSBU
fi
} ### End Procedure Show_SQL_Output ###
Simple_Ping ()
{
##
## Procedure Name: Simple_Ping
##
## Usage:
## Simple_Ping NODE_TO_PING
##
## Parameters:
## $1 - Node Name
##
## Description:
## Pings the given node and sets the ALIVE output variable.
##
## Examples:
## Simple_Ping sundy.hu.oracle.com
##
## Returns:
## ALIVE - True/False/Invalid_OS
##
## Notes:
## Can not set Ping_NODE variables in Setup_OS because on some platforms
## parameters are needed after the node name as well.
##
## Version History:
## 2.36 12-NOV-2003 svarga Added to the core file (from
FNDFrameWorkSetup115.sh)
##
NODE_TO_PING=$1
case $OS_NAME in
SunOS)
Ping_NODE=`/usr/sbin/ping -s -v -R $NODE_TO_PING 1280 1 2>&1 | grep
unknown`
;;
HP*)
Ping_NODE=`/usr/sbin/ping -o $NODE_TO_PING 1280 1 2>&1 | grep unknown`
;;
AIX)
Ping_NODE=`/usr/sbin/ping -R $NODE_TO_PING 1280 1 2>&1 | grep unknown`
;;
OSF1)
Ping_NODE=`/usr/sbin/ping -R -c 1 -s 1280 $NODE_TO_PING 2>&1 | grep
unknown`
;;
Linux)
Ping_NODE=`/bin/ping -R -c 1 -s 1280 $NODE_TO_PING 2>&1 | grep unknown`
;;
DYNIX/ptx)
Ping_NODE=`/etc/ping -R -s 1280 -c 1 $NODE_TO_PING 2>&1 | grep unknown`
;;
Windows_NT)
Ping_NODE=`ping -l 1280 -n 1 $NODE_TO_PING 2>&1 | grep unknown`
;;
*) Log "Not sure what OS to use"
Ping_NODE="Invalid_OS"
;;
esac
AdidentNormalize ()
{
##
## Procedure Name: AdidentNormalize
##
## Usage:
## AdidentNormalize "number of columns"
##
## Parameters:
## $1 - number of columns to print (default 3)
##
## Description:
## Printing api what is used by Show_File_Versions api.
##
## Examples:
## AdidentNormalize 3
##
## Returns:
## None
##
## Notes:
## This api comes from ACT (with updated header).
##
## Version History:
## 2.36 12-NOV-2003 svarga Added to the core file (from ACT)
## 115.8 10-FEB-2006 svarga Fixing API header
##
#sed 's/://'|
awk '{
colon=":";
if (length($1)>0 && substr($1,length($1),1) == ":") {colon="";}
if (NF==2) {
printf("%s%s %s\n",$1,colon,$2);
} else if (NF==3) {
printf("%s%s %s %s\n",$1,colon,$2,$3);
}
}' | sort -u
} ### End Procedure AdidentNormalize ###
VersionFilter ()
{
##
## Procedure Name: VersionFilter
##
## Usage:
## VersionFilter "number of columns"
##
## Parameters:
## $1 - number of columns to print (default 3)
##
## Description:
## Printing api what is used by Show_File_Versions api.
##
## Examples:
## VersionFilter 3
##
## Returns:
## None
##
## Notes:
## This api comes from ACT (with updated header).
##
## Version History:
## 2.36 12-NOV-2003 svarga Added to the core file (from ACT)
## *2.37 18-JAN-2005 sciobanu Removed grep ' sh' otherwise some versions not shown
## 115.7 15-DEC-2005 svarga Merged version 2.37 from FNDCCMDiagnostic115.sh
115.3 with
## version 2.36 from the core
## 115.8 10-FEB-2006 svarga Fixing API header
## 115.9 23-MAR-2006 dbezemer Fixing comments to reflect code
## 115.14 13-SEP-2006 svarga Replaced the Header line corrupted by SCM
## 115.15 13-SEP-2006 svarga More changes in the sed command because of ARCS/SCM
issue
##
FieldsToPrint=${1:-2}
grep -i '$Header' |
sed -e '/SELECT/d' -e '/INSERT/d' -e '/^[ ]*$/d' -e 's/.*$Header: *//' |
grep -v '$Header' |
awk '{ res="";
if ('${FieldsToPrint}' >= 3) {
printf("%s %s",$1,$2);
levelstr = $3;
i = index(levelstr,"level");
if (i == 0) {
printf(" (0)");
} else {
j = index(levelstr,":") + 1;
levelnr = int(substr(levelstr,j));
printf(" (%d)",levelnr);
}
for(i = 4;i <= '${FieldsToPrint}';i++) {
printf(" %s",sp,$i);
}
} else {
printf("%s %s",$1,$2);
}
printf("\n");
}'
} ### End Procedure VersionFilter ###
VersionColumn ()
{
##
## Procedure Name: VersionColumn
##
## Usage:
## VersionColumn " This api comes from ACT (with updated header).
##
## Version History:
## 2.36 12-NOV-2003 svarga Added to the core file (from ACT)
##
Columns=${1:-3}
awk 'BEGIN { i=0; s=""; } {
if (i < '${Columns}') {
s = sprintf("%s%-40.40s",s,$0);
i++;
} else {
printf("%s\n",s);
s = sprintf("%-40.40s",$0);
i = 1;
}
} END {
printf("%s\n",s);
}'
} ### End Procedure VersionColumn ###
Show_File_Versions ()
{
##
## Procedure Name: Show_File_Versions
##
## Usage:
## Show_File_Versions <file name>
##
## Parameters:
## $1 - file name
##
## Description:
## Display the version information contained in one or more files.
## Each file can contain multiple lines of version information.
## This pertains mostly to compiled binaries comprised of many object files.
## Eg. $FND_TOP/bin/FNDLIBR
## HTML: For each file, the name is displayed followed by 5 columns of sorted
## version information.
## TEXT: 2 columns
##
## Examples:
## Show_File_Versions $FND_TOP/bin/FNDLIBR
##
## /amer/oracle/visus54/visus54appl/fnd/11.0.28/bin/FNDLIBR:
## afcore.lc: 110.1 afctx.lc: 110.0
afdacc.lc: 110.0
## afdcpm.lc: 110.3 afdf.lc: 110.0
afdict.lc: 110.10
## afdtmp.lc: 110.2 afe.lc: 110.0
...
##
## Returns:
## None
##
## Notes:
## This api comes from ACT (with updated header).
##
## Version History:
## 2.36 12-NOV-2003 svarga Added to the core file (from ACT)
## 2.41 01-MAR-2004 svarga Added correct API header
## 2.54 17-AUG-2004 dbezemer Improve output (alignment, text, HTML table);
STRINGS already
## defined in Setup_OS.
## 2.57 22-SEP-2004 svarga Updated API header, showing fullpath of files again
## 2.60 31-MAR-2005 svarga Shell adapter changes (PRINTF_LINEFEED)
##
File=$1
if [ "${internal_output}" = "html" ]; then
$ECHO "<BR>" | tee -a $OUT_DIR/${PRD}_${REPORT}.htm
Cols=5
printf("<TR>");
for(i = 0;i < '$Cols';i++) {
printf("<TH>File</TH><TH>Version</TH>");
}
printf("</TR>'${PRINTF_LINEFEED}'");
}
{
printf("<TR>");
for(i = 0;i < '$Cols';i++) {
j = i*2 + 1;
printf("<TD>%s</TD><TD>%s</TD>",$j,$(j+1));
}
printf("</TR>'${PRINTF_LINEFEED}'");
}
END {
printf("</TABLE>'${PRINTF_LINEFEED}'");
} ' 2>/dev/null | tee -a $OUT_DIR/${PRD}_${REPORT}.htm
Empty_Line
else
$STRINGS_CMD $File 2>&1 | VersionFilter 2 | AdidentNormalize | VersionColumn 2
| tee -a $OUT_DIR/${PRD}_${REPORT}.txt
fi
Display_Product_Status ()
{
##
## Procedure Name: Display_Product_Status
##
## Usage:
## Display_Product_Status [APPLID1|APPLID2|...|APPLIDn]
##
## Parameters:
## APPLID : Application ID
##
## Description:
## Display products status in table
##
## Examples:
## Display_Product_Status 50 1 201
##
## Returns:
## None
##
## Version History:
## 1.01 13-OCT-2004 dbezemer Initial Creation
## 1.02 25-MAY-2005 dbezemer Small change in column header
## 115.7 15-DEC-2005 svarga Copied to the core from ADJinitDiag115.sh 115.2
##
SQL="set pagesize 50
set linesize 80
set trimspool on
set feedback off
column \"Application Name\" format a40
column \"Short\" format a8
column \"Installed?\" format a10
column \"App Id\" format 99999
column \"Patchset\" format a10
select substr(fav.application_name,1,40) \"Application Name\",
fav.application_short_name \"Short\",
decode(fpi.status, 'I', 'Yes', 'S', 'Shared', 'N', 'No',
fpi.status) \"Installed?\",
fav.application_id \"App Id\",
fpi.patch_level \"Patchset\"
from fnd_application_vl fav, fnd_product_installations fpi
where fav.application_id = fpi.application_id
and fav.application_id in (${NEEDED_APPLIDS})
order by 2"
Run_SQL
Show_SQL_Output ${OUT_DIR}/${OUT_FILE}.txt "Product Status" 1 42 51 62 69
GetRegistrySetting ()
{
##
## Procedure Name: GetRegistrySetting
##
## Usage:
## GetRegistrySetting <PATH> <NAME>
##
## Parameters
## 1 : registry path / registry key
## 2 : registry entry to return
##
## Description:
## Return the value of the given registry entry
##
## Examples:
## GetRegistrySetting "HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE" "ORACLE_HOME"
##
## Return
## Print out the value of the entry
##
## Version History:
## 1.09 24-JUN-2004 dbezemer initial release
## 115.7 15-DEC-2005 svarga Copied to the core from FNDGSMDiag115.sh 115.2
##
# When setting not available this will print an error to stderr which will be
ignored.
# Actual return value will be empty then.
# Registry will return something like this:
# HKLM\SOFTWARE\ORACLE ORACLE_HOME "C:\Oracle"
# Only the last part is interesting (hence the awk) and cause of MKS we convert \
to / (sed)
GetClassHeader ()
{
## Procedure Name: GetClassHeader
##
## Usage:
## GetClassHeader
##
## Parameters:
## $1 - The class file (absolute path in the compressed file)
##
## Examples:
## GetClassHeader "oracle/apps/fnd/tcf/SocketServer.class"
##
## Returns:
## FILE_NAME - The Java file name
## HEADER_VER - Header version (if unzip command does not exist: "unzip")
##
## Note:
## $1 can be either the absolute path, or just the compressed file name
##
## Version history
## 1.0 rstead initial release
## 1.5 26-jun-02 dbezemer NT: directory seperator is ';'
## 1.13 31-jan-03 svarga added head -1 because $CLASSPATH can contain apps.zip
## more times
## 1.22 21-OCT-04 dbezemer apps.zip may be extracted and unzip may not exist,
always use
## 'apps.zip'/$JAVA_TOP for searching
## 115.7 15-DEC-2005 svarga Copied to the core from FNDNCAInstVerify115.sh 115.6
##
Check_FNDFS ()
{
## Procedure Name: Check_FNDFS
##
## Usage:
## Check_FNDFS [SILENT|{VERBOSE}]
##
## Parameters:
## $1 - SILENT | VERBOSE (DEFAULT)
##
## Examples:
## Check_FNDFS
## Check_FNDFS SILENT
##
## Returns:
## $HOST - host name that the listener is listening on
## *Only* returned if result is true
##
## $PORT - port # that the listener is listening on
## *Only* returned if result is true
##
## $RESULTS - True/False
## $OUT_DIR/$OUT_FILE.txt - output from the lsnrctl test
##
## Version History:
## 1.0 rstead initial release
## 1.1 26-jun-02 dbezemer NT: LSNRCTL is now defined in core
## PORT and HOST no longer set twice
## 03-jul-02 svarga / Changed the way the listener.ora on
## dbezemer Windows_NT is handled. Simplified it
## 1.2 01-aug-02 dbezemer Listener_file already set in core
## 1.3 05-sep-02 dbezemer Added '.txt' to the listener output file
## 1.23 22-feb-05 dbezemer case insensitive check on Port
## 115.7 15-DEC-2005 svarga Copied to the core from FNDNCAInstVerify115.sh 115.6
##
Begin_Pre
SectionPrint "FNDFS Listener Status"
# Now get the status of the listener and check if it is servicing FNDFS
${LSNRCTL} status ${FNDFS_listener} 1>${OUT_DIR}/${OUT_FILE}.txt 2>${OUT_DIR}/$
{OUT_FILE}.txt
result=`cat ${OUT_DIR}/${OUT_FILE}.txt | grep FNDFS |wc -l`
else
# *ONLY* returning RESULTS since RESULTS is false
RESULTS="False"; export RESULTS;
fi
case $1 in
silent|SILENT)
End_Pre
Do_Nothing=y
;;
*)
if [ "${RESULTS}" = "True" ]; then
Tab1Print "The FNDFS listener is running on host ${HOST} and port ${PORT}"
End_Pre
else
End_Pre
ErrorPrint "The FNDFS listener is not running, it is not possible to view
output of concurrent requests"
ActionErrorPrint "Please start the FNDFS listener. See Note `Show_Link
111383.1 Metalink "" "" SILENT`"
fi
;;
esac
Check_Port ()
{
##
## Procedure Name: Check_Port
##
## Usage:
## Check_Port {machine name} {port number}
##
## Parameters:
## $1 - Machine to test
## $2 - Port number to test
##
## Examples:
## Check_Port buffett 8002
##
## Returns:
## $RESULTS - True/False
## $OUT_DIR/$OUT_FILE.txt - output from the telnet test
##
## Version History:
## 1.0 rstead initial release
## 1.5 26-jun-02 dbezemer NT: LSNRCTL is now defined in core
## PORT and HOST no longer set twice
## 115.7 15-DEC-2005 svarga Copied to the core from FNDNCAInstVerify115.sh 115.6
##
machine=$1
port=$2
OUT_DIR=`pwd`; export OUT_DIR;
OUT_FILE="temp$$"; export OUT_FILE
if [ -r /usr/bin/telnet ]; then
# UNIX is usually /usr/bin/telnet
TELNET="/usr/bin/telnet"
# For NT has to be using windows telnet
# since MKS does not come with telnet.
else
TELNET="telnet"
fi
Using_SSL ()
{
##
## Procedure Name: Using_SSL
##
## Usage:
## Using_SSL {machine name} {Apache conf file}
##
## Parameters:
## $1 - Machine to test
## $2 - location of conf file
##
## Description:
## Get all Ports from the given ($1) apache config file file and check if
## they are running SSL. This is determined by sending normal http request
## to the port, if the response is '400 bad request' then this is SSL port.
##
## Examples:
## Using_SSL buffett /.../Apache/Apache/conf/httpd.conf
##
## Returns:
## SSL - True or False
## ANSWER - True or False
## SSL_PORTS - Derived SSL Ports from httpd(s).conf
##
## Version History:
## 1.0 dbezemer initial release
## 1.1 02-MAY-2004 dbezemer Changed logic to test every port for SSL
## 1.2 08-OCT-2004 dbezemer Check apache conf file
## 115.7 15-DEC-2005 svarga Copied to the core from FNDNCAInstVerify115.sh 115.6
##
MACHINE=${1}
APACHE_CONF_FILE=${2}
ANSWER="False"
# grep all the 'listen' ports from the conf file (no leading spaces)
ALL_LISTENS=`cat ${APACHE_CONF_FILE} | grep -i "^[ ]*Listen" | grep -v "\."
| sed 's/ //g'`
# Check the response on all ports with an entry 'Listen' in apache conf file
# Set all ports to SSL; then remove ports that are not SSL
SSL_PORTS="`echo ${ALL_LISTENS} | sed 's/Listen/ /g'`"
for ONE_PORT in `echo ${ALL_LISTENS} | sed 's/Listen/ /g'`
do
# Check if listener is running using netstat
RESULT=`netstat -an | grep "\.${ONE_PORT} "`
if [ "${RESULT}" != "" ]; then
# listener is running, now making sure
# Test the http protocol against this port and see what comes back
HTTP_URL="http://${MACHINE}:${ONE_PORT}/"
Execute_URL "${HTTP_URL}" "" "" SILENT
# If the http request errored out with "400 Bad Request" then this is a SSL
configured Port
BAD_REQUEST=`grep "400 Bad Request" ${OUT_DIR}/${OUT_FILE}.txt`
if [ "${URL_OUTPUT}" = "" -o "${BAD_REQUEST}" = "" ]; then
sed_cmd="s/${ONE_PORT}//"
SSL_PORTS="`echo ${SSL_PORTS} | sed ${sed_cmd}`"
else
ANSWER="True"
fi
else
# Not running so assume not SSL listener here
sed_cmd="s/${ONE_PORT}//"
SSL_PORTS="`echo ${SSL_PORTS} | sed ${sed_cmd}`"
fi
done
fi
SSL="$ANSWER"
Validate_ClassPath ()
{
## Procedure Name: Validate_ClassPath
##
## Usage:
## Validate_ClassPath [ SILENT | {VERBOSE} ]
##
## Parameters:
## $1 - SILENT | VERBOSE (default)
##
## Examples:
## Validate_ClassPath VERBOSE
## Validate_ClassPath SILENT
##
## Returns:
## RESULTS - True/False. True is returned if the classpath is valid
## RESULT_LIST - List of files that do not exist as a "," separated list
##
## Notes:
## Although not very likely, this API can give information of a jserv.properties
that is
## not in use. It will check the default directories where the file can reside but
the
## actual file that is used, comes from the jserv.conf and that is not done here.
##
## Version History:
## 1.0 rstead initial release
## 1.5 05-jul-2002 dbezemer NT changes (wrapper.classpath now contains '/', no
more '\')
## 115.7 15-DEC-2005 svarga Copied to the core from FNDNCAInstVerify115.sh
115.6
## 115.20 14-MAR-2007 dbezemer Changes for shared APPL_TOP, RAC and new vars
##
Begin_Pre
SectionPrint "Classpath in jserv.properties"
if [ "${IAS_CONFIG_HOME}" = "" -a "${APACHE_TOP}" = "" ]; then
Tab1Print "Unable to determine classpath because IAS_CONFIG_HOME and APACHE_TOP
are not set"
End_Pre
else
my_Jserv="${IAS_CONFIG_HOME}/Apache/Jserv/etc/jserv.properties"
if [ ! -f "${my_Jserv}" ]; then
my_Jserv="${IAS_ORACLE_HOME}/Apache/Jserv/etc/jserv.properties"
if [ ! -f "${my_Jserv}" ]; then
my_Jserv="${APACHE_TOP}/../Jserv/etc/jserv.properties"
fi
fi
if [ -f "${my_Jserv}" ]; then
files=`cat ${my_Jserv} | grep wrapper.classpath | grep -v "^#" | sed
's#\\\#/#g' | awk -F= '{print $2}'`
Log "$files"
RESULT_LIST=""
RESULTS="True"
case ${1} in
SILENT|silent)
if [ "${RESULT_LIST}" != "" ]; then
RESULTS="False"
export RESULTS
RESULT_LIST=`echo ${RESULT_LIST} |sed 's/ /,/g'`
export RESULT_LIST
fi
;;
*)
if [ "${RESULT_LIST}" != "" ]; then
End_Pre
WarningPrint "The following files and/or directories are not valid"
for file in $RESULT_LIST
do
Plain_WarningPrint "${SPACE}${SPACE}${file}"
done
ActionWarningPrint "Modify the jserv.properties to either delete these,
or fix the entries"
Plain_WarningPrint "(${my_Jserv})"
echo ""
RESULTS="False"; export RESULTS
RESULT_LIST=`echo ${RESULT_LIST} |sed 's/ /,/g'`; export RESULT_LIST
else
SuccessPrint "The CLASSPATH is valid"
End_Pre
fi
;;
esac
else
Tab1Print "Unable to find the jserv.properties in common locations therefore
unable to check the classpath inside it"
End_Pre
fi
fi
} ### End Procedure Validate_ClassPath ###
Show_Metalink ()
{
##
## Procedure Name: Show_Metalink
##
## Usage:
## SomePrintProc "blabla `Show_Metalink <notenr> [NOHEADER]`"
##
## Parameters:
## notenr : link to note number to display
## NOHEADER : no "refer to" part (optional)
##
## Description:
## Display metalink link to $1 using Show_Link
##
## Examples:
## Tab1Print "`Show_Metalink 130091.1`"
##
## Returns:
## None
##
## Version History:
## 1.01 27-APR-2004 dbezemer Initial Creation
## 1.02 04-JUN-2004 dbezemer Added option for "refer to"; more notes
## 1.03 06-OCT-2004 sciobanu Added more notes
## 29-OCT-2004 dbezemer Added more notes
## 1.11 14-JUL-2005 svarga Initcap "note" in reference section
## 115.7 15-DEC-2005 svarga Merged from 4 tests and put into the core,
## added note 332152.1
## 115.20 14-MAR-2007 dbezemer Added note 165195.1
## 115.24 30-MAY-2007 dbezemer Added many notes from different tests; ordered them
## 115.25 21-JUN-2007 dbezemer Add one more note
##
NOTEID="${1}"
case "${NOTEID}" in
"33755.1")
DESCRIPTION=" - PACKAGE UTL_FILE Specification"
;;
"104692.1")
DESCRIPTION=" - Setup and Usage (Report Review Agent)"
;;
"108865.1")
DESCRIPTION=" - How To Create a Database Connection(DBC) File and
Troubleshooting Common Problems"
;;
"119322.1")
DESCRIPTION=" - How To Share The Digital Certificate On Multiple Applications
11i Instances"
;;
"111383.1")
DESCRIPTION=" - The Basics About Report Review Agent (FNDFS) on 11i"
;;
"113105.1")
DESCRIPTION=" - 11i: Unable to Access Personal Home Page from Portal Page"
;;
"113947.1")
DESCRIPTION=" - Step by Step Troubleshooting Guide to Solve APPS Invalid
Objects"
;;
"117012.1")
DESCRIPTION=" - Troubleshooting the \"Error Occurred While Attempting to
Establish an Applications File Server Connection\""
;;
"119326.1")
DESCRIPTION=" - Setup of Apache Server With Mod JServ for Rel 11i Foundation
(FND/JTF/CRM)"
;;
"119873.1")
DESCRIPTION=" - Apache Single Listener Configuration for Applications 11.5.1"
;;
"123718.1")
DESCRIPTION=" - 11i: A Guide to Understanding and Implementing SSL for Oracle
Applications"
;;
"124606.1")
DESCRIPTION=" - Upgrading Jinitiator with Oracle Applications 11i"
;;
"125767.1")
DESCRIPTION=" - Upgrading Developer 6i with Oracle Applications 11i"
;;
"130091.1")
DESCRIPTION=" - Upgrading to JDK 1.3 with Oracle Applications 11i"
;;
"131133.1")
DESCRIPTION=" - Additional Apache Single Listener Steps For AIX 11.5.X"
;;
"132204.1")
# to be replaced by 268003.1 ?
DESCRIPTION=" - Business Intelligence System (BIS) and Daily Business
Intelligence (DBI) Install & Implementation"
;;
"132624.1")
DESCRIPTION=" - Oracle Business Intelligence System Documentation"
;;
"134378.1")
DESCRIPTION=" - Troubleshooting iHelp"
;;
"135992.1")
DESCRIPTION=" - Jinitiator / Macintosh Client Connections"
;;
"139516.1")
DESCRIPTION=" - Discoverer 4i with Oracle Applications 11i"
;;
"139863.1")
DESCRIPTION=" - Configuring and Troubleshooting the Self Service Framework
with Oracle Applications"
;;
"143993.1")
DESCRIPTION=" - How to Set Up Report Review Agent (FNDFS) for Applications
11.5"
;;
"144069.1")
DESCRIPTION=" - Upgrading to Oracle Workflow 2.6 with Oracle Applications
11i"
;;
"146469.1")
DESCRIPTION=" - Configuring Oracle Applications 11i With Oracle Portal"
;;
"148971.1")
DESCRIPTION=" - How To Set 9iAS Listener, JServ, and PL/SQL Logs for
Debugging"
;;
"149404.1")
# to be replaced by 267941.1 ?
DESCRIPTION=" - Oracle Embedded Data Warehouse"
;;
"153292.1")
DESCRIPTION=" - How To Create DBC File in Oracle Applications 11.5"
;;
"152728.1")
DESCRIPTION=" - Upgrading to Java Developer's Kit (JDK) 1.3 W/ Oracle Apps
SSFW Technology"
;;
"153960.1")
DESCRIPTION=" - FAQ: X Server testing and troubleshooting"
;;
"161779.1")
DESCRIPTION=" - Upgrading Oracle HTTP Server in Applications 11i"
;;
"162488.1")
DESCRIPTION=" - Complete Guide to Jinitiator Setup & Troubleshooting for
Oracle Applications 11i"
;;
"162701.1")
DESCRIPTION=" - Which port is used by the JServ processes?"
;;
"165195.1")
DESCRIPTION=" - Using AutoConfig to Manage System Configurations with Oracle
Applications 11i"
;;
"169935.1")
DESCRIPTION=" - Troubleshooting Oracle Applications Performance Issues"
;;
"170617.1")
DESCRIPTION=" - Unable to Login to Oracle Applications Personal Home Page
After 8.1.7.2 Upgrade"
;;
"174820.1")
DESCRIPTION=" - You are continually prompted to install Jinitiator using the
view diagram button with workflow 2.6"
;;
"177095.1")
DESCRIPTION=" - Configuring and Troubleshooting the Self Service Framework
5.5.2 with 11i"
;;
"177250.1")
DESCRIPTION=" - Troubleshooting Generic Service Manager Problems"
;;
"178437.1")
DESCRIPTION=" - Troubleshooting Login"
;;
"181244.1")
DESCRIPTION=" - Configuring VNC Or XVFB As The X Server For Applications 11i"
;;
"184876.1")
DESCRIPTION=" - Diagnostic Test (SA): FND - Middle (Web) Tier Verification"
;;
"186247.1")
DESCRIPTION=" - Configuring and Troubleshooting the Self Service Framework
5.6 with Oracle Applications 11.5.7"
;;
"186655.1")
DESCRIPTION=" - JBO-26028 Error when Clicking on Create New Expense Report"
;;
"200360.1")
DESCRIPTION=" - Diagnostic Test (SA): FND - Concurrent Manager Diagnostic"
;;
"200873.1")
DESCRIPTION=" - ALERT: Security Vulnerability in Apache HTTP Server of
Oracle9iAS"
;;
"204090.1")
DESCRIPTION=" - Generic Service Management"
;;
"207670.1")
DESCRIPTION=" - Diagnostic Test (SA): FND - (OA) FrameWork Setup"
;;
"211650.1")
DESCRIPTION=" - Troubleshooting e-Bis Reporting"
;;
"213359.1")
DESCRIPTION=" - Balanced Scorecard Release notes and readme's"
;;
"216205.1")
DESCRIPTION=" - Database Initialization Parameters for Oracle Applications
11i"
;;
"225947.1")
DESCRIPTION=" - About Oracle Workflow Mini-pack 11i.OWF.G"
;;
"231137.1")
DESCRIPTION=" - Troubleshooting the Self Service Framework with Oracle
Applications"
;;
"231286.1")
DESCRIPTION=" - Configuring the Oracle Workflow 2.6 Java-based Notification
Mailer with Oracle Applications 11i"
;;
"232313.1")
DESCRIPTION=" - Information on Previous Versions of Developer 6i Patchsets"
;;
"235307.1")
DESCRIPTION=" - OSS Application Diagnostics Tools: FAQ and Troubleshooting
Guide"
;;
"241370.1")
DESCRIPTION=" - Concurrent Manager Setup and Configuration Requirements in an
11i RAC Environment"
;;
"242941.1")
DESCRIPTION=" - How to Troubleshoot Java-based Workflow Notification Mailer
in 11.5.9 and OWF.G"
;;
"244040.1")
DESCRIPTION=" - Oracle E-Business Suite Recommended Performance Patches"
;;
"244274.1")
DESCRIPTION=" - Diagnostic Test (SA): FND - Generic Service Management (GSM)
Setup"
;;
"246105.1")
DESCRIPTION=" - Upgrading to J2SE 1.4.2 with Oracle Applications 11i"
;;
"260559.1")
DESCRIPTION=" - E-Business Suite Alert: Verisign CA Certificates Expire
January 7, 2004"
;;
"268274.1")
DESCRIPTION=" - How To Configure The Workflow Java Mailer Without An IMAP
Account (Assumes No Inbound Processing)"
;;
"269138.1")
DESCRIPTION=" - Oracle Applications Framework Developer's Guide"
;;
"275874.1")
DESCRIPTION=" - Oracle Applications Framework Configuration Notes Release 11i
(11.5.10)"
;;
"276720.1")
DESCRIPTION=" - Set Up the New Status Monitor with the Old Find Processes
Functions"
;;
"290807.1")
DESCRIPTION=" - Upgrading Sun J2SE (Native Plug-in) with Oracle Applications
11i for Windows Clients"
;;
"304099.1")
DESCRIPTION=" - Using J2SE Version 5.0 with Oracle E-Business Suite 11i,
Release 11.5.10"
;;
"332152.1")
DESCRIPTION=" - OWF H Diagnostics and Solutions"
;;
"416499.1")
DESCRIPTION=" - How To Upgrade JDK 1.5 / J2SE 5.0 Sub-Versions"
;;
*)
DESCRIPTION=""
;;
esac
CONFLIST=""
ListIncludes ()
{
##
## Small procedure to list ALL conf files used for apache configuration
## This is done recursively. Basically just searching for 'include' on the left of
## the line and checking that file also for more includes.
##
## Result: CONFLIST - a list of .conf files included by the original one ($1)
##
## 115.7 15-DEC-2005 svarga Copied to the core from FNDNCAInstVerify115.sh 115.6
##
CONFLIST="$CONFLIST $1"
for file in `cat $1 | grep "^include" | sed 's#\\\\#/#g'| awk '{print $2}' | sed
's/\"//g'`
do
eval ListIncludes $file
done
FindVirtualDir ()
{
## Procedure Name: FindVirtualDir
##
## Usage:
## FindVirtualDir {Apache conf file} {virtual dirname} [var to store result in]
##
## Parameters:
## $1 - Apache conf file
## $2 - virtual directory name to look for
## $3 - environment variable to store the result (optional)
##
## Examples:
## FindVirtualDir $APACHE_TOP/conf/httpd.conf OA_JAVA OA_JAVA_DIR
##
## Returns:
## - set third as variable on environment and set DIRFOUND to the same.
## - set FOUNDINFILE to the file in which the setting was found
##
## Version History:
## 1.01 05-FEB-2004 dbezemer initial release
## 1.02 01-NOV-2004 dbezemer also return the conf file which contained the setting
## 115.7 15-DEC-2005 svarga Copied to the core from FNDFrameWorkSetup115.sh
115.3
##
CONFFILE=${1}
DIR2FIND=${2}
VAR2SET=${3}
Check_Directory ()
{
##
## Procedure Name: Check_Directory
##
## Usage:
## Check_Directory <directory> [{OWNER}|GROUP|OTHER]
##
## Parameters:
## $1 - directory
## $2 - Which permissions to check
##
## Examples:
## Check_Directory .../Apache/Apache/conf/ OWNER
##
## Returns:
## Nothing
##
## Version History:
## 1.0 04-MAY-2004 dbezemer initial release
## 115.7 15-DEC-2005 svarga Copied to the core from FNDFrameWorkSetup115.sh
115.3
##
WHO=${2:="OWNER"}
# For Windows NT only need to check for rw-. The x in rwx check can also be rwc
# if the file / directory is compressed.
# For UNIX the 'x' check is needed to write and list the directory contents.
if [ "${OS_NAME}" = "Windows_NT" ]; then
PERMISSION="rw-"
else
PERMISSION="rwx"
fi
GetLangs ()
{
##
## Procedure Name: GetLangs
##
## Usage:
## GetLangs
##
## Parameters:
## none
##
## Description:
## Get the languages of the current environment (base and installed)
##
## Examples:
## GetLangs
##
## Returns:
## INST_LANG : list of language codes
##
## Version History:
## 1.01 22-JAN-2004 dbezemer copied from ACT
## 1.02 22-JAN-2004 dbezemer added comments
## 10-MAR-2004 dbezemer Added 'order by' to get base language first in list
## 115.7 15-DEC-2005 svarga Copied to the core from FNDFlexfieldDiag115.sh 115.5
##
# We need to put space behind Installed languages because we can have more then
one
# Otherwise the INST_LANG will concatenate all abbreviations of installed langs.
EncString ()
{
##
## Procedure: EncString
##
## Usage:
## EncString "txt"
##
## Parameters:
## $1 - String to deal with
##
## Description:
## N/A
##
## Example:
## N/A
##
## Returns:
## N/A
##
## Notes:
## Please contact the test developers for detailed documentation
##
## Version History:
## 1.07 28-MAY-2004 svarga Inital release
## 115.7 15-DEC-2005 svarga Copied to the core from FNDFlexfieldDiag115.sh 115.5
##
DecString ()
{
##
## Procedure: DecString
##
## Usage:
## DecString "txt"
##
## Parameters:
## $1 - String to deal with
##
## Description:
## N/A
##
## Example:
## N/A
##
## Returns:
## N/A
##
## Notes:
## Please contact the test developers for detailed documentation
##
## Version History:
## 1.07 28-MAY-2004 svarga Inital release
## 115.7 15-DEC-2005 svarga Copied to the core from FNDFlexfieldDiag115.sh 115.5
##
Table_Begin ()
{
##
## Procedure Name: Table_Begin
##
## Usage:
## Table_Begin
##
## Parameters:
## None
##
## Description:
## If output is for HTML, spool HTML commands to start HTML table
## to file called ${Table_File}.htm
##
## Examples:
## Table_Begin
##
## Returns:
## Nothing
##
## Version History:
## 1.01 10-OCT-2002 dbezemer initial release
## 1.02 27-JAN-2004 dbezemer Removal of width
## 115.7 15-DEC-2005 svarga Copied to the core from FNDFlexfieldDiag115.sh 115.5
##
if [ "$internal_output" = "html" ]; then
## Start HTML table
def_color=${color:=#CCFFFF}; export def_color
border=${size:=5}; export border
Table_Header ()
{
##
## Procedure Name: Table_Header
##
## Usage:
## Table_Header {len1} {value1} [... {lenn} {valuen}]
##
## Parameters:
## $1 : length to reserve for column 1
## $2 : field/column 1 of header row
## ...
## $n-1: length to reserve for column m
## $n : field/column m of header row
##
## Description:
## Spool row to output file ${Table_File). For HTML the TH is used
## to explicitly show this is the header of the HTML table.
## For text use the length to align the data.
##
## Examples:
## Table_Header 30 "Name" 10 "Data"
##
## Returns:
## Nothing
##
## Version History:
## 1.01 10-OCT-2002 dbezemer initial release
## 1.02 07-JUL-2003 dbezemer Add 'tee -a' after printing newline
## 1.03 15-OCT-2003 dbezemer improve text output with length args
## 1.06 08-MAR-2004 svarga Replaced echo with $ECHO (linux issue),
## aligned API header
## 115.7 15-DEC-2005 svarga Copied to the core from FNDEBIDiagnostic115.sh 115.3
##
nrargs=$#
if [ "$internal_output" != "html" ]; then
cnt=1
while [ $cnt -lt $nrargs ]
do
len=`eval "$ECHO \\\$$cnt"`
cnt=`expr $cnt + 1`
str=`eval "$ECHO \\\$$cnt"`
cnt=`expr $cnt + 1`
printf "%-${len}s" "$str" | tee -a ${Table_File}.txt
done
if [ $cnt -eq $nrargs ]; then
str=`eval "$ECHO \\\$$cnt"`
printf "$str" | tee -a ${Table_File}.txt
fi
printf "\n" | tee -a ${Table_File}.txt
else
cnt=2
printf "<TR>" | tee -a ${Table_File}.htm
while [ $cnt -le $nrargs ]
do
str=`eval "$ECHO \\\$$cnt"`
printf "<TH id=\"col${cnt}\">${str}</TH>" | tee -a ${Table_File}.htm
cnt=`expr $cnt + 2`
done
$ECHO "</TR>\n" | tee -a ${Table_File}.htm
fi
Table_Row ()
{
##
## Procedure Name: Table_Row
##
## Usage:
## Table_Row 30 "db_block_buffers" 10 "4000"
##
## Parameters:
## $1 : length to reserve for column 1
## $2 : field/column 1 of row
## ...
## $n-1: length to reserve for column m
## $n : field/column m of row
##
## Description:
## Spool row to output file ${Table_File). For HTML, use the HTML
## commands, for text, use the lengths to align the columns.
##
## Examples:
## Table_Row 30 "db_block_buffers" 10 "9000"
##
## Returns:
## Nothing
##
## Version History:
## 1.01 10-OCT-2002 dbezemer initial release
## 1.02 07-JUL-2003 dbezemer Add 'tee -a' after printing newline
## 1.03 15-OCT-2003 dbezemer improve text output with length args
## 1.06 08-MAR-2004 svarga Replaced echo with $ECHO (linux issue)
## 115.7 15-DEC-2005 svarga Copied to the core from FNDEBIDiagnostic115.sh 115.3
##
nrargs=$#
if [ "$internal_output" != "html" ]; then
cnt=1
while [ $cnt -lt $nrargs ]
do
len=`eval "$ECHO \\\$$cnt"`
cnt=`expr $cnt + 1`
str=`eval "$ECHO \\\$$cnt"`
cnt=`expr $cnt + 1`
printf "%-${len}s" "$str" | tee -a ${Table_File}.txt
done
if [ $cnt -eq $nrargs ]; then
str=`eval "$ECHO \\\$$cnt"`
printf "$str" | tee -a ${Table_File}.txt
fi
printf "\n" | tee -a ${Table_File}.txt
else
cnt=2
printf "<TR>" | tee -a ${Table_File}.htm
while [ $cnt -le $nrargs ]
do
str=`eval "$ECHO \\\$$cnt"`
printf "<TD>$str</TD>" | tee -a ${Table_File}.htm
cnt=`expr $cnt + 2`
done
$ECHO "</TR>\n" | tee -a ${Table_File}.htm
fi
Table_End ()
{
##
## Procedure Name: Table_End
##
## Usage:
## Table_End
##
## Parameters:
## None
##
## Description:
## For HTML, close the table
##
## Examples:
## Table_End
##
## Returns:
## Nothing
##
## Version History:
## 1.01 10-OCT-2002 dbezemer initial release
## 115.7 15-DEC-2005 svarga Copied to the core from FNDEBIDiagnostic115.sh 115.3
##
INITParameter_Row ()
{
##
## Procedure Name: INITParameter_Row
##
## Usage:
## INITParameter_Row {db parameter} [recommended value]
##
## Parameters:
## $1 : init.ora parameter
## $2 : recommended value
##
## Description:
## Get the v$parameter value from the database and print it in a table
##
## Examples:
## INITParameter_Row "db_block_buffers" "4000"
##
## Returns:
## Nothing
##
## Version History:
## 1.01 15-OCT-2003 dbezemer initial release
## 115.7 15-DEC-2005 svarga Copied to the core from FNDEBIDiagnostic115.sh 115.3
##
param="$1"
Get_Curr_Parameter_Value "$param"
Table_Row 35 "$param" 17 "$Value" 17 "$recval"
Get_Curr_Parameter_Value ()
{
##
## Procedure Name: Get_Curr_Parameter_Value
##
## Usage:
## Get_Curr_Parameter_Value {parameter}
##
## Parameters:
## 1: v$parameter to query
##
## Description:
## Get the value of a specific parameter from v$parameter
##
## Examples:
## Get_Curr_Parameter_Value "db_block_buffers"
##
## Returns:
## Nothing
##
## Version History:
## 1.01 10-DEC-2002 dbezemer initial release
## 1.09 03-FEB-2005 dbezemer make query case insensitive
## 115.7 15-DEC-2005 svarga Copied to the core from FNDEBIDiagnostic115.sh
115.3,
## modified to use SQL
##
Get_DB_Value ()
{
##
## Procedure Name: Get_DB_Value
##
## Usage:
## Get_DB_Value
##
## Parameters:
## None
##
## Description:
## Execute the statement in "$SQL" and store the result in variable 'Value'
##
## Examples:
## Get_DB_Value
##
## Returns:
## Value : The value returned by the SQL
##
## Version History:
## 1.01 10-DEC-2002 dbezemer initial release
## 1.02 27-APR-2004 dbezemer Use $SQL instead of $1
## 115.7 15-DEC-2005 svarga Copied to the core from WFJavaMailerSetup115.sh
115.5
##
Value=`$SQLPLUS -s <<Zen
$SQL_Login_Password
set heading off
set feedback off
set pagesize 0
${SQL}
Zen
`
Display_Profile_Values ()
{
##
## Procedure Name: Display_Profile_Values
##
## Usage:
## Display_Profile_Values {Profile Name}
##
## Parameters:
## 1 - Profile Name
##
## Description:
## Displays Profile Name and Value at User, Responsibility and Application Level
##
## Examples:
## Display_Profile_Values BIS%
##
## Returns:
## RECORDS_RETURNED_COUNT: number of records retrieved
##
## Version History:
## 1.01 10-DEC-2002 nmodi initial release
## 1.02 08-JAN-2003 dbezemer Added "trimspool on" to SQL statement
## 1.11 14-JUL-2005 svarga Changed Profile Name to Profile Option Name
## 115.7 15-DEC-2005 svarga Copied to the core from FNDEBIDiagnostic115.sh 115.3
##
Get_APPS_Context_Value ()
{
##
## Procedure Name: Get_APPS_Context_Value
##
## Usage:
## Get_APPS_Context_Value <context variable> VERBOSE|SILENT
##
## Parameters:
## $1 - Context Variable
## $2 - Output options: VERBOSE|SILENT
##
## Description:
## Get APPS context variable value
## This API is not in use anymore, please use Get_AutoConfig_Value (call
Check_Node first)
##
## Examples:
## Get_APPS_Context_Value s_platform VERBOSE
##
## Returns:
## CTX_VALUE - The value of the variable or empty string
## CTX_FILE - The APPS context file location
## CTX_NAME - The APPS context name
## Version History:
## 1.0 sciobanu Initial Release
## 115.7 15-DEC-2005 svarga Copied to the core from ADJinitDiag115.sh 115.3,
## using BNAME
## 115.13 29-JUN-2006 svarga Obsoleting this API
##
else
#Determine the context file from adautocfg
if [ "${OS_NAME}" = "Windows_NT" ]; then
ADAUTOCFG="adautocfg.cmd"
else
ADAUTOCFG="adautocfg.sh"
fi
if [ -r ${OAD_TOP}/admin/scripts/${APPS_DBSID}_${BNAME}/${ADAUTOCFG} ]; then
ADAUTOCFG_FILE=${OAD_TOP}/admin/scripts/${APPS_DBSID}_${BNAME}/${ADAUTOCFG}
elif [ -r ${OAD_TOP}/admin/scripts/${APPS_DBSID}/${ADAUTOCFG} ]; then
ADAUTOCFG_FILE=${OAD_TOP}/admin/scripts/${APPS_DBSID}/${ADAUTOCFG}
elif [ -r ${OAD_TOP}/admin/scripts/${ADAUTOCFG} ]; then
ADAUTOCFG_FILE=${OAD_TOP}/admin/scripts/${ADAUTOCFG}
else
ADAUTOCFG_FILE=""
fi
GetPosition ()
{
##
## Procedure Name: GetPosition
##
## Usage:
## GetPosition <PATH> <ENTRY> [EXACT|{NOTEXACT}]
##
## Parameters
## 1 : PATH
## 2 : value to look for
## 3 : does this need to be an EXACT match
##
## Description:
## Return the position and full entry for which the compare was successful
## based on ENVPATHSEP (: or ;) variable which needs to be set before
## calling the API
##
## Examples:
## GetPosition "$PATH" "/usr/bin"
## GetPosition "$CLASSPATH" "dt.jar"
##
## Return
## Print out the entry number and complete value in $1
##
## Version History:
## 1.01 27-APR-2004 dbezemer initial release
## 115.7 15-DEC-2005 svarga Copied to the core from WFJavaMailerSetup115.sh
115.5
##
CheckEntryOrder ()
{
##
## Procedure Name: CheckEntryOrder
##
## Usage:
## CheckEntryOrder
##
## Parameters
## 1 : entry1
## 2 : entry2
## 3 : entry1 position
## 4 : entry2 position
##
## Description:
## The entry for $1 (which is #$3) needs to be before $2 (entry #$4). If
## this is not the case this procedure will print an error.
##
## Examples:
## CheckEntryOrder "Entry 1" "Entry 100" 1 100
## CheckEntryOrder "Entry 11" "Entry 10" 11 10
##
## Returns:
## Nothing
##
## Version History:
## 1.01 27-APR-2004 dbezemer initial release
## 115.7 15-DEC-2005 svarga Copied to the core from WFJavaMailerSetup115.sh
115.5
##
## NOTE:
## Not printing a message about a file when it does not exist.
## (In this case $3 or $4 is empty)
##
DisplayPatches ()
{
## Procedure Name: DisplayPatches
##
## Usage:
## DisplayPatches Type Module PatchList
##
## Parameters:
## $1 - Type
## $2 - Module
## $3 - PatchList to look for
## $4 - Output options VERBOSE (default) or SILENT
## $5 - Section title (optional and not needed in SILENT mode)
## ${PATCHLISTS_FILE} - File where patch lists are stored
##
## Description:
## Check if patches from the list are applied and display the latest
## patch (need to be first in the list)
##
## Examples:
## DisplayPatches "patchset" "FND Data Security" FND_SECURITY_PATCH_LIST
## DisplayPatches "patchset" "AD" "AD_PATCH_LIST"
##
## Returns:
## None.
##
## Notes:
## None.
##
## Version History:
## 1.24 09-DEC-2004 svarga Replaces greps with $GREPs and using temporary
files
## to work on NT as well (to avoid broken pipe error)
## 1.25 28-OCT-2005 dbezemer From now on assume xml file to get version info
## 115.7 15-DEC-2005 svarga Copied to the core from ACT.sh 115.7, several
modifications
## 115.8 10-FEB-2006 svarga Warning message when patch list file does not exist
## 115.20 06-MAR-2007 dbezemer Minor update to comments
## 115.25 19-JUN-2007 dbezemer fix issue on Solaris with 'head' and broken pipe
##
# Process part
PATCHLISTNAME=${3}
if [ ! -f "${PATCHLISTS_FILE}" ]; then
ANY_PATCH_FOUND="FILE NOT EXIST"
else
# find start line
STARTLINE=`$GREP -n "\"${PATCHLISTNAME}\"" ${PATCHLISTS_FILE} | $GREP -i "pack
id" | awk -F: '{print $1}'`
if [ "${STARTLINE}" = "" ]; then
ANY_PATCH_FOUND="NO FILE"
else
ANY_PATCH_FOUND="NO"
STARTLINE=`expr $STARTLINE + 1`
TMP_PATCHLIST_FILE="tmp_patchlist$$.tmp"
head -${ENDLINE} ${PATCHLISTS_FILE} | tail +${STARTLINE} | \
${AWK} 'BEGIN { started = 0; }
{
if (index($0,"<patchset>") != 0) {
started = 1;
}
if (index($0,"</patchset>") != 0) {
printf("%s?%s?\"%s\"\n", seq, num, name);
started = 0;
}
if (index($0,"<sequence>") != 0) {
startpos = index($0,">")+1;
seq = substr($0,startpos);
endpos = index(seq,"<") - 1;
seq = substr($0,startpos,endpos);
}
if (index($0,"<number>") != 0) {
startpos = index($0,">")+1;
num = substr($0,startpos);
endpos = index(num,"<") - 1;
num = substr($0,startpos,endpos);
}
if (index($0,"<name>") != 0) {
startpos = index($0,">") + 1;
name = substr($0,startpos);
endpos = index(name,"<") - 1;
name = substr($0,startpos,endpos);
}
}' > ${TMP_PATCHLIST_FILE}
# Output part
if [ "${ANY_PATCH_FOUND}" = "FILE NOT EXIST" ]; then
Begin_Pre
End_Pre
WarningPrint "${PATCHLISTS_FILE} not found"
ActionWarningPrint "Ensure that the file exist under the \$IZU_TOP/html
directory or \
in the html directory one directory above the starting directory of the test"
else
if [ "${4}" != "SILENT" ]; then
if [ "${5}" != "" ]; then
Begin_Pre
SectionPrint "${5}"
fi
if [ "${ANY_PATCH_FOUND}" = "NO FILE" ]; then
Tab1Print "Patch list ${PATCHLISTNAME} cannot be located in the file $
{PATCHLISTS_FILE}"
elif [ "${ANY_PATCH_FOUND}" = "NO" ]; then
Tab1Print "No known ${2} ${1} is installed"
else
Tab1Print "${pn} (${patch_name}) ${1} is installed"
fi
if [ "${5}" != "" ]; then
End_Pre
fi
fi
fi
Get_AutoConfig_Value ()
{
##
## Usage:
## Get_AutoConfig_Value <oa_var Setting> [type] [nr of matches]
##
## Parameters:
## Setting - echo the value for this setting
## Type - search for the setting under this type
## Matches - number of matches to return
##
## Description:
## Echo the value of this setting from the autoconfig xml file
##
## Examples:
## Value=`Get_AutoConfig_Value webhost`
## Value=`Get_AutoConfig_Value s_apcctrl apache_pls`
##
## Returns:
## Nothing
##
## Notes:
## Echos the value
## config_file must be set
##
## Version History:
## 115.9 29-MAR-2006 dbezemer Initial Release
## 115.13 29-JUN-2006 svarga Replacing CONTEXT_FILE with config_file
## 115.17 26-SEP-2006 dbezemer fix comment
## 115.20 12-MAR-2007 dbezemer Always convert \ to / (for paths on Windows)
## 115.24 31-MAY-2007 dbezemer Make sure only one entry is returned and add
possibility to
## specify the type (first look for the section type
value)
##
${AWK} 'BEGIN {
search="oa_var=\"'${1}'\"";
section="'${2}'";
if (length(section) == 0) {
sectionfound=true;
}
else {
sectionfound=false;
section="type=\"'${2}'\"";
}
}
{
line=$0;
if (sectionfound == true) {
i = index(line,search);
if (i > 0) {
pos1=index(line,">")+1;
tmp=substr(line,pos1);
pos2=index(tmp,"<")-1;
res=substr(line,pos1,pos2);
gsub("\\\\","/",res);
print res;
}
}
else {
i = index(line,section);
if (i > 0) {
sectionfound=true;
}
}
}' ${config_file} | head -${NRMATCHES}
fi
# From 11.5.9 and above the jserv.properties uses java.sh for starting up the
jserv.
# However, Windows NT does not use this and still contains the java executable.
if [ "${OS_NAME}" != "Windows_NT" ]; then
Compare_Values "$APPS_VERSION" "-gt" "11.5.8"
if [ "${ANSWER}" = "True" -o "`echo ${JVM} | grep 'java\.sh'`" != "" ]; then
JVM=`grep "JSERVJAVA=" ${JVM} | grep -v "^#" | awk -F"=" '{print $2}'`
fi
fi
fi
Get_DBC_Filename ()
{
##
## Usage:
## Get_DBC_Filename [{SILENT}|VERBOSE]
##
## Parameters:
## 1 - SILENT : environment vars will be set
## VERBOSE : As silent but also message will be shown
##
## Description:
## Determines the DBC filename in use in the current environment
##
## Examples:
## Get_DBC_Filename
##
## Returns:
## DBC_FOUND_VALUE - set on environment
## FND_SECURE - env setting of directory containing DBC file
## FOUND_DBC - y or n
##
## Notes:
## None.
##
## Version History:
## 115.9 29-MAR-2006 dbezemer Initial Release
## 115.11 11-APR-2006 dbezemer Add FND_SECURE directory
## 115.20 06-MAR-2007 dbezemer Minor update to comments
## 115.21 04-MAY-2007 svarga Fix BUG 6031245
## 115.22 08-MAY-2007 svarga Typo fix
##
# Process
# Try getting dbc filename (and dbc directory) directly from autoconfig xml file
DBC_FOUND_VALUE=`Get_AutoConfig_Value s_dbc_file_name`.dbc
FND_SECURE=`Get_AutoConfig_Value s_fnd_secure`
Log "Value=${Value}"
Log "MACHINE=${MACHINE}"
Log "S_DBSIDLOWER=${APPS_DBSID}"
Log "FND_SECURE=${FND_SECURE}"
Log "DBC_FOUND_VALUE=${DBC_FOUND_VALUE}"
Log "TWO_TASK=${TWO_TASK}"
Log "LOWER_SID=${LOWER_SID}"
Log "UPPER_SID=${UPPER_SID}"
# In case the setting is not in xml file, set the default to FND_TOP/secure
if [ "${FND_SECURE}" = "" ]; then
FND_SECURE="${FND_TOP}/secure"
fi
# In case the dbc filename is mentioned in the XML file, it is already known.
# Otherwise, see if it can be found.
if [ "${DBC_FOUND_VALUE}" = ".dbc" ]; then
if [ -f ${FND_SECURE}/${MACHINE}_${APPS_DBSID}.dbc ]; then
DBC_FOUND_VALUE=${MACHINE}_${APPS_DBSID}.dbc
elif [ -f ${FND_SECURE}/${MACHINE}_${TWO_TASK}.dbc ]; then
DBC_FOUND_VALUE=${MACHINE}_${TWO_TASK}.dbc
elif [ -f ${FND_SECURE}/${MACHINE}_${LOWER_SID}.dbc ]; then
DBC_FOUND_VALUE=${MACHINE}_${LOWER_SID}.dbc
elif [ -f ${FND_SECURE}/${MACHINE}_${UPPER_SID}.dbc ]; then
DBC_FOUND_VALUE=${MACHINE}_${UPPER_SID}.dbc
else
DBC_FOUND_VALUE=""
fi
fi
export DBC_FOUND_VALUE
# Output
Get_Apache_Configfile ()
{
##
## Usage:
## Get_Apache_Configfile
##
## Parameters:
## None
##
## Description:
## Determines the configuration filename for Apache
##
## Examples:
## Get_Apache_Configfile
##
## Returns:
## fullhttpfile - complete path and filename to apache config file
## httpfile - Usually httpd or httpds (from httpd.conf)
## APACHE_TOP_FOUND - True or False
##
## Notes:
## Requires OS_NAME, APACHE_TOP to be set
##
## Version History:
## 115.9 29-MAR-2006 dbezemer Initial Release
## 115.20 14-MAR-2007 dbezemer fixes for shared appl_top
##
# Get the httpfile from the parameters (after '-f' on command line)
fullhttpfile=`echo $APACHE_STARTUP_CMD | awk '{ line=$0; x=index(line,"-f")
+2; while (substr(line,x,1)==" ") x++; y=index(line,".conf")+5-x;
ret=substr(line,x,y); print ret; }'`
httpfile=`echo $fullhttpfile | awk -F"/" '{ print $NF }' | sed
's/\.conf//g'`; export httpfile
APACHE_STARTUP=`Get_AutoConfig_Value s_apcctrl`
if [ "${APACHE_STARTUP}" != "" -a -r "${APACHE_STARTUP}" ]; then
fullhttpfile=`grep "APACHECONF=" ${APACHE_STARTUP} | awk -F"=" '{ print
$2 }'`
httpfile=`echo $fullhttpfile | awk -F"/" '{ print $NF }' | sed
's/\.conf//g'`
APACHE_TOP_FOUND="True"
export APACHE_TOP_FOUND httpfile fullhttpfile
fi
fi
# Second, try to get it from the apachectl but latest templates have multiple
# HTTPD entries based on techstack variable. Need to take the right one.
if [ "${fullhttpfile}" = "" ]; then
if [ -r ${config_file} ]; then
S_TECHSTACK=`Get_AutoConfig_Value s_techstack`
case ${S_TECHSTACK} in
ias1022) GREP_ENTRY=1
;;
http1312) GREP_ENTRY=2
;;
*) GREP_ENTRY=3
;;
esac
else
# No XML file. We will take the first entry
GREP_ENTRY=1
fi
Log "APACHE_TOP=${APACHE_TOP}"
if [ -f ${APACHE_TOP}/bin/apachectl ]; then
httpfile=`cat $APACHE_TOP/bin/apachectl | grep "^[ ]*HTTPD" | head -$
{GREP_ENTRY} | tail -1 |
awk -F'/' '{printf("%s\n",$NF);}' | sed 's/\"//g'`; export
httpfile
fullhttpfile="$APACHE_TOP/conf/${httpfile}.conf"
APACHE_TOP_FOUND="True"; export APACHE_TOP_FOUND
else
APACHE_TOP_FOUND="False"; export APACHE_TOP_FOUND
fi
fi
fi
Log "FULLHTTP = ${fullhttpfile}"
Log "HTTP = ${httpfile}"
DUMMY ()
{
##
## Usage:
##
##
## Parameters:
## None
##
## Description:
## Template for new functions/procedures
##
## Examples:
##
##
## Returns:
##
##
## Notes:
## None.
##
## Version History:
## 115.9 29-MAR-2006 dbezemer Initial Release
##
echo "DUMMY"
DisplayNodesInformation ()
{
##
## Usage:
## DisplayNodesInformation
##
## Parameters:
## None
##
## Description:
## Display nodes information from FND_NODES
##
## Examples:
## DisplayNodesInformation
##
## Returns:
##
##
## Notes:
## None.
##
## Version History:
## 115.9 29-MAR-2006 dbezemer Copied from ACT.sh
##
# Getting APPLSYS_NAME
Get_APPLSYS
Run_SQL
SQL_OUTPUT=`cat $OUT_DIR/$OUT_FILE.txt`
Get_Java_Version ()
{
##
## Procedure Name: Get_Java_Version
##
## Usage:
## Get_Java_Version <filename>
##
## Parameters:
## $1 - java executable to determine version of
##
## Description:
## Determines the version of the JVM as indicated by the executable
##
## Examples:
## Get_Java_Version $AFJVAPRG
##
## Returns:
##
##
## Version History:
## 115.20 28-MAR-2007 dbezemer Initial version
## 115.24 04-JUN-2007 dbezemer bug 6110514: Fixes for JRE 1.1.8 (used with
ADJVAPRG)
##
# Formats:
# Java(tm) Runtime Loader Version 1.1.8
# java version "1.1.8.16"
# java version "1.3.1_11"
JVM_VERSION=`eval ${1} -version 2>&1 | head -1`
# The older jre 1.1.8 version does not recognize -version option
if [ "`echo ${JVM_VERSION} | grep -i Illegal`" != "" ]; then
# Get the version from first line
JVM_VERSION=`eval ${1} 2>&1 | head -1 | awk '{print $5}' |sed 's/"//g'`
if [ "`echo ${JVM_VERSION} | grep '1\.1'`" = "" ]; then
# Get the version from second line if first line does not have it
JVM_VERSION=`eval ${1} 2>&1 | head -2 | tail -1 | awk '{print $5}' |sed
's/"//g'`
fi
else
# Only return the version number
JVM_VERSION=`echo ${JVM_VERSION} | awk '{print $3}' |sed 's/"//g'`
fi
$ECHO ${JVM_VERSION}
#
# END OF sdf_core
#