#!/usr/bin/ksh # set -xv #------------------------------------------------------------------------------- #-- Purpose: Display object tree #-- Author: Jacques Kilchoer #__ adapted to smenu by By. Polarski # Fixed query wich returned mutliple rows when object name exists in many schema #------------------------------------------------------------------------------- function help { cat < -u # list on which others object is dependent dep -p -u # List which objects are dependent on dep -pl -u # List all plan associated with OBJ EOF exit } OWNER='' if [ -z "$1" ];then help fi typeset -u OWNER typeset -u OBJ CHOICE=DEFAULT while [ -n "$1" ] do case "$1" in -u ) OWNER=$2; shift ;; -p ) CHOICE=DEP ;; -pl ) CHOICE=DEP_PLAN ;; -h ) help ;; * ) OBJ=$1 ;; esac shift done if [ -z "$OWNER" ];then echo "I need an Owner schema" exit fi HOST=`hostname` HOST=`echo $HOST | awk '{ printf ("%-+15.15s",$1) }'` . $SBIN/scripts/passwd.env . ${GET_PASSWD} $S_USER $ORACLE_SID if [ "x-$CONNECT_STRING" = "x-" ];then echo "could no get a the password of $S_USER" exit 0 fi # ---------------------------------------------------------------------- # Based on an idea of Jonathan Lewis # ---------------------------------------------------------------------- if [ "$CHOICE" = "DEP_PLAN" ];then if [ -n "$OWNER" ];then AND_OWNER=" and to_owner = '$OWNER'" fi sqlplus -s " $CONNECT_STRING" <