Oracle Scratchpad

March 11, 2011

Show stuff

Filed under: Oracle — Jonathan Lewis @ 6:35 pm GMT Mar 11,2011

There are various “show” commands in SQL*Plus that are convenient short-cuts for simple SQL commands, for example:

show parameter 
show recyclebin
show sga
show spparameter


You may find, though, that the output leaves a little to be desired, for example:

show parameter sharing
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
_optimizer_extended_cursor_sharing_r string      SIMPLE
el
cursor_sharing                       string      EXACT

SQL> show parameter dump

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
background_core_dump                 string      partial
background_dump_dest                 string      /u01/app/oracle/diag/rdbms/xxx
                                                 xxx/inst01/trace
core_dump_dest                       string      /u01/app/oracle/diag/rdbms/xxx
                                                 xxx/inst01/cdump
max_dump_file_size                   string      unlimited
shadow_core_dump                     string      PARTIAL
user_dump_dest                       string      /u01/app/oracle/diag/rdbms/xxx
                                                 xxx/inst01/trace

The output can be a little messy because of column limitations – but remember, there is a column command in SQL*Plus to allow you to control the output, and all you’re looking at with the show commands is column output. So try this:

SQL> column name_col_plus_show_param  format a38
SQL> column value_col_plus_show_param format a50
SQL> set linesize 120
SQL> show parameter sharing

NAME                                   TYPE        VALUE
-------------------------------------- ----------- --------------------------------------------------
_optimizer_extended_cursor_sharing_rel string      SIMPLE
cursor_sharing                         string      EXACT
SQL> show parameter dump

NAME                                   TYPE        VALUE
-------------------------------------- ----------- --------------------------------------------------
background_core_dump                   string      partial
background_dump_dest                   string      /u01/app/oracle/diag/rdbms/xxxxxx/inst01/trace
core_dump_dest                         string      /u01/app/oracle/diag/rdbms/xxxxxx/inst01/cdump
max_dump_file_size                     string      unlimited
shadow_core_dump                       string      PARTIAL
user_dump_dest                         string      /u01/app/oracle/diag/rdbms/xxxxxx/inst01/trace

If you issue the column command on its own you get a full listing of all the column definitions and this will show you column formatting options for:

show recyclebin   %_plus_show_recyc
show param        %_col_plus_show_param
show spparam      %_col_plus_show_spparam
show sga          %_name_col_plus_show_sga

autotrace          %_plus_exp  (relevant to pre-10.2 only)

1 Comment »

  1. hello Jonathan,
    Sorry for the question I am posting here; but, Do you have any plan to come to Spain (Barcelona) for any Oracle course?
    Thank you,
    Wissem

    Comment by orawiss — March 11, 2011 @ 6:44 pm GMT Mar 11,2011 | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.