-
Notifications
You must be signed in to change notification settings - Fork 55
/
findpack.sh
41 lines (35 loc) · 1.06 KB
/
findpack.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
PROC_OWNER=`sqlplus -silent $DB_CONN_STR@$SH_DB_SID <<END
set pagesize 50 feedback off verify off heading on echo off
col owner format a20
col object_name format a30
col subobject_name format a10
set linesize 150
break on object_name
select object_name,owner,subobject_name,object_type,object_id, created,last_ddl_time,status
from dba_objects where object_type like 'PACKAGE%' and object_name like upper('$2%') and owner=upper('$1')
order by object_name
/
exit;
END`
if [ -z "$PROC_OWNER" ]; then
echo "no object exists, please check again"
exit 0
else
echo '*******************************************'
echo " $PROC_OWNER "
PACK_LIST=` sqlplus -s $DB_CONN_STR@$SH_DB_SID <<END
col name format a30
col text format a100
set linesize 200
set pages 50
break on name
select name,text from dba_source where owner like UPPER('$1') and name like upper('$2%') and type='PACKAGE'
and (text like '%PROCEDURE %' or text like '%FUNCTION %' )
order by name,line;
exit;
END`
echo " $PACK_LIST "
echo '*******************************************'
fi
exit