1- ORACLE_BASE=/oracle; export ORACLE_BASE
1+ ORACLE_BASE={{ rdbms[oracle_version | string].oracle_base | default( " /oracle" ) }} ; export ORACLE_BASE
22if [ -s $HOME /ora_hostname ]
33then
44 ORACLE_HOSTNAME=$( cat $HOME /ora_hostname) ; export ORACLE_HOSTNAME
@@ -11,37 +11,11 @@ ECHO="echo -e"; export ECHO
1111ORAVERS=19.3.0.0
1212SCRIPT=" ora_set.sh"
1313OS=$( uname -s)
14- if [ " $OS " == " SunOS" ]
15- then
16- ARCH=$( uname -p)
17- # /usr/bin/egrep
18- PATH=/usr/ccs/bin:$PATH :/usr/sfw/bin; export PATH
19- ORATAB=/var/opt/oracle/oratab; export ORATAB
20- AWK=$( which nawk)
21- GGREP=$( which ggrep | awk ' $0!~/alias/ {print $1}' )
22- if [ -f $GGREP ]
23- then
24- WGREP=" $GGREP -w"
25- else
26- ${ECHO} " !!! GNU grep not found !!!"
27- ${ECHO} " \tsome functions may work not correct !!!\n"
28- WGREP=" $( which grep | awk ' $0!~/alias/ {print $1}' ) "
29- fi
30- EGREP=$( which egrep | awk ' $0!~/alias/ {print $1}' )
31- if [ ! -f $EGREP ]
32- then
33- ${ECHO} " !!! egrep not found !!!"
34- ${ECHO} " \tsome functions may work not correct !!!\n"
35- EGREP=" $( which grep | awk ' $0!~/alias/ {print $1}' ) "
36- fi
37- ulimit -s 32768
38- ulimit -n 4096
39- else
40- ORATAB=/etc/oratab; export ORATAB
41- EGREP=$( which egrep | awk ' $0!~/alias/ {print $1}' )
42- WGREP=" $( which grep | awk ' $0!~/alias/ {print $1}' ) -w"
43- AWK=$( which awk)
44- fi
14+
15+ ORATAB=/etc/oratab; export ORATAB
16+ EGREP=$( which egrep | awk ' $0!~/alias/ {print $1}' )
17+ WGREP=" $( which grep | awk ' $0!~/alias/ {print $1}' ) -w"
18+ AWK=$( which awk)
4519
4620case $# in
4721 1 )
212186FULLVERS=" "
213187if [ " ${DBSTATUS} " == " RUNNING" ]
214188then
215- FULLVERS=" $( echo " exit" | sqlplus -S / as sysdba << EOF
216- set heading off
217- set lines 200
218- select BANNER_FULL from all_registry_banners where BANNER_FULL like '%Oracle Database Catalog%';
219- EOF
220- ) "
189+ FULLVERS=" $( echo " exit" | sqlplus / as sysdba) "
221190 DBVERS=$( echo $FULLVERS | awk -F" Version" ' {print $2}' | cut -d" ." -f1-4) ; export DBVERS
222191 DBREL=$( echo $DBVERS | cut -d" ." -f1) ; export DBREL
223192 # #### check for DIOGNOSTIC_DEST ans set some variables and aliases
224- DIAG=" "
225- DIAGOLD=" /db_data/$ORACLE_SID /dump/diag/diag/rdbms/$DBNAME /$ORACLE_SID /trace"
226- DIAGNEW=" /db_data/$ORACLE_SID /dump/diag/rdbms/$DBNAME /$ORACLE_SID /trace"
227- if [ -d ${DIAGNEW} ]
228- then
229- DIAG=" $DIAGNEW " ; export DIAG
230- else
231- if [ -d ${DIAGOLD} ]
232- then
233- DIAG=" $DIAGOLD " ; export DIAG
234- else
235- DIAGSQL=" $( echo " exit" | sqlplus -S / as sysdba << EOF
236- set heading off
237- set lines 200
238- select * from v\$ diag_info where NAME = 'Diag Trace';
239- EOF
240- ) "
241- DIAG=$( echo $DIAGSQL | awk ' $2~/Diag/ {print $4;}' ) ; export DIAG
242- fi
243- fi
193+ DIAG=" {{ diag_dest }}/diag/rdbms/$DBNAME /$ORACLE_SID /trace" ; export DIAG
194+
244195 if [ -z " ${DIAG} " ]
245196 then
246197 ${ECHO} " \n\t\t !!! DIAGNOSTIC_DEST not found => omit variable ALOG and some aliases !!!"
0 commit comments