select
  name,
  substr(order_recommendation,3) recommendation,
  substr(order_recommendation,1,1) "ID",
  in_parameter_file "SET",
  is_value,
  should_be_value,
  "comment" remark
from
(
  select
    decode(p.subname,' ',p.name,p.name||' ('||p.subname||')') name,
    decode(p.isdefault,'TRUE',
     decode(pt.value,
      null,
'O ok (not set; not mentioned in note)',
      decode(substr(pt.value,1,5),
       '-man-',
'E check if default value "'||p.value||'" is suitable ('||substr(pt.value,6)||')',
       '-ndf-',
'B add with value "'||substr(pt.value,6)||'"',
       '-any-',
'N ok (not set; any value recommended)',
       '-del-',
'J ok (not set; not to be set as explicitly mentioned in note)',
       decode(upper(p.value),upper(pt.value),
'I add explicitly with default value "'||pt.value||'"',
'A add with value "'||pt.value||'"'))),
      decode(pt.value,
       null,
'H check why set but not mentioned in note',
       decode(substr(pt.value,1,5),
        '-man-',
'F check if value "'||p.value||'" is suitable ('||substr(pt.value,6)||')',
        '-ndf-',
'G check if value "'||p.value||'" is suitable ('||substr(pt.value,6)||')',
        '-any-',
'M ok (set; any value recommended)',
        '-del-',
'C delete (set; not to be set as explicitly mentioned in note)',
        decode(replace(upper(p.value),' ',''),replace(upper(pt.value),' ',''),
'K ok (set correctly =)',
          decode(sign(
            decode(rpad('>=',length(pt.value),'X'),
                   translate(pt.value,'1234567890','XXXXXXXXXX'),
              to_number(p.value)-to_number(substr(pt.value,3))+1,0)),1,
'L ok (set correctly >=)',
'D change value to "'||pt.value||'"'))))) order_recommendation,
    decode(p.isdefault,'TRUE','NO','YES') in_parameter_file,
    p.value is_value,
    decode(substr(pt.value,1,5),
      '-man-',substr(pt.value,6),
      '-ndf-',substr(pt.value,6),
      '-any-','any value',
      '-del-','deleted '||chr(102)||'rom parameter file',
              pt.value) should_be_value,
    pt."comment"
  from
  (
    select
      lower(decode(instr(name,','),0,name,substr(name,1,instr(name,',')-1))) name,
      lower(decode(instr(name,','),0,' ',substr(name,instr(name,',')+1))) subname,
      value,
      vs,
      "comment"
    from
    (
      select
'ALWAYS_ANTI_JOIN'                             name,
  'HASH'                                       value,
  'BBBB.         .      '                      vs,
  ''                                           "comment" from dual union ( select
'ALWAYS_SEMI_JOIN'                             name,
  '-del-'                                      value,
  'BBBB.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'BACKGROUND_DUMP_DEST'                         name,
  '-any-'                                      value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'B_TREE_BITMAP_PLANS'                          name,
  '-del-'                                      value,
  'BBBB.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'BITMAP_MERGE_AREA_SIZE'                       name,
  '33554432'                                   value,
  'BBBB.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'COMMIT_WRITE'                                 name,
  '-del-'                                      value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'COMPATIBLE'                                   name,
  '10.1.0'                                     value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'COMPATIBLE'                                   name,
  '9.2.0'                                      value,
  '    .XXXXXXXXX.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'COMPATIBLE'                                   name,
  '8.1.7'                                      value,
  'RRRR.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'COMPATIBLE'                                   name,
  '-man-8.1.7.x.y (exact release)'             value,
  'BBBB.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'CONTROL_FILES'                                name,
  '-any-'                                      value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'CONTROL_FILE_RECORD_KEEP_TIME'                name,
  '>=30'                                       value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'CORE_DUMP_DEST'                               name,
  '-any-'                                      value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'CREATE_BITMAP_AREA_SIZE'                      name,
  '33554432'                                   value,
  'BBBB.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'DB_BLOCK_BUFFERS'                             name,
  '-del-'                                      value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'DB_BLOCK_BUFFERS'                             name,
  '-man-appropriately set'                     value,
  'XXXX.XXXXXXXXX.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'DB_BLOCK_LRU_LATCHES'                         name,
  '-man-NUMBER OF CPUS*2'                      value,
  'BBBB.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'DB_BLOCK_SIZE'                                name,
  '8192'                                       value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'DB_CACHE_SIZE'                                name,
  '-man-appropriately set'                     value,
  '    .XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'DB_FILE_MULTIBLOCK_READ_COUNT'                name,
  '-del-'                                      value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'DB_FILE_MULTIBLOCK_READ_COUNT'                name,
  '8'                                          value,
  'RRRR.RRRRRRRRR.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'DB_FILE_MULTIBLOCK_READ_COUNT'                name,
  '32'                                         value,
  'BBBB.BBBBBBBBB.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'DB_FILES'                                     name,
  '-any-'                                      value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'DB_NAME'                                      name,
  '-any-'                                      value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'DB_WRITER_PROCESSES'                          name,
  '-man-change default in case of dbwr problems only' value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'DISK_ASYNCH_IO'                               name,
  'TRUE'                                       value,
  'RRRR.RRRRRRRRR.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'DISTRIBUTED_TRANSACTIONS'                     name,
  '-man-0 if no DB links are used'             value,
  'XXXX.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'EVENT,10027'                                  name,
  '10027 trace name context forever, level 1'  value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  'avoid process state dump at deadlock'       "comment" from dual ) union ( select
'EVENT,10028'                                  name,
  '10028 trace name context forever, level 1'  value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  'do not wait while writing deadlock trace'   "comment" from dual ) union ( select
'EVENT,10040'                                  name,
  '10040 trace name context forever, level 1'  value,
  '    .         .XXXXXX'                      vs,
  'avoid ora-1406: column value was truncated' "comment" from dual ) union ( select
'EVENT,10162'                                  name,
  '10162 trace name context forever, level 1'  value,
  'BBBB.       BB.XXXXXX'                      vs,
  'avoid wrong values'                         "comment" from dual ) union ( select
'EVENT,10168'                                  name,
  '10168 trace name context forever, level 1'  value,
  'BBBB.         .      '                      vs,
  'avoid wrong values'                         "comment" from dual ) union ( select
'EVENT,10181'                                  name,
  '10181 trace name context forever, level 1'  value,
  '    .XX       .      '                      vs,
  'avoid unsorted result although order by'    "comment" from dual ) union ( select
'EVENT,10183'                                  name,
  '10183 trace name context forever, level 1'  value,
  'RRRR.RRRRRRRRR.XXXXXX'                      vs,
  'avoid rounding during cost calculation'     "comment" from dual ) union ( select
'EVENT,10191'                                  name,
  '10191 trace name context forever, level 1'  value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  'avoid high CBO memory consumption'          "comment" from dual ) union ( select
'EVENT,10629'                                  name,
  '10629 trace name context forever, level 32' value,
  '    .         .XXXXXX'                      vs,
  'influence rebuild online error handling'    "comment" from dual ) union ( select
'EVENT,10891'                                  name,
  '10891 trace name context forever, level 1'  value,
  '    .         .XXXXXX'                      vs,
  'avoid high parsing times joining many tables' "comment" from dual ) union ( select
'EVENT,38043'                                  name,
  '38043 trace name context forever, level 1'  value,
  '    .     XXXX.      '                      vs,
  'avoid cartesian merge joins in general'     "comment" from dual ) union ( select
'EVENT,38068'                                  name,
  '38068 trace name context forever, level 100' value,
  '    .      XXX.XXXXXX'                      vs,
  'long raw statistic; implement note 948197'  "comment" from dual ) union ( select
'EVENT,38069'                                  name,
  '38069 trace name context forever, level 1'  value,
  '    .     BBBB.      '                      vs,
  'avoid ora-600 at star transformation'       "comment" from dual ) union ( select
'FAST_START_IO_TARGET'                         name,
  '0'                                          value,
  'XX  .         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'FILESYSTEMIO_OPTIONS'                         name,
  'SETALL'                                     value,
  '    .XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'HASH_AREA_SIZE'                               name,
  '-man-=2*sort_area_size'                     value,
  'BBBB.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'HASH_JOIN_ENABLED'                            name,
  'FALSE'                                      value,
  'RRRR.RRRRRRRRR.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'HASH_JOIN_ENABLED'                            name,
  'TRUE'                                       value,
  'BBBB.BBBBBBBBB.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'HASH_MULTIBLOCK_IO_COUNT'                     name,
  '-man-=DB_FILE_MULTIBLOCK_READ_COUNT'        value,
  'BBBB.BBBBBBBBB.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'HPUX_SCHED_NOAGE'                             name,
  '178'                                        value,
  '    .         .XXXXXX'                      vs,
  'set only on NON-RAC; OTHERWISE: do not set' "comment" from dual ) union ( select
'JAVA_POOL_SIZE'                               name,
  '-man-0 if no java used'                     value,
  'RRRR.XXXXXXXXX.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'LOG_ARCHIVE_DEST'                             name,
  '-del-'                                      value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'LOG_ARCHIVE_DEST_1'                           name,
  '-ndf-LOCATION=/oracle/'||chr(60)||'SID'||chr(62)
  ||'/oraarch/'||chr(60)||'SID'||chr(62)||'arch' value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'LOG_ARCHIVE_DEST'                             name,
  '-any-'                                      value,
  'RRRR.XXXXXXXXX.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'LOG_ARCHIVE_FORMAT'                           name,
  '%t_%s_%r.dbf'                               value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'LOG_ARCHIVE_START'                            name,
  'TRUE'                                       value,
  'XXXX.XXXXXXXXX.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'LOG_BUFFER'                                   name,
  '>=1048576'                                  value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'LOG_BUFFER'                                   name,
  '1048576'                                    value,
  'XXXX.XXXXXXXXX.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'LOG_CHECKPOINT_INTERVAL'                      name,
  '0'                                          value,
  'XXXX.XXXXXXXXX.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'LOG_CHECKPOINT_TIMEOUT'                       name,
  '0'                                          value,
  'BBBB.BBBBBBBBB.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'LOG_CHECKPOINTS_TO_ALERT'                     name,
  'TRUE'                                       value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'MAX_DUMP_FILE_SIZE'                           name,
  '20000'                                      value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'MAX_ROLLBACK_SEGMENTS'                        name,
  '-any-'                                      value,
  'XXXX.XXXXXXXXX.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'OPEN_CURSORS'                                 name,
  '>=800'                                      value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'OPTIMIZER_FEATURES_ENABLE'                    name,
  '-del-'                                      value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'OPTIMIZER_FEATURES_ENABLE'                    name,
  '9.2.0'                                      value,
  '    .BBBBBBBBB.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'OPTIMIZER_FEATURES_ENABLE'                    name,
  '8.1.7'                                      value,
  'BBBB.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'OPTIMIZER_INDEX_CACHING'                      name,
  '-del-'                                      value,
  'BBBB.BBBBBBBBB.XXXXXX'                      vs,
  'est. % of index cached (inlist, nested loop)' "comment" from dual ) union ( select
'OPTIMIZER_INDEX_COST_ADJ'                     name,
  '20'                                         value,
  '    .         .RRRRRR'                      vs,
  ''                                           "comment" from dual ) union ( select
'OPTIMIZER_INDEX_COST_ADJ'                     name,
  '10'                                         value,
  'RRRR.RRRRRRRRR.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'OPTIMIZER_INDEX_COST_ADJ'                     name,
  '-del-'                                      value,
  'BBBB.BBBBBBBBB.BBBBBB'                      vs,
  ''                                           "comment" from dual ) union ( select
'OPTIMIZER_MAX_PERMUTATIONS'                   name,
  '2000'                                       value,
  'BBBB.BBBBBBBBB.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'OPTIMIZER_MODE'                               name,
  '-del-'                                      value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'OPTIMIZER_MODE'                               name,
  'CHOOSE'                                      value,
  'XXXX.XXXXXXXXX.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'OPTIMIZER_PERCENT_PARALLEL'                   name,
  '100'                                        value,
  'BBBB.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'OPTIMIZER_SEARCH_LIMIT'                       name,
  '-del-'                                      value,
  'XXXX.XXXXXXXXX.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'PARALLEL_AUTOMATIC_TUNING'                    name,
  '-del-'                                      value,
  'BBBB.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'PARALLEL_BROADCAST_ENABLED'                   name,
  'TRUE'                                       value,
  'BBBB.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'PARALLEL_EXECUTION_MESSAGE_SIZE'              name,
  '16384'                                      value,
  'BBBB.BBBBBBBBB.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'PARALLEL_MAX_SERVERS'                         name,
  '-man-#DB-CPU-CORES*10'                      value,
  '    .BBBBBBBBB.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'PARALLEL_MAX_SERVERS'                         name,
  '-man-CPU_COUNT*8'                           value,
  'BBBB.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'PARALLEL_THREADS_PER_CPU'                     name,
  '1'                                          value,
  'BBBB.BBBBBBBBB.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'PGA_AGGREGATE_TARGET'                         name,
  '-man-appropriately set'                     value,
  '    .BBBBBBBBB.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'PROCESSES'                                    name,
  '-man-formula how to set in parameter note'  value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'PROCESSES'                                    name,
  '-man-#SAP-WPs*2+20'                         value,
  'RRRR.RRRRRRRRR.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'PROCESSES'                                    name,
  '-man-> 4 * #BW WORK PROCESSES + 20'         value,
  'BBBB.BBBBBBBBB.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'QUERY_REWRITE_ENABLED'                        name,
  'FALSE'                                      value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'REMOTE_OS_AUTHENT'                            name,
  'TRUE'                                       value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'REPLICATION_DEPENDENCY_TRACKING'              name,
  '-any-'                                      value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'SESSIONS'                                     name,
  '-man-2*PROCESSES'                           value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'SESSIONS'                                     name,
  '-man->PROCESSES'                            value,
  'XXXX.XXXXXXXXX.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'SHARED_POOL_SIZE'                             name,
  '-man-appropriately set; at least 400MB'     value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'SHARED_POOL_RESERVED_SIZE'                    name,
  '-man-=10% SHARED_POOL_SIZE'                 value,
  'BBBB.BBBBBBBBB.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'SORT_AREA_RETAINED_SIZE'                      name,
  '0'                                          value,
  'XXXX.RRRRRRRRR.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'SORT_AREA_SIZE'                               name,
  '>=2097152'                                  value,
  'RRRR.RRRRRRRRR.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'SORT_AREA_SIZE'                               name,
  '>=10485760'                                 value,
  'BBBB.         .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'SORT_MULTIBLOCK_READ_COUNT'                   name,
  '-man-=DB_FILE_MULTIBLOCK_READ_COUNT'        value,
  'BBBB.BBBBBBBBB.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'STAR_TRANSFORMATION_ENABLED'                  name,
  'TRUE'                                       value,
  'BBBB.BBBBBBBBB.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'STAR_TRANSFORMATION_ENABLED'                  name,
  '-del-'                                      value,
  'RRRR.RRRRRRRRR.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'STATISTICS_LEVEL'                             name,
  'BASIC'                                      value,
  '    .BBBB     .      '                      vs,
  ''                                           "comment" from dual ) union ( select
'TIMED_STATISTICS'                             name,
  'TRUE'                                       value,
  'XXXX.XXXXXXXXX.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'TRANSACTION_AUDITING'                         name,
  'FALSE'                                      value,
  'XXXX.XXXXXXXXX.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'UNDO_MANAGEMENT'                              name,
  'AUTO'                                       value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'UNDO_TABLESPACE'                              name,
  'PSAPUNDO'                                   value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'UNDO_RETENTION'                               name,
  '-man-appropriately set'                     value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'USER_DUMP_DEST'                               name,
  '-any-'                                      value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'WORKAREA_SIZE_POLICY'                         name,
  'AUTO'                                       value,
  '    .BBBBBBBBB.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'_B_TREE_BITMAP_PLANS'                         name,
  'FALSE'                                      value,
  'XXXX.XXXXXXXXX.XXXXXX'                      vs,
  'avoid b*tree conversion to bitmap'          "comment" from dual ) union ( select
'_BLOOM_FILTER_ENABLED'                        name,
  'FALSE'                                      value,
  '    .         .XXXXXX'                      vs,
  'avoid wrong values'                         "comment" from dual ) union ( select
'_DB_BLOCK_NUMA'                               name,
  '-man-on HP-UX without CLM: =1, OTHERWISE: do not set' value,
  '    .         .XXXXXX'                      vs,
  'performance; note 1225732'                  "comment" from dual ) union ( select
'_ELIMINATE_COMMON_SUBEXPR'                    name,
  '-man-FALSE as workaround for fixes in 814514, 822638' value,
  'XXXX.XXXXXX   .      '                      vs,
  'avoid wrong values'                         "comment" from dual ) union ( select
'_ENABLE_NUMA_OPTIMIZATION'                    name,
  '-man-on HP-UX without CLM: =FALSE, OTHERWISE: do not set' value,
  '    .         .XXXXXX'                      vs,
  'performance; note 1225732'                  "comment" from dual ) union ( select
'_IN_MEMORY_UNDO'                              name,
  'FALSE'                                      value,
  '    .         .XXXXXX'                      vs,
  'avoid corruptions; wa for notes 980805,1013476' "comment" from dual ) union ( select
'_OPTIM_PEEK_USER_BINDS'                       name,
  'FALSE'                                      value,
  '    .XXXXXXXXX.XXXXXX'                      vs,
  'avoid bind value peeking'                   "comment" from dual ) union ( select
'_OPTIMIZER_MJC_ENABLED'                       name,
  'FALSE'                                      value,
  '    .         .XXXXXX'                      vs,
  'avoid cartesian merge joins in general'     "comment" from dual ) union ( select
'_OPTIMIZER_JOIN_SEL_SANITY_CHECK'             name,
  'TRUE'                                       value,
  '    .   XXXXXX.      '                      vs,
  'correct wrong row calculation in joins'     "comment" from dual ) union ( select
'_OPTIMIZER_OR_EXPANSION'                      name,
  'DEPTH'                                      value,
  '    .      XXX.    XX'                      vs,
  'avoid FTS in case of encapsulated OR'       "comment" from dual ) union ( select
'_PGA_MAX_SIZE'                                name,
  '-any-'                                      value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'_PGA_MAX_SIZE'                                name,
  '-man-set if PGA_AGGREGATE_target>4GB as in note' value,
  '    .BBBBBBBBB.      '                      vs,
  ''                                           "comment" from dual ) union ( select
'_PUSH_JOIN_PREDICATE'                         name,
  'FALSE'                                      value,
  '    .RRRRRRRRR.      '                      vs,
  'avoid bad access plans in outer joins'      "comment" from dual ) union ( select
'_RECYCLEBIN'                                  name,
  'FALSE'                                      value,
  '    .         .XXXXXX'                      vs,
  ''                                           "comment" from dual ) union ( select
'_SORT_ELIMINATION_COST_RATIO'                 name,
  '10'                                         value,
  '    .   XXXXXX.XXXXXX'                      vs,
  'use non-order-by-sorted indexes (first_rows)' "comment" from dual ) union ( select
'_TABLE_LOOKUP_PREFETCH_SIZE'                  name,
  '0'                                          value,
  '    .XXXXXXXXX.XXXXXX'                      vs,
  'avoid wrong values; note 1109753'           "comment" from dual )
    )
    where
      substr(vs,decode(
      (select replace(substr(version,1,instr(version,'.',1,4)-1),'.',null) from V$INSTANCE),
      '8171',1,'8172',2,'8173',3,'8174',4,
      '9201',6,'9202',7,'9203',8,'9204',9,'9205',10,'9206',11,'9207',12,'9208',13,'9209',14,
	  '10101',16,'10102',17,'10103',18,'10104',19,'10105',20,'10106',21),1)
       in ('X', decode(substr(upper('<OLAP System? [n]>'),1,1),'Y','B','R'))
  ) pt,
  (
    select
      name,
      subname,
      trim(substr(max(sort_string),1,5)) isdefault,
      substr(max(sort_string),6)||
        decode(count(*),1,'',
        decode(name,'event','',
        decode(substr(name,1,1),'_','',
        ', ...'))) value
    from
    (
      select
        lower(name) name,
        ' ' subname,
        concat(lpad(isdefault,5),value) sort_string
      from
        v$parameter2
      where
        name!='event'
      union
      (
        select
          'event' name,
          substr(trim(translate(value,
            chr(10)||chr(13)||chr(9),'   ')),1,5) subname,
          concat('FALSE',trim(translate(value,
            chr(10)||chr(13)||chr(9),'  '))) sort_string
        from
        (
          select
            substr(':'||vparam.value, instr(':'||vparam.value,':',1,vcnt.cnt)+1,
              decode(instr(':'||vparam.value,':',1,vcnt.cnt+1),0,
                length(':'||vparam.value),instr(':'||vparam.value,':',1,vcnt.cnt+1)-1)-
              decode(instr(':'||vparam.value,':',1,vcnt.cnt  ),0,
                length(':'||vparam.value),instr(':'||vparam.value,':',1,vcnt.cnt))) value
          from
            v$parameter2 vparam,
            (select rownum cnt from v$parameter2 where rownum <= 20) vcnt
          where
            vparam.name='event'
        )
        where
          value is not null
      )
      union
      (
        select
          decode(substr(lower(name),1,5),'event','event',lower(name)) name,
          decode(substr(lower(name),1,5),'event',substr(name,7,5),' ')  subname,
          ' TRUE ' sort_string
        from
        (
          select         '_B_TREE_BITMAP_PLANS'             name from dual
          union ( select '_BLOOM_FILTER_ENABLED'            name from dual )
          union ( select '_DB_BLOCK_NUMA'                   name from dual )
          union ( select '_ELIMINATE_COMMON_SUBEXPR'        name from dual )
          union ( select '_ENABLE_NUMA_OPTIMIZATION'        name from dual )
          union ( select '_IN_MEMORY_UNDO'                  name from dual )
          union ( select '_OPTIM_PEEK_USER_BINDS'           name from dual )
          union ( select '_OPTIMIZER_MJC_ENABLED'           name from dual )
          union ( select '_OPTIMIZER_JOIN_SEL_SANITY_CHECK' name from dual )
          union ( select '_OPTIMIZER_OR_EXPANSION'          name from dual )
          union ( select '_PGA_MAX_SIZE'                    name from dual )
          union ( select '_PUSH_JOIN_PREDICATE'             name from dual )
          union ( select '_RECYCLEBIN'                      name from dual )
          union ( select '_SORT_ELIMINATION_COST_RATIO'     name from dual )
          union ( select '_TABLE_LOOKUP_PREFETCH_SIZE'      name from dual )
          union ( select 'EVENT 10027'                      name from dual )
          union ( select 'EVENT 10028'                      name from dual )
          union ( select 'EVENT 10040'                      name from dual )
          union ( select 'EVENT 10162'                      name from dual )
          union ( select 'EVENT 10168'                      name from dual )
          union ( select 'EVENT 10181'                      name from dual )
          union ( select 'EVENT 10183'                      name from dual )
          union ( select 'EVENT 10191'                      name from dual )
          union ( select 'EVENT 10629'                      name from dual )
          union ( select 'EVENT 10891'                      name from dual )
          union ( select 'EVENT 38043'                      name from dual )
          union ( select 'EVENT 38068'                      name from dual )
          union ( select 'EVENT 38069'                      name from dual )
        ) underscore
      )
    )
    group by
      name,
      subname
  ) p
  where
    p.name=pt.name(+) and
    p.subname=pt.subname(+)
  union
  (
    select
      concat(concat(
        ' *** date/time ',
        to_char(sysdate,'YYYY-MM-DD/HH24:MI')),
        ' *** ') name,
      concat(
        '   *** note/version 830576/175 124361/143',
        ' 632427/14 632556/75 ***') order_recommendation,
      ' ' in_parameter_file,
      concat(concat(
        ' *** version/type ',
        version),
        decode(substr(upper('<OLAP System? [n]>'),1,1),
        'Y','/OLAP ***','/OLTP ***')) is_value,
      concat(
        ' *** command supports all Oracle',
        ' releases >= 8.1. ***') should_be_value,
      ' ' "comment"
    from
      v$instance
  )
)
order by
  substr(order_recommendation,1,1),
  name;
