whatregistry (DBTier Script: executes using -- sqlplus / as sysdba)
What EBusiness Suite Database Registry for Database Products, Versions and Status.
Example:
#---------------------------------------------------------------#
#- What (whatregistry) -#
#---------------------------------------------------------------#
06-JUN-13 OATC (oratest) Oracle Registry
19:52:15 EBusiness Oracle Database History
Oracle Component Version Status
---------------------------------------- ---------- ----------
JServer JAVA Virtual Machine 11.2.0.3.0 VALID
OLAP Analytic Workspace 11.2.0.3.0 VALID
OLAP Catalog 11.2.0.3.0 VALID
Oracle Database Catalog Views 11.2.0.3.0 VALID
Oracle Database Java Packages 11.2.0.3.0 VALID
Oracle Database Packages and Types 11.2.0.3.0 VALID
Oracle Enterprise Manager 11.2.0.3.0 VALID
Oracle Expression Filter 11.2.0.3.0 VALID
Oracle Multimedia 11.2.0.3.0 VALID
Oracle OLAP API 11.2.0.3.0 VALID
Oracle Real Application Clusters 11.2.0.3.0 INVALID
Oracle Text 11.2.0.3.0 VALID
Oracle XDK 11.2.0.3.0 VALID
Oracle XML Database 11.2.0.3.0 VALID
Spatial 11.2.0.3.0 VALID
#!/usr/bin/ksh
#whatregistry ()
#-----------------------------------------------------------------------#
# Module Name: whatregistry (c) Copyright 2012 #
# #
# Purpose: Report on the DBA Registry #
# #
# Maintenance #
# Date Author Description #
# ----------- ------------ ------------------------------------- #
# 10-May-2012 M.Barone Module design/creation #
#-----------------------------------------------------------------------#
{
DIRNAM=$(dirname $0)
ORASID=$(echo $CONTEXT_NAME | cut -f1 -d'_')
HNAME=$(uname -n)
#---------------------------------------------------------------#
# TEST: Number ($#) of arguments passed to this function? #
#---------------------------------------------------------------#
if [ $# = 0 ]
then
clear
echo
echo " #---------------------------------------------------#"
echo " # whatregistry: Oracle Database Registry #"
echo " #---------------------------------------------------#"
echo
print
echo " Connecting as SYSDBA"
sleep 2
clear
else
SEARCH=$1
clear
fi
ORANAM=${ORASID}
#------------------------------------------------------------------------#
# Initialize #
#------------------------------------------------------------------------#
SPOOLNM=/tmp/whatregistry_$$.txt
Appendix- whatregistry script (continued)
#------------------------------------------------------------------------#
# SQL*Plus ("Here-Document") #
#------------------------------------------------------------------------#
sqlplus -s /nolog <<-END_FILE
CONNECT / as SYSDBA
SPOOL ${SPOOLNM}
clear BREAKS
clear BUFFER
clear COLUMNS
clear COMPUTES
clear SCREEN
clear SQL
clear TIMING
set feedback off
set flush on
set heading on
set pause off
set space 1
set termout on
set verify on
set linesize 80
set pagesize 999
prompt #--------------------------------------------------------#
prompt #- What (whatregistry) -#
prompt #--------------------------------------------------------#
COLUMN datevalue NOPRINT NEW_VALUE DATEVAR
COLUMN timevalue NOPRINT NEW_VALUE TIMEVAR
COLUMN comp_name FORMAT A40 Heading 'Oracle Component'
COLUMN version FORMAT A10 Heading 'Version'
COLUMN status FORMAT A10 Heading 'Status'
TTITLE CENTER '${ORASID} (${HNAME}) Oracle Registry' -
LEFT DATEVAR skip 1 -
CENTER 'EBusiness Oracle Database History' -
LEFT TIMEVAR skip 2
alter session set NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';
SELECT TO_CHAR(sysdate, 'DD-MON-YY') datevalue,
TO_CHAR(sysdate, 'HH24:MI:SS') timevalue,
comp_name, version, status
FROM dba_registry
ORDER BY comp_name;
END_FILE
print
print "Please see /tmp/whatregistry_$$.txt"
print
}
No comments:
Post a Comment