RE: Semi-OT: Vi Question/Need

  • From: <Christopher.Taylor2@xxxxxxxxxxxx>
  • To: <Christopher.Taylor2@xxxxxxxxxxxx>, <kerry.osborne@xxxxxxxxxxx>, <tanel@xxxxxxxxxxxxxx>
  • Date: Tue, 19 Mar 2013 15:38:22 -0500

Actually - just realized.  The BASIC plan is close to what I need, but not 
exactly either because the STEP IDs can be/are different so those lines get 
flagged as diffs - so I still have to strip off the first 7 chars (which is 
easy in vi).  So BASIC gets me closer, then I run through vi search/replace and 
then do the compare in Winmerge.

Voila!  Perfect diff output (Winmerge moves sections that match when it can so 
that steps/sections that occur later don't get shown as diffs).

Chris


-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Christopher.Taylor2@xxxxxxxxxxxx
Sent: Sunday, March 17, 2013 5:09 PM
To: kerry.osborne@xxxxxxxxxxx; tanel@xxxxxxxxxxxxxx
Cc: oracle-l@xxxxxxxxxxxxx
Subject: RE: Semi-OT: Vi Question/Need

Thanks Kerry - Bruno Pier Paolo suggested using the 'BASIC' argument for plan 
stats and that worked perfectly.  I can copy the plans from different 
environments, paste in Winmerge and get a nice quick and easy diff compare.

This thread took on a life of its own after my reply to Bruno.  (THANKS to 
everyone who has responded)


Chris

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Kerry Osborne
Sent: Sunday, March 17, 2013 8:38 AM
To: tanel@xxxxxxxxxxxxxx
Cc: oracle-l Freelists
Subject: Re: Semi-OT: Vi Question/Need

Or you could use SQL*Plus to get what you want in the first place. (use substr 
and a few where clauses)

SYS@dbm1> l
  1  select substr(PLAN_TABLE_OUTPUT,1,73) PLAN_TABLE_OUTPUT from 
table(dbms_xplan.display_cursor('&sql_id','&child_no','typical'))
  2  where PLAN_TABLE_OUTPUT like '|%' or PLAN_TABLE_OUTPUT like 
'-------------------------------------------------------%'
  3* or PLAN_TABLE_OUTPUT like 'SQL_ID%' or PLAN_TABLE_OUTPUT like 'Plan hash 
value%'
SYS@dbm1> /
Enter value for sql_id: 1n60q90jkatjj
Enter value for child_no: 

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  1n60q90jkatjj, child number 0
Plan hash value: 2886813138
-------------------------------------------------------------------------
| Id  | Operation                   | Name                      | Rows  |
-------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |                           |       |
|   1 |  SORT ORDER BY              |                           |     1 |
|   2 |   NESTED LOOPS              |                           |     1 |
|   3 |    NESTED LOOPS             |                           |     1 |
|   4 |     NESTED LOOPS            |                           |     1 |
|   5 |      FIXED TABLE FULL       | X$KSLWT                   |    56 |
|*  6 |      FIXED TABLE FIXED INDEX| X$KSUSE (ind:1)           |     1 |
|*  7 |     FIXED TABLE FIXED INDEX | X$KSLED (ind:2)           |     1 |
|*  8 |    FIXED TABLE FIXED INDEX  | X$KGLCURSOR_CHILD (ind:2) |     1 |
-------------------------------------------------------------------------

15 rows selected.

Kerry Osborne
Enkitec
blog: kerryosborne.oracle-guy.com
twitter: https://twitter.com/KerryOracleGuy

--
//www.freelists.org/webpage/oracle-l


--
//www.freelists.org/webpage/oracle-l


Other related posts: