My Oracle @desc.sql

Here's procedure source...

xx9999@oi>
@list.sql desc.sql desc.sql set echo off set linesize 80 set newpage none spool &1..1.txt describe &1 spool off set echo on !sort &1..1.txt -o &1..2.txt !grep -v " -" &1..2.txt>&1..3.txt !grep -v "l?" &1..3.txt>&1..4.txt !cp &..1.4.txt &1..txt !rm &..1.1.txt !rm &..1.2.txt !rm &..1.3.txt !rm &..1.4.txt !vim +2 &..1.txt 


Here's example use...

 @desc all_tables
 AVG_ROW_LEN                              NUMBER  AVG_SPACE                                NUMBER  AVG_SPACE_FREELIST_BLOCKS                NUMBER  BACKED_UP                                VARCHAR2(1)  BLOCKS                                   NUMBER  BUFFER_POOL                              VARCHAR2(7)  CACHE                                    VARCHAR2(5)  CHAIN_CNT                                NUMBER  CLUSTER_NAME                             VARCHAR2(30)  DEGREE                                   VARCHAR2(10)  EMPTY_BLOCKS                             NUMBER  FREELISTS                                NUMBER  FREELIST_GROUPS                          NUMBER  INITIAL_EXTENT                           NUMBER  INI_TRANS                                NUMBER  INSTANCES                                VARCHAR2(10)  IOT_NAME                                 VARCHAR2(30)  IOT_TYPE                                 VARCHAR2(12)  LAST_ANALYZED                            DATE  LOGGING                                  VARCHAR2(3)  MAX_EXTENTS                              NUMBER  MAX_TRANS                                NUMBER  MIN_EXTENTS                              NUMBER  NESTED                                   VARCHAR2(3)  NEXT_EXTENT                              NUMBER  NUM_FREELIST_BLOCKS                      NUMBER  NUM_ROWS                                 NUMBER  OWNER                           NOT NULL VARCHAR2(30)  PARTITIONED                              VARCHAR2(3)  PCT_FREE                                 NUMBER  PCT_INCREASE                             NUMBER  PCT_USED                                 NUMBER  SAMPLE_SIZE                              NUMBER  TABLESPACE_NAME                          VARCHAR2(30)  TABLE_LOCK                               VARCHAR2(8)  TABLE_NAME                      NOT NULL VARCHAR2(30)  TEMPORARY                                VARCHAR2(1) "all_tables.txt" 38L, 1900C    

Support procedures ~ menu

I created a support menu for myself for frequent access items.  Using Korn shell with no extentions -- but, 
with the first line ='#!/usr/gbin/ksh' (to inform OS I'm using ksh). 
 
::/mnt/replicated/apps/datamodules/_SUP> cat menu
#!/usr/bin/ksh
# -            -----------------
# description: menu             ~ displays list of commands
# -
. ../_CMD/db_setup_DSS.ksh   2>&1 >/dev/null
. ../_CMD/set_mmdd_DSS.ksh 0 2>&1 >/dev/null
grep -h "description" *|grep "#"|grep -v "grep"
::/mnt/replicated/apps/datamodules/_SUP> menu
# description: consolidated     ~ starts mysql with the consolidated database
# description: dailysettlements ~ starts mysql with the dailysettlements database
# description: dss              ~ starts sqlplus with the dss oracle instance
# description: edb              ~ start sqlplus with the edb oracle instance
# description: menu             ~ displays list of commands
::/mnt/replicated/apps/datamodules/_SUP>

Favorite Tweets