When people ask for help on (for example) OTN, they are often asked to supply further information – sometimes in the form of requests for results from SQL queries. If you are ever in this position, you may find that you don’t understand what the query does, or why the information is useful – nevertheless you can still do something to make it as easy as possible for your potential saviour to help you.
Here’s an example to show you how NOT to do it:
Request for information: “Please format the contents of v$sga_dynamic_components.”
Response:
SQL> select * from v$sga_dynamic_components;
COMPONENT CURRENT_SIZE
---------------------------------------------------------------- ------------
MIN_SIZE MAX_SIZE USER_SPECIFIED_SIZE OPER_COUNT LAST_OPER_TYP LAST_OPER
---------- ---------- ------------------- ---------- ------------- ---------
LAST_OPER GRANULE_SIZE
--------- ------------
shared pool 872415232
872415232 0 0 0 STATIC
16777216
large pool 16777216
0 0 0 1 GROW IMMEDIATE
17-JUL-12 16777216
COMPONENT CURRENT_SIZE
---------------------------------------------------------------- ------------
MIN_SIZE MAX_SIZE USER_SPECIFIED_SIZE OPER_COUNT LAST_OPER_TYP LAST_OPER
---------- ---------- ------------------- ---------- ------------- ---------
LAST_OPER GRANULE_SIZE
--------- ------------
java pool 16777216
16777216 0 0 0 STATIC
16777216
streams pool 0
0 0 0 0 STATIC
COMPONENT CURRENT_SIZE
---------------------------------------------------------------- ------------
MIN_SIZE MAX_SIZE USER_SPECIFIED_SIZE OPER_COUNT LAST_OPER_TYP LAST_OPER
---------- ---------- ------------------- ---------- ------------- ---------
LAST_OPER GRANULE_SIZE
--------- ------------
16777216
DEFAULT buffer cache 4194304000
4194304000 0 0 1 INITIALIZING IMMEDIATE
17-JUL-12 16777216
KEEP buffer cache 0
COMPONENT CURRENT_SIZE
---------------------------------------------------------------- ------------
MIN_SIZE MAX_SIZE USER_SPECIFIED_SIZE OPER_COUNT LAST_OPER_TYP LAST_OPER
---------- ---------- ------------------- ---------- ------------- ---------
LAST_OPER GRANULE_SIZE
--------- ------------
0 0 0 0 STATIC
16777216
RECYCLE buffer cache 0
0 0 0 0 STATIC
16777216
COMPONENT CURRENT_SIZE
---------------------------------------------------------------- ------------
MIN_SIZE MAX_SIZE USER_SPECIFIED_SIZE OPER_COUNT LAST_OPER_TYP LAST_OPER
---------- ---------- ------------------- ---------- ------------- ---------
LAST_OPER GRANULE_SIZE
--------- ------------
DEFAULT 2K buffer cache 0
0 0 0 0 STATIC
16777216
DEFAULT 4K buffer cache 0
0 0 0 0 STATIC
16777216
COMPONENT CURRENT_SIZE
---------------------------------------------------------------- ------------
MIN_SIZE MAX_SIZE USER_SPECIFIED_SIZE OPER_COUNT LAST_OPER_TYP LAST_OPER
---------- ---------- ------------------- ---------- ------------- ---------
LAST_OPER GRANULE_SIZE
--------- ------------
DEFAULT 8K buffer cache 0
0 0 0 0 STATIC
16777216
DEFAULT 16K buffer cache 0
0 0 0 0 STATIC
COMPONENT CURRENT_SIZE
---------------------------------------------------------------- ------------
MIN_SIZE MAX_SIZE USER_SPECIFIED_SIZE OPER_COUNT LAST_OPER_TYP LAST_OPER
---------- ---------- ------------------- ---------- ------------- ---------
LAST_OPER GRANULE_SIZE
--------- ------------
16777216
DEFAULT 32K buffer cache 0
0 0 0 0 STATIC
16777216
ASM Buffer Cache 0
COMPONENT CURRENT_SIZE
---------------------------------------------------------------- ------------
MIN_SIZE MAX_SIZE USER_SPECIFIED_SIZE OPER_COUNT LAST_OPER_TYP LAST_OPER
---------- ---------- ------------------- ---------- ------------- ---------
LAST_OPER GRANULE_SIZE
--------- ------------
0 0 0 0 STATIC
16777216
Every row of the output is spread across three lines, and 43% of the output is in repeated headings. I’m just not going to try to read that.
One the plus side, this user did at least present the information in a fixed format style, rather than cutting and pasting from an HTML or GUI output – so it is relatively straightforward to get the output to an easily readable state if you’re prepared to spend a few minutes deleting lines and joining lines.
On the extra-minus side: the request said “please FORMAT the output…” – if the person who wanted help isn’t able to read and respond to such a simple request, why should anyone believe that they will be prepared to put in a little extra effort when things get a little harder.
Think about a few column declarations, perhaps to limit the length of character columns and introduce comma separators for very large numbers; set a linesize so that single rows don’t wrap excessively or inconveniently; set a pagesize so that the output is a reasonable (but not extreme) length between repeated headings.
A simple acid test before you post – do you think YOU would find it easy to read and if you don’t, why would anyone else bother to try.
The more thoughtful you are about supplying information the more likely it is that people will be happy to help you.
DIGITAL JUICE
No comments:
Post a Comment
Thank's!