File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -92,13 +92,12 @@ _connect_oracle(){
9292 local oraHistFile=$WMA_LOG_DIR /.sqlplus_history
9393 local oraDictFile=$ORACLE_PATH /.autocomp.txt
9494 local oraDictFileDBObj=$oraTmpPath /${owner^^} /.autocompDBObj.txt
95- local prompt=" SQL [$ORACLE_USER @$ORACLE_TNS ]> "
95+ local prompt=" ORA [$ORACLE_USER @$ORACLE_TNS ]> "
9696 touch $oraHistFile
97- touch $oraDictFile
9897 touch $oraDictFileDBObj
9998
10099 # Starting the interactive session:
101- rlwrap -U --always-readline --no-children - H $oraHistFile -pgreen -S " $prompt " -z pipeto -D2 -i -r -c -f $oraDictFileDBObj -f $oraDictFile -f . -- sqlplus $connStr @login " ${owner^^} " " ${oraTmpPath} " " $oraDictFileDBObj "
100+ rlwrap -U -H $oraHistFile -pgreen -S " $prompt " -z pipeto -D2 -i -r -c -f $oraDictFileDBObj -f $oraDictFile -f . -- sqlplus $connStr @login " ${owner^^} " " ${oraTmpPath} " " $oraDictFileDBObj "
102101}
103102
104103_exec_oracle () {
Original file line number Diff line number Diff line change @@ -118,10 +118,12 @@ set verify ON
118118--set wrap ON
119119set xmloptimizationcheck OFF
120120
121- -- setup/run/define dbs-inventory related scripts and variables
122- define _editor=emacs
121+ -- setup/run/define interactive db sessions related scripts and variables
122+ -- define _editor=emacs
123123define owner=&1
124124define oracle_tmp_path=&2
125125define db_obj_autocomp=&3
126+ @stats_refresh
126127@col_width_all
127128@fill_db_obj_autocomp
129+ set editfile &oracle_tmp_path/afiedt.buf
Original file line number Diff line number Diff line change 1+ SET SERVEROUTPUT ON
2+ set FEEDBACK OFF
3+ declare
4+ print_line varchar2 (2048 );
5+ begin
6+ for i in (select table_name, stale_stats from user_tab_statistics
7+ where (stale_stats is null )) loop
8+ -- refresh statistis for stale tables as well
9+ -- where stale_stats is null or stale_stats='YES') loop
10+ print_line:= ' Refreshing statistics for table: ' || i .table_name ;
11+ dbms_output .put_line (print_line);
12+ dbms_stats .gather_table_stats (ownname=> NULL , tabname=> i .table_name , cascade=> FALSE);
13+ end loop;
14+ end;
15+ /
You can’t perform that action at this time.
0 commit comments