Orac-alpha

 view release on metacpan or  search on metacpan

DDL/README  view on Meta::CPAN

83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
forum (where you are encouraged to submit suggestions and RFC's) and a
Bug Tracking list. 
 
It is important to check that you are using the latest version before
posting. If you're not then I'm *very* likely to simply say "upgrade to
the latest". You would do yourself a favor by upgrading beforehand.
 
There is pod documentation for using DDL::Oracle in the Oracle.pm file.
From the .../DDL directory, try 'pod2text Oracle.pm'.
 
Please remember that I'm (hopefully employed and) busy. Try to help
yourself first, then try to help me help you by following these
guidelines carefully.  (Note specifically that I'm unlikely to answer a
question that's answered clearly in the on-line documentation.)
 
Regards,
Richard Sutherland
 
__END__

Shell/Meta.pm  view on Meta::CPAN

17
18
19
20
21
22
23
24
25
26
27
28
29
30
        $parent->{dbiwd}->Busy;
        my $sth = $parent->{dbh}->table_info;
        if ($parent->{dbh}->err) {
                warn qq{Table information is not available: } .
                        $parent->{dbh}->errstr;
        } else {
   $parent->sth_go( $sth, 1 );
         $parent->display_results( $sth );
        }
        $parent->{dbiwd}->Unbusy;
}
 
1;

db/orac_Oracle.pm  view on Meta::CPAN

739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
                            $self->selector( \$univ_form_win,
                                             \$screen_type,,
                                             \$screen_title,
                                             \$index_win_cnt,
                                             \@actual_entry,
                                             \$owner,
                                             \$object,
                                             \@ordered_entry,
                                             \@sql_entry,
                                           );
                            $univ_form_win->Unbusy;
                                          }
                           )->pack (-side=>'left',
                                    -anchor=>'w');
 
$balloon->attach($forward_b, -msg => $help_txt );
 
$self->window_exit_button( \$bb, \$univ_form_win, 1, \$balloon, );
main::iconize( $univ_form_win );
 
if ($need_focus)

db/orac_Oracle.pm  view on Meta::CPAN

1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
                                          -fill=>'both');
 
         main::iconize( $window );
      }
      $window->{text}->insert('end', @res);
   }
   $sth->finish;
   if($detected == 0){
      $self->{Main_window}->Busy(-recurse=>1);
      main::mes($self->{Main_window},$main::lg{no_rows_found});
      $self->{Main_window}->Unbusy;
   } else {
 
      $window->{text}->pack();
 
      $window->{text}->bind(
         '<Double-1>',
         sub$window->Busy(-recurse=>1);
               $self->selected_error(
               $window->{text}->get('active')
                                     );
               $window->Unbusy}
                                       );
   }
}
 
=head2 dbas_orac
 
Creates DBA Viewer window, for selecting various DBA_XXXX tables,
which can then be selected upon.
 
=cut

db/orac_Oracle.pm  view on Meta::CPAN

2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
                                 )->pack(-expand=>'yes',-fill=>'both');
 
         main::iconize($window);
      }
      $window->{text}->insert('end', @res);
   }
   $sth->finish;
   if($detected == 0){
      $self->{Main_window}->Busy(-recurse=>1);
      main::mes($self->{Main_window},$main::lg{no_rows_found});
      $self->{Main_window}->Unbusy;
   } else {
 
      $window->{text}->pack();
 
      $window->{text}->bind(
         '<Double-1>',
         sub{
              $window->Busy(-recurse=>1);
              $self->{Main_window}->Busy(-recurse=>1);
 
              $self->univ_form( 'SYS',
                                $window->{text}->get('active'),
                                'form'
                              );
 
              $self->{Main_window}->Unbusy;
              $window->Unbusy;
            }
 
                                   );
   }
}
 
=head2 addr_orac
 
Produces a list of all the PADDR addresses in the database, to
help a DBA examine what's running.  Useful info for deciding

db/orac_Oracle.pm  view on Meta::CPAN

2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
      main::iconize($window);
   }
   $window->{text}->insert('end', @res);
}
$sth->finish;
 
if($detected == 0){
 
   $self->{Main_window}->Busy(-recurse=>1);
   main::mes($self->{Main_window},$main::lg{no_rows_found});
   $self->{Main_window}->Unbusy;
 
} else {
 
   $window->{text}->pack();
 
   $window->{text}->bind(
      '<Double-1>',
      sub{
            my $loc_addr = $window->{text}->get('active');

db/orac_Oracle.pm  view on Meta::CPAN

2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
                                 )->pack(-expand=>'yes',-fill=>'both');
 
         main::iconize($window);
      }
      $window->{text}->insert('end', @res);
   }
   $sth->finish;
   if($detected == 0){
      $self->{Main_window}->Busy(-recurse=>1);
      main::mes($self->{Main_window},$main::lg{no_rows_found});
      $self->{Main_window}->Unbusy;
   } else {
 
      $window->{text}->pack();
 
      $window->{text}->bind(
         '<Double-1>',
         sub { $window->Busy(-recurse=>1);
 
               $self->f_clr( $main::v_clr );
 
               # 5 jan 2000, Andre Seesink <Andre.Seesink@CreXX.nl>
               # Now we get sid and username
 
               my ($sid, $username) = split(' ',$window->{text}->get('active'));
               $self->show_sql( 'sel_sid' , '1',
                                $main::lg{sel_sid} . ': ' . $sid,
                                $sid );
               $window->Unbusy
             }
                                     );
   }
}
 
=head2 gh_roll_name
 
Produces Rollback report.
 
=cut

db/orac_Oracle.pm  view on Meta::CPAN

2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
   my $clr_b = $dmb->Button(  -image=>$img,
                              -command=>sub{
 
                      $window->Busy(-recurse=>1);
 
                      $w_explain[2]->delete('1.0','end');
                      $w_holders[0] = $main::v_sys;
                      $w_holders[1] = $main::lg{explain_help};
                      $expl_butt->configure(-state=>'normal');
 
                      $window->Unbusy;
                                           }
                           )->pack(side=>'left');
 
   $balloon->attach($clr_b, -msg => $main::lg{clear} );
}
$self->window_exit_button(\$dmb, \$window, 1, \$balloon, );
 
# Set counter up
 
my $i;

db/orac_Oracle.pm  view on Meta::CPAN

2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
                  my @v_osuser = split('\:', $first_string[1]);
                  my @v_username = split('\:', $first_string[0]);
                  my @v_sid = split('\:', $first_string[2]);
 
                  $self->who_what( 1,
                                   $v_osuser[1],
                                   $v_username[1],
                                   $v_sid[1]
                                 );
                  $self->{Main_window}->Unbusy
               }
                       );
      $self->{Text_var}->insert('end', "\n");
   }
 
   # And finally, thank goodness, the actual report.
 
   $self->show_sql( 'wait_hold' , '1',
                    $main::lg{who_hold} );
}

db/orac_Oracle.pm  view on Meta::CPAN

2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
      $scroll_box->bind(
 
            '<Double-1>',
            sub$self->{Main_window}->Busy(-recurse=>1);
                  my @stat_str = split('\:', $scroll_box->get('active') );
 
                  $self->who_what( 2,
                                   $stat_str[1],
                                   "${l_stat_title}:$stat_str[1]",
                                 );
                  $self->{Main_window}->Unbusy
               }
                       );
 
      $self->{Text_var}->insert('end', "\n");
   }
   $self->show_sql( 'sess_curr_max_mem' , '1',
                    $main::lg{mts_mem} );
 
}

db/orac_Oracle.pm  view on Meta::CPAN

3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
                         $final_txt =
                            $final_txt .
                            sprintf"%5d: %s",
                                      $line_counter,
                                      $lines_of_txt[($line_counter - 1)]
                                   );
                         $line_counter++;
                      }
 
                      $self->see_sql($window,$final_txt,$label_text);
                      $window->Unbusy;
 
                                        }
 
                          )->pack(-side=>'left');
 
$balloon->attach($b, -msg => $main::lg{lines} );
 
if ( ($l_hlst eq 'Tables') || ($l_hlst eq 'Indexes') ){
 
   if ($l_hlst eq 'Tables') {
 
         my $b = $menu_bar->Button(-image=>$b_images{form},
                                  -command=> sub{
 
                               $window->Busy(-recurse=>1);
 
                               $self->univ_form($owner,
                                                $generic,
                                                'form');
 
                               $window->Unbusy
 
                                                }
 
                                   )->pack(-side=>'left');
 
         $balloon->attach($b, -msg => $main::lg{form});
 
         $b = $menu_bar->Button( -image=>$b_images{sizeindex},
                                 -command=> sub {
 
                           $window->Busy(-recurse=>1);
                           $self->univ_form($owner,
                                            $generic,
                                            'index'
                                           );
                           $window->Unbusy
 
                                                }
 
                               )->pack(-side=>'left');
 
         $balloon->attach($b, -msg => $main::lg{sizeindex});
 
   }
   my @tablist;
   my @tablist_2;

db/orac_Oracle.pm  view on Meta::CPAN

3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
   } elsif ($l_hlst eq 'Views'){
 
         my $b = $menu_bar->Button(
            -image=>$b_images{form},
            -command=>sub$window->Busy(-recurse=>1);
 
                            $self->univ_form(  $owner,
                                               $generic,
                                               'form'
                                            );
                            $window->Unbusy }
 
                                 )->pack(-side=>'left');
 
         $balloon->attach($b, -msg => $main::lg{form});
   }
 
   $self->window_exit_button(\$menu_bar, \$window, 1, \$balloon, );
 
   main::iconize( $window );
 
   $l_mw->Unbusy;
}
 
=head2 tab_det_orac
 
Produces simple graphical representations of complex percentage style reports.
 
=cut
 
sub tab_det_orac {

db/orac_Oracle.pm  view on Meta::CPAN

3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
$eraser = $window->Photo(-file=>"$FindBin::RealBin/img/eraser.gif");
 
$b = $dev_menu->Button(-image=>$eraser,
                       -command=>sub{
 
     $window->Busy(-recurse=>1);
     $self->{Main_window}->Busy(-recurse=>1);
 
     $text->delete('1.0','end');
 
     $self->{Main_window}->Unbusy;
     $window->Unbusy;
                                    }
 
                      )->pack(side=>'right');
 
$balloon->attach($b, -msg => $main::lg{clear});
 
my $dev_2_menu;
my $balloon2;
$self->create_balloon_bars(\$dev_2_menu, \$balloon2, \$window, );

db/orac_Oracle.pm  view on Meta::CPAN

3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
      main::iconize($window);
   }
   $window->{text}->insert('end', @res);
}
$sth->finish;
if($detected == 0){
   $self->{Main_window}->Busy(-recurse=>1);
   main::mes($self->{Main_window},$main::lg{no_rows_found});
   $self->{Main_window}->Unbusy;
} else {
 
   $window->{text}->selectionSet(0);
   $window->{text}->pack();
 
   $window->{text}->bind(
      '<Double-1>',
      sub{
           $window->Busy(-recurse=>1);
           $self->{Main_window}->Busy(-recurse=>1);

db/orac_Oracle.pm  view on Meta::CPAN

3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
              # What is the current mark?
 
              $current_index = $text->index('current');
 
              $text->insert('end', $sql . "\n\n");
 
              $self->search_text(\$text, $current_index);
 
              $text->see( q{end linestart});
 
              $self->{Main_window}->Unbusy;
              $window->Unbusy;
            }
                                   );
   }
}
 
=head2 dev_jpeg_tunen
 
Creates various tuning pies and inserts them into a pop-up screen.
 
=cut

db/orac_Oracle.pm  view on Meta::CPAN

4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
      $flip_switch = 0;
   } else {
      $flip_switch = 1;
   }
}
$sth->finish;
 
if($detected == 0){
   $self->{Main_window}->Busy(-recurse=>1);
   main::mes($self->{Main_window},$main::lg{no_rows_found});
   $self->{Main_window}->Unbusy;
} else {
   $csth->finish;
   $rsth = $dbh->prepare(
      'SELECT BARCHART FROM bars ' .
      'WHERE WIDTH=700 AND HEIGHT=300 ' .
      'AND X-AXIS=\'' . $x_axis .
      '\' AND Y-AXIS=\'' . $y_axis . '\' AND ' .
      'X-ORIENT=\'VERTICAL\' AND ' .
      'FORMAT=\'JPEG\' AND ' .
      'TITLE = \'' . $title_element .

db/orac_Oracle.pm  view on Meta::CPAN

4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
                              )->pack(-expand=>'yes',-fill=>'both');
 
      main::iconize($window);
   }
   $window->{text}->insert('end', @res);
}
$sth->finish;
if($detected == 0){
   $self->{Main_window}->Busy(-recurse=>1);
   main::mes($self->{Main_window},$main::lg{no_rows_found});
   $self->{Main_window}->Unbusy;
} else {
 
   $window->{text}->pack();
 
   $window->{text}->bind(
      '<Double-1>',
      sub{
           $window->Busy(-recurse=>1);
           $self->{Main_window}->Busy(-recurse=>1);

db/orac_Oracle.pm  view on Meta::CPAN

4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
              if ( $action eq "totalspace" ){
                 print "totalspace\n";
              }
              elsif ( $action eq "tables" ){
                 print "tables\n";
              }
              elsif ( $action eq "indexes" ){
                 print "indexes\n";
              }
 
              $self->{Main_window}->Unbusy;
              $window->Unbusy;
            }
                                   );
   }
}
 
sub search_text {
   my ($self, $t, $curr) = @_;
 
   my @blue_bits = ( 'ADD_MONTHS', 'ALTER', 'AND', 'AS', 'ASCII',
                     'AVG', 'BEGIN', 'BIT_LENGTH', 'BLOCK', 'BODY',

db/orac_Oracle.pm  view on Meta::CPAN

4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
      $self->dev_jpeg_tabsp(\$canvas,
                           \$canvas_id,
                           'EXTENTID',
                           $datafile
                          );
      $canvas->configure(
         -scrollregion=>[ $canvas->bbox("all") ]);
      $canvas->pack(-expand=>'yes',-fill=>'both');
 
      $self->{Main_window}->Unbusy;
      $window->Unbusy;
   }
               },
-width=> 80,
-height=> 20,
-font=>$main::font{name},
-foreground=> $main::fc,
-background=> $main::bc,
-command=> sub {
 
      $self->show_or_hide_tabsp( \$text2,

db/orac_Oracle.pm  view on Meta::CPAN

4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
   #                                        $generic || $owner,
   #                                      ]
   #                                    ],
   #                          );
   #$text_lines = $obj->create ;
 
   # Finally, pump out the monkey
 
   $$text2_ref->insert('end', "$owner $generic");
 
   $l_mw->Unbusy;
}
 
=head2 post_tabsp
 
This subroutine is called with the results from show_sql() to allow DB
modules to "post process" the output, if required, before it is analyzed
to be shown.
This is useful for turning numeric flags into words, and other such DB
dependent things.
This generic one does NOTHING!

db/orac_Oracle.pm  view on Meta::CPAN

4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
      $flip_switch = 0;
   } else {
      $flip_switch = 1;
   }
}
$sth->finish;
 
if($detected == 0){
   $self->{Main_window}->Busy(-recurse=>1);
   main::mes($self->{Main_window},$main::lg{no_rows_found});
   $self->{Main_window}->Unbusy;
} else {
   $csth->finish;
 
   if ($chart_width < 700){
      $chart_width = 700;
   }
 
   $rsth = $dbh->prepare(
      'SELECT BARCHART FROM bars ' .
      'WHERE WIDTH=' . $chart_width . ' AND HEIGHT=300 ' .

db/orac_Sybase.pm  view on Meta::CPAN

248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
($owner, $generic, $dum) = split("\\$l_gen_sep", $input);
 
my $loc_g_hlst;
my $cm = $self->f_str($l_hlst ,'99');
 
if ($l_hlst eq 'Segments' || $l_hlst eq 'All Objects') {
    $self->f_clr( $main::v_clr );
    $self->{Database_conn}->do("use $owner");
    my $reportHeader = ($l_hlst eq 'Segments') ? "Segment Allocation" : "All Objects in $owner";
    $self->show_sql($l_hlst, '99', $reportHeader, $generic, $owner);
    $l_mw->Unbusy;
    return;
} else {
    $cm = ($l_hlst eq 'Groups') ? sprintf($cm, $generic, $generic) : sprintf($cm, $generic);
}
 
my $second_sth = $self->{Database_conn}->prepare( $cm ) ||
                   die $self->{Database_conn}->errstr;
# Deal with SQL print returns through the global message handler
$main::conn_comm_flag = 999;
$second_sth->execute;

db/orac_Sybase.pm  view on Meta::CPAN

355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
            
           print L_TEXT " ";
           $i++;
       }
       print L_TEXT "\n\n  ";
        
       $b = $menu_bar->Button(-image=>$b_images{form},
                              -command=>
                              sub{$window->Busy(-recurse=>1);
                                  $self->univ_form($window,$owner,$generic,'form');
                                  $window->Unbusy }
                              )->pack(-side=>'left');
       $balloon->attach($b, -msg => $main::lg{form});
        
       $i++;
        
       $b $menu_bar->Button(-image=>$b_images{sizeindex},
                               -command=> sub{$window->Busy(-recurse=>1);
                                              $self->univ_form($window,$owner,$generic,'index');
                                              $window->Unbusy }
                               )->pack(-side=>'left');
        
       $balloon->attach($b, -msg => $main::lg{build_index});
       print L_TEXT " ";
   } elsif($l_hlst eq 'Procedures' || $l_hlst eq 'Triggers') {
       $window->{ed_button} = $menu_bar->Button(-image=>$b_images{form},
                             -command=>sub{
                                 $window->{text}->configure(-state=>'normal');
                                 $window->{rc_button}->configure(-state=>'normal');
                                 $window->{ed_button}->configure(-state=>'disabled');
                             }
                             )->pack(-side=>'left');
       $balloon->attach($window->{ed_button}, -msg => 'Edit');
        
       $window->{rc_button} =  $menu_bar->Button(-image=>$b_images{sizeindex},
                               -command=> sub{$window->Busy(-recurse=>1);
                                              $window->{text}->configure(-state=>'disabled');
                                              $window->{rc_button}->configure(-state=>'disabled');
                                              $window->{ed_button}->configure(-state=>'normal');
                                              $self->change_sql($window,$generic, $l_hlst);
                                              $window->Unbusy },
                               -state=>'disabled'
                               )->pack(-side=>'left');
        
       $balloon->attach($window->{rc_button}, -msg => 'Recompile');
   } elsif ($l_hlst eq 'Views'){
      print L_TEXT "\n\n  ";
      $b = menu_bar->Button(-text=>$main::lg{form},
                            -command=>sub{$window->Busy(-recurse=>1);
                                          $self->univ_form($window,$owner,$generic,'form');
                                          $window->Unbusy }
                            )->pack(-side=>'left');
      $balloon->attach($b, -msg => $main::lg{form});
  }
    
   print L_TEXT "\n\n";
   $self->window_exit_button(\$menu_bar, \$window );
   $window->{text}->configure(-state=>'disabled');
   main::iconize( $window );
   $l_mw->Unbusy;
}
 
sub change_sql {
    my $self = shift;
     
    my ($loc_d,$obj,$l_hlst) = @_;
 
    chop $l_hlst;
    my $sp_text = $loc_d->{text}->get("1.0", "end");
    my $drop_sql = qq{ drop $l_hlst $obj };

db/orac_Sybase.pm  view on Meta::CPAN

449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
my $expl_butt = $dmb->Button(-text=>$main::lg{explain},
                             -command=>sub{ $self->explain_it();}
                             )->pack(side=>'left');
 
$dmb->Button(-text=>$main::lg{clear},
             -command=>sub{
                   $window->Busy(-recurse=>1);
                   $sql_txt->delete('1.0','end');
                   my $w_user_name = $main::v_sys;
                   $expl_butt->configure(-state=>'normal');
                   $window->Unbusy;
               }
            )->pack(side=>'left');
 
$dmb->Button(-text=>$main::lg{exit},
             -command=> sub{
                   $window->destroy();
                   $window->Busy(-recurse=>1);
                   my $cm = $self->f_str('explain_plan','3');
                   $self->{Database_conn}->do($cm);
                   $cm = $self->f_str('explain_plan','4');
                   $self->{Database_conn}->do($cm);
                   $window->Unbusy;
                   undef $main::conn_comm_flag;
               }
            )->pack(-side=>'left');
 
$dmb->Label(-text=>"     Use ",-borderwidth=>2,-relief=>'flat')->pack(-side=>'left',-anchor=>'w');
 
# need to get a db list for dropdown
my $sth;
my $cm = "select db_name()";
my @list = ();

db/orac_Sybase.pm  view on Meta::CPAN

1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
                  -foreground=>$main::fc,
                  -background=>$main::ec)->pack();
 
my $l3 = $d->Label(-text=>"Seconds Since Last Run:", justify=>"left");
my $ps3 = $d->add("Entry",-cursor=>undef,
                     -textvariable=>\$data[2],
                     -state=>'disabled',
                     -foreground=>$main::fc,
                     -background=>$main::ec)->pack();
 
my $l4 = $d->Label(-text=>"CPU busy (sec):", justify=>"right");
my $ps4 = $d->add("Entry",-cursor=>undef,
                    -textvariable=>\$data[3],
                    -state=>'disabled',
                    -foreground=>$main::fc,
                    -background=>$main::ec)->pack();
 
my $l5 = $d->Label(-text=>"IO Busy:", justify=>"left");
my $ps5 = $d->add("Entry",-cursor=>undef,
                    -textvariable=>\$data[4],
                    -state=>'disabled',

db/orac_Sybase.pm  view on Meta::CPAN

1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
   if ($uf_type eq 'index'){
      $uf_txt = 'Build Index';
   } else {
      $uf_txt = $main::lg{sel_info};
   }
 
   $bb->Button( -text=>$uf_txt,
                -command=>sub{ $bd->Busy(-recurse=>1);
                               $self->selector($bd,$uf_type);
                               $bd->Unbusy}
              )->pack (-side=>'right',
                       -anchor=>'e');
 
   $bd->Show;
}
 
sub selector {
 
   my $self = shift;

help/DBATabspace.txt  view on Meta::CPAN

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
datafiles. Select either the tablespace or a datafile and it would open two
panels on the right 2/3 of the window. The top half was divided into two
parts. On the left was a summary of the currently selected segment and
extent. It listed the size, in blocks, of the extent and the segment. On the
right of that summary was a list of segments with segment type, number of
extents and size. Below, in the lower right quandrant was a graphic display.
The graphic used three colors. Each extent had a fine black line border. One
color for unallocated space, one for the currently selected segment and all
its extents, and a third for allocated, but not selected space. The extents
were rectangles arranged in horizontal stripes. The extent rectangles were
scaled to fit the window. As a result a busy tablespace might have so little
space for each extent that the extents ran together to create a mass of
black border stripes. The new version of the tablespace map, now
incorporated with the storage manager,  scrolls but I think the scale is
fixed. That makes it difficult to see the big picture. Not sure which I
prefer.
 
I may be able to install the old version to get you a screen shot of the
earlier tablespace manager. I'll have to remove all of Oracle from my PC to
install the old version. It's from single NT ORACLE_HOME days and won't
install if you have a later installation already on the machine. I'm

orac_Base.pm  view on Meta::CPAN

1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
{
   $use_img = 0;
}
 
my $b = $$menu_ref->Button(
 
                       -command=> sub{
 
                          $$win_ref->Busy(-recurse=>1);
                          $self->see_sql($$win_ref,$$cm_ref);
                          $$win_ref->Unbusy;
 
                                     }
 
                          )->pack(-side=>'left');
 
if ($use_img)
{
   my $img;
   $self->get_img( $win_ref, \$img, 'sql' );

orac_FileSelect.pm  view on Meta::CPAN

341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
   # action.
 
   main::mes($self->{window},
             qq{Cannot change to the directory }  .
             $self->{selectPath} . qq{\. \nPermission denied?}
     );
 
   return;
}
 
# Turn on the busy cursor.
 
$self->{window}->Busy(-recurse=>1);
$self->{window}->idletasks;
 
$self->{window}->{text}->DeleteAll;
 
# Make the dir list
 
my %hasDoneDir;

orac_FileSelect.pm  view on Meta::CPAN

390
391
392
393
394
395
396
397
398
399
400
401
402
403
         }
         else
         {
            $image = $fileImage;
         }
         $self->{window}->{text}->Add($image, $ffile);
         $hasDoneFile{$ffile}++;
      }
   }
   $self->{window}->{text}->Arrange;
   $self->{window}->Unbusy;
}
 
1;

orac_Monitor.pm  view on Meta::CPAN

1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
$$mon_text_ref = 'Preparing for Launch...';
 
$$stop_ref = 1;
 
# Run some checking Baby!
 
$self->{mon_win}->Busy(-recurse=>1);
 
$self->check_the_monitor;
 
$self->{mon_win}->Unbusy;
 
while($$stop_ref)
{
   select(undef, undef, undef, $countdown_amount);
   $$countdown_ref = $$countdown_ref - $countdown_amount;
 
   my $countdown_bit = sprintf("%5.2f", $$countdown_ref);
   $$mon_text_ref = 'T-minus ' . $countdown_bit . ' (secs)';

orac_Monitor.pm  view on Meta::CPAN

1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
}
 
if (($$stop_ref) && ($$countdown_ref <= 0.05)) # $countdown_amount/2 ?
{
   $$mon_text_ref = 'Initialising...';
 
   # Lock out the screen, then Launch, Launch, Launch!!!
 
   $self->{mon_win}->Busy;
   $self->check_the_monitor;
   $self->{mon_win}->Unbusy;
 
   if ( Tk::Exists($$prog_bar_ref) )
   {
      $$prog_bar_ref->update();
   }
   else
   {
      last;
   }

orac_Shell.pm  view on Meta::CPAN

703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
        # now execute it;
        $self->execute_sql();
 
        # Remove the exec tag
        $self->untag_entry( q{Exec} );
 
        # Deal with results.
        $self->handle_results;
 
        # Remove the busy pointer.
        $self->dbiwd->Unbusy;
 
        return;
}
 
#
# Display a dialog box to the user.  Using this method until
# we create a dialog handler in the core function.
#
sub message_dialog {
        my ($self, $title, $msg) = @_;

orac_dba.pl  view on Meta::CPAN

1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
      main::del_Jareds_tools(\$main::jareds_tool);
      main::config_menu();
      main::Jareds_tools();
      $main::orac_orig_db = $main::orac_curr_db_typ;
   }
}
 
=head2 bz
 
Makes the main GUI pointer go busy.
 
=cut
 
sub bz {
   # Make the main GUI pointer go busy
   $main::mw->Busy(-recurse=>1);
}
 
=head2 ubz
 
Makes the main GUI pointer go Un-busy.
 
=cut
 
sub ubz {
   # Make the main GUI pointer normalise to unbusy
   $main::mw->Unbusy;
}
 
sub mes {
   # Produce the box that contains viewable Error
 
   my $d = $_[0]->DialogBox();
 
   my $displayer;
 
   if (length($_[1]) > 200)

sql/Oracle/dispatch_stuff.1.sql  view on Meta::CPAN

1
2
3
4
select Network,
round((SUM(busy) / (SUM(busy) + SUM(idle))),20) "Busy_Rate"
from v$dispatcher
GROUP by network

sql/Oracle/gh_summ_sess.1.sql  view on Meta::CPAN

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
select 'log file space/switch',sum(time_waited)/100
from v$system_event
where event like 'log file space/switch'
union
select 'latch waits',sum(time_waited)/100
from v$system_event
where event like 'latch free'
union
select 'Buffer waits',sum(time_waited)/100
from v$system_event
where event in ('write complete waits','free buffer waits','buffer busy waits')
union
select 'SQL*Net waits (inc remote SQL)',sum(time_waited)/100
from v$system_event
where event like 'SQL*Net%'
and event !='SQL*Net message from client'
union
select 'lock waits',sum(time_waited)/100
from v$system_event
where event = 'enqueue'
union

sql/Oracle/gh_summ_sess.1.sql  view on Meta::CPAN

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
union
select 'Other waits (non-idle)',sum(time_waited)/100
from v$system_event
where event not in ('Null event','client message','smon timer',
'rdbms ipc message','pmon timer','WMON goes to sleep',
'virtual circuit status','dispatcher timer',
'SQL*Net message from client',
'parallel query dequeue wait','latch free',
'enqueue','write complete waits',
'free buffer waits',
'buffer busy waits','pipe gets',
'Null event','client message','smon timer',
'rdbms ipc message','pmon timer','WMON goes to sleep',
'virtual circuit status','dispatcher timer',
'SQL*Net message from client',
'parallel query dequeue wait','latch free',
'enqueue','write complete waits',
'free buffer waits',
'buffer busy waits','pipe gets','slave wait','PL/SQL lock timer',
'null event','Null event','rdbms ipc reply',
'Parallel Query Idle Wait - Slaves',
'KXFX: Execution Message Dequeue - Slave','slave wait')
and event not like 'db file%'
and event not like 'log file%'
and event not like 'SQL*Net%'
order by 1

sql/Sybase/quickstats.10  view on Meta::CPAN

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
                                         where cntrltype=0
                                                 and status & 64 = 64
                                                 and status & 512 != 512)
begin
         select @mirror_name='Broken'
end
else select @mirror_name='Ok'
 
declare @lc float, @li float, @lidle float, @ldate datetime
select @ldate=max(date) from sybsystemprocs..record
select @lc = busy, @li =io, @lidle =idle
from   sybsystemprocs..record
where  date=@ldate
 
declare @ms_per_tick float
select @ms_per_tick = convert(int,@@timeticks/1000)
 
/* numbers here are scaled to give percents  */
select 
        @lc                     = ( @@cpu_busy * @ms_per_tick) / 1000 - @lc,
        @li                     = ( @@io_busy * @ms_per_tick) / 1000 - @li,
        @lidle          = ( @@idle * @ms_per_tick) / 1000 - @lidle
 
declare @sumtimes float
select  @sumtimes =   @lc + @li +@lidle
 
if @starttime is not null
          exec   sp__datediff @starttime,'m',@datestmp output
else select @datestmp=@sumtimes/60.0
 
if @sumtimes=0

sql/Sybase/quickstats.10  view on Meta::CPAN

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
if @noconvert is not null
begin
        select
                        blocks=@blk,
                        conn=@conn,
                        ctime=datediff(ms,@time1,getdate()),
                        locks=@locks,
                        run=@runnable,
                        tlock=@tlock,
                        str(convert(float,(100*@lc))/@sumtimes,5,2) "%busy",
                        str(convert(float,(100*@li))/@sumtimes,5,2)  "%io ",
                        str(convert(float,(100*@lidle))/@sumtimes,5,2) "%idle",
                        "mirror"=@mirror_name,
                        mins=@datestmp
end
else
begin
 
        select
                        blks=convert(char(4),@blk),

sql/Sybase/quickstats.492  view on Meta::CPAN

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
if @noconvert is not null
begin
        select
                        blocks=@blk,
                        conn=@conn,
                        ctime=datediff(ms,@time1,getdate()),
                        locks=@locks,
                        run=@runnable,
                        tlock=@tlock,
                        busy=@@cpu_busy,
                        io=@@io_busy,
                        idle=@@idle,
                        "mirror"=@mirror_name,
                        mins=@datestmp
end
else
begin
 
        select
                        blks=convert(char(4),@blk),
                        conn=convert(char(4),@conn),
                        ctime=convert(char(6),datediff(ms,@time1,getdate())),
                        locks=convert(char(5),@locks),
                        run=convert(char(4),@runnable),
                        tlock=convert(char(5),@tlock),
                        cpu=convert(char(9),@@cpu_busy),
                        io=convert(char(6),@@io_busy),
                        idle=convert(char(9),@@idle),
                        /* "mirror"=@mirror_name, */
                        minutes=ltrim(str(@datestmp,10,1))
end
go
grant execute on sp__quickstats to public
go

sql/Sybase/record.10  view on Meta::CPAN

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
           where  name = "record"
           and    type = "U")
begin
   exec sp_rename record,record_backup
end
else
begin
create table record_backup
(
        date datetime,
        busy                    int ,
        io                      int ,
        idle                    int ,
        connections int ,
        packet_in                       int ,
        packet_out                      int ,
        total_read              int ,
        total_write             int ,
        total_errors                    int ,
        description char(30)
)

sql/Sybase/record.10  view on Meta::CPAN

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
if exists (select * from sysobjects
           where  name = "sp__show_record"
           and    type = "P")
   drop proc sp__show_record
go
 
/*---------------------------------------------------------------------------*/
create table record
(
        date datetime,
        busy                    int ,
        io                      int ,
        idle                    int ,
        connections int ,
        packet_in                       int ,
        packet_out                      int ,
        total_read              int ,
        total_write             int ,
        total_errors                    int ,
        description char(30)
)

sql/Sybase/record.10  view on Meta::CPAN

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
AS
BEGIN
 
        declare @dt datetime, @b int, @i int, @id int, @c int
                                ,@pi int,@po int,@tr int,@tw int,@te int
        declare @l_dt datetime, @l_b int, @l_i int, @l_id int, @l_c int
                                ,@l_pi int,@l_po int,@l_tr int,@l_tw int,@l_te int
 
   create table #results (
                dt datetime,
                busy int,
                io   int,
                idle int,
                conn int,
                pin  int ,
                pout int ,
                rd   int ,
                wr   int ,
                err  int ,
                notes char(10))

sql/Sybase/record.10  view on Meta::CPAN

109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
from   record
where description=@desc
and   datediff(dd,date,getdate())<@ndays ) <= 1
begin
        print "Insufficient Records To Make Report"
        return
end
 
declare record_results cursor for
select  date,
                        busy,
                        io,
                        idle,
                        connections ,
                        packet_in,packet_out,total_read,total_write,total_errors
from   record
where description=@desc
and   datediff(dd,date,getdate())<@ndays
order by date
 
open record_results

sql/Sybase/record.10  view on Meta::CPAN

148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
                select @l_b=@b, @l_i=@i, @l_id=@id, @l_c=@c
                                ,@l_pi=@pi , @l_po=@po , @l_tr=@tr , @l_tw=@tw , @l_te=@te
        end
 
        close record_results
        deallocate cursor record_results
 
        if @print_long is null
                select date=convert(char(8),dt,1),
                        str(convert(float,(100*busy))/(busy+io+idle),5,2) "%busy",
                        str(convert(float,(100*io)) /(busy+io+idle),5,2)  "%io ",
                        str(convert(float,(100*idle))/(busy+io+idle),5,2) "%idle",
                        connections=conn  ,notes
                from #results
                order by date
        else
                select date=convert(char(8),dt,1),
                        str(convert(float,(100*busy))/(busy+io+idle),5,2) "%busy",
                        str(convert(float,(100*io)) /(busy+io+idle),5,2)  "%io ",
                        str(convert(float,(100*idle))/(busy+io+idle),5,2) "%idle",
                        conn  ,
                        pin  ,
                        pout ,
                        rd   ,
                        wr   ,
                        err  ,
                        notes
                from #results
                order by date
END
go
 
/* Inserttype = 1 then 1 row per day */
/*                        = 2 then 2 rows period  */
create proc sp__add_record( @desc char(30)="Daily Record", @inserttype int=1,
        @dont_format char(1) = null
        )
AS
BEGIN
                declare @users int, @runnable int, @busy int, @io int,
                        @idle int, @connections int, @packet_in int, @packet_out int,
                        @total_read int, @total_write int, @total_errors int, @now datetime,
                        @curdate datetime
 
                if @inserttype=1
                begin
                        select @curdate=convert(datetime,convert(char(8),getdate(),1))
 
                        delete sybsystemprocs..record
                        where date = @curdate

sql/Sybase/record.10  view on Meta::CPAN

211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
        and    date <> @now
end
 
delete sybsystemprocs..record
where datediff(dd,date,getdate())>90
and description=@desc
 
exec sp__stat2
  @users                output,
  @runnable     output,
  @busy                 output,
  @io                   output,
  @idle                 output,
  @connections output,
  @packet_in            output,
  @packet_out           output,
  @total_read           output,
  @total_write  output,
  @total_errors                 output,
  @now                  output
 
 
insert sybsystemprocs..record
select
        @curdate,
        @busy           ,
        @io                     ,
        @idle           ,
        @connections ,
        @packet_in                      ,
        @packet_out             ,
        @total_read             ,
        @total_write            ,
        @total_errors           ,
        @desc

sql/Sybase/record.10  view on Meta::CPAN

248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
END
go
print "THE NEXT PROCEDURE MIGHT PRINT AN ERROR 2007 (sysdepends) - Its Recrusive!"
go
create proc sp__monitor( @desc char(30)="Daily Record",
        @dont_format char(1) = null
        )
AS
BEGIN
                declare @cur_time datetime, @users int, @runnable int, @busy int, @io int,
                        @idle int, @connections int, @packet_in int, @packet_out int,
                        @total_read int, @total_write int, @total_errors int, @now datetime
 
                declare @l_time datetime, @l_busy int, @l_io int,
                        @l_idle int, @l_connections int, @l_packet_in int, @l_packet_out int,
                        @l_total_read int, @l_total_write int, @l_total_errors int
 
                select
                        @l_time=date,
                        @l_busy=busy,
                        @l_io=io ,
                        @l_idle=idle,
                        @l_connections=connections,
                        @l_packet_in=packet_in,
                        @l_packet_out=packet_out,
                        @l_total_read=total_read,
                        @l_total_write=total_write,
                        @l_total_errors=total_errors
                from record
                where date = convert(datetime,convert(char(8),getdate(),1))

sql/Sybase/record.10  view on Meta::CPAN

284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
                        exec sp__add_record
                        waitfor delay '00:00:05'
                        exec sp__monitor
                        return
                end
 
                /* Current Stats */
                exec sp__stat2
                  @users                        output,
                  @runnable     output,
                  @busy                         output,
                  @io                   output,
                  @idle                         output,
                  @connections output,
                  @packet_in    output,
                  @packet_out   output,
                  @total_read   output,
                  @total_write  output,
                  @total_errors                 output,
                  @cur_time                     output
 
                /* print some info */
                declare @secs int
                select @secs = datediff(ss,@l_time,@cur_time)
                create table #r ( text varchar(127) )
                insert #r select "Number Of Users ="+convert(varchar(8),@users)
                insert #r select "Seconds Since Last Run ="+convert(varchar(8),@secs)
                insert #r select "Cpu Busy ="+convert(char(4),@busy-@l_busy)
                insert #r select " Io Busy ="+convert(char(4),@io-@l_io)
                select * from #r
 
                /* save some stats for next time */
                delete sybsystemprocs..record
                where date = convert(datetime,convert(char(8),getdate(),1))
                and description=@desc
 
                insert sybsystemprocs..record
                select
                        convert(datetime,convert(char(8),getdate(),1)),
                        @busy           ,
                        @io                     ,
                        @idle           ,
                        @connections ,
                        @packet_in                      ,
                        @packet_out             ,
                        @total_read             ,
                        @total_write            ,
                        @total_errors           ,
                        @desc
END

sql/Sybase/record.492  view on Meta::CPAN

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
           where  name = "record"
           and    type = "U")
begin
   exec sp_rename record,record_backup
end
else
begin
create table record_backup
(
        date datetime,
        busy                    int ,
        io                      int ,
        idle                    int ,
        connections int ,
        packet_in                       int ,
        packet_out                      int ,
        total_read              int ,
        total_write             int ,
        total_errors                    int ,
        description char(30)
)

sql/Sybase/record.492  view on Meta::CPAN

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
if exists (select * from sysobjects
           where  name = "sp__show_record"
           and    type = "P")
   drop proc sp__show_record
go
 
/*---------------------------------------------------------------------------*/
create table record
(
        date datetime,
        busy                    int ,
        io                      int ,
        idle                    int ,
        connections int ,
        packet_in                       int ,
        packet_out                      int ,
        total_read              int ,
        total_write             int ,
        total_errors                    int ,
        description char(30)
)

sql/Sybase/record.492  view on Meta::CPAN

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
AS
BEGIN
 
        declare @dt datetime, @b int, @i int, @id int, @c int
                                ,@pi int,@po int,@tr int,@tw int,@te int
        declare @l_dt datetime, @l_b int, @l_i int, @l_id int, @l_c int
                                ,@l_pi int,@l_po int,@l_tr int,@l_tw int,@l_te int
 
   create table #results (
                dt datetime,
                busy int,
                io   int,
                idle int,
                conn int,
                pin  int ,
                pout int ,
                rd   int ,
                wr   int ,
                err  int ,
                notes char(10))

sql/Sybase/record.492  view on Meta::CPAN

118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
END
go
 
/* Inserttype = 1 then 1 row per day */
/*                        = 2 then 2 rows period  */
create proc sp__add_record( @desc char(30)="Daily Record", @inserttype int=1,
        @dont_format char(1) = null
        )
AS
BEGIN
                declare @users int, @runnable int, @busy int, @io int,
                        @idle int, @connections int, @packet_in int, @packet_out int,
                        @total_read int, @total_write int, @total_errors int, @now datetime,
                        @curdate datetime
 
                if @inserttype=1
                begin
                        select @curdate=convert(datetime,convert(char(8),getdate(),1))
 
                        delete master..record
                        where date = @curdate

sql/Sybase/record.492  view on Meta::CPAN

151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
        and    date <> @now
end
 
delete master..record
where datediff(dd,date,getdate())>90
and description=@desc
 
exec sp__stat2
  @users                output,
  @runnable     output,
  @busy                 output,
  @io                   output,
  @idle                 output,
  @connections output,
  @packet_in            output,
  @packet_out           output,
  @total_read           output,
  @total_write  output,
  @total_errors                 output,
  @now                  output
 
 
insert master..record
select
        @curdate,
        @busy           ,
        @io                     ,
        @idle           ,
        @connections ,
        @packet_in                      ,
        @packet_out             ,
        @total_read             ,
        @total_write            ,
        @total_errors           ,
        @desc

sql/Sybase/record.492  view on Meta::CPAN

188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
END
go
print "THE NEXT PROCEDURE MIGHT PRINT AN ERROR 2007 (sysdepends) - Its Recrusive!"
go
create proc sp__monitor( @desc char(30)="Daily Record",
        @dont_format char(1) = null
        )
AS
BEGIN
                declare @cur_time datetime, @users int, @runnable int, @busy int, @io int,
                        @idle int, @connections int, @packet_in int, @packet_out int,
                        @total_read int, @total_write int, @total_errors int, @now datetime
 
                declare @l_time datetime, @l_busy int, @l_io int,
                        @l_idle int, @l_connections int, @l_packet_in int, @l_packet_out int,
                        @l_total_read int, @l_total_write int, @l_total_errors int
 
                select
                        @l_time=date,
                        @l_busy=busy,
                        @l_io=io ,
                        @l_idle=idle,
                        @l_connections=connections,
                        @l_packet_in=packet_in,
                        @l_packet_out=packet_out,
                        @l_total_read=total_read,
                        @l_total_write=total_write,
                        @l_total_errors=total_errors
                from record
                where date = convert(datetime,convert(char(8),getdate(),1))

sql/Sybase/record.492  view on Meta::CPAN

224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
                        exec sp__add_record
                        waitfor delay '00:00:05'
                        exec sp__monitor
                        return
                end
 
                /* Current Stats */
                exec sp__stat2
                  @users                        output,
                  @runnable     output,
                  @busy                         output,
                  @io                   output,
                  @idle                         output,
                  @connections output,
                  @packet_in    output,
                  @packet_out   output,
                  @total_read   output,
                  @total_write  output,
                  @total_errors                 output,
                  @cur_time                     output
 
                /* print some info */
                declare @secs int
                select @secs = datediff(ss,@l_time,@cur_time)
                create table #r ( text varchar(127) )
                insert #r select "Number Of Users ="+convert(varchar(8),@users)
                insert #r select "Seconds Since Last Run ="+convert(varchar(8),@secs)
                insert #r select "Cpu Busy ="+convert(char(4),@busy-@l_busy)
                insert #r select " Io Busy ="+convert(char(4),@io-@l_io)
                select * from #r
 
                /* save some stats for next time */
                delete master..record
                where date = convert(datetime,convert(char(8),getdate(),1))
                and description=@desc
 
                insert master..record
                select
                        convert(datetime,convert(char(8),getdate(),1)),
                        @busy           ,
                        @io                     ,
                        @idle           ,
                        @connections ,
                        @packet_in                      ,
                        @packet_out             ,
                        @total_read             ,
                        @total_write            ,
                        @total_errors           ,
                        @desc
END

sql/Sybase/stat.sql  view on Meta::CPAN

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
           and    type = "P")
   drop proc sp__stat
 
go
if exists (select * from sysobjects
           where  name = "sp__stat2"
           and    type = "P")
   drop proc sp__stat2
 
go
/* numbers here are in seconds for io, busy, idle */
create proc sp__stat2 (
                  @users                int output,
                  @runnable     int output,
                  @busy                         int output,
                  @io                   int output,
                  @idle                         int output,
                  @connections int output,
                  @pin                  int output,
                  @pout                         int output,
                  @tread                int output,
                  @twrite               int output,
                  @terr                         int output,
                  @now                  datetime output,
                          @dont_format char(1) = null

sql/Sybase/stat.sql  view on Meta::CPAN

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
                  select @users=count(*) 
                  from master..sysprocesses
                  where suid>1
 
                  select @runnable=count(*)
                  from master..sysprocesses
                  where cmd!="AWAITING COMMAND"
                  and suid>1
 
                  select       
                                  @busy                 = ( @@cpu_busy * @ms_per_tick) / 1000,
                                  @io                      = ( @@io_busy * @ms_per_tick) / 1000,
                                  @idle                 = ( @@idle * @ms_per_tick) / 1000,
                                  @connections = @@connections,
                                  @pin                  = @@pack_received,
                                  @pout                         = @@pack_sent,
                                  @tread                = @@total_read,
                                  @twrite               = @@total_write,
                                  @terr                         = @@total_errors,
                                  @now                  = getdate()
 
END
go
 
/* If batch=1 then do in a loop, if it =0 then save and print @ once */
create proc sp__stat( @cnt int=10, @dly int=2, @batch char(1)=null,
        @dont_format char(1) = null
        )
AS
BEGIN
declare @users int, @runnable int, @busy int, @io int,
                        @idle int, @connections int, @pin int, @pout int,
                        @tread int, @twrite int, @terr int, @now datetime
 
declare @last_users int, @last_runnable int, @last_busy int, @last_io int,
                        @last_idle int, @last_connections int, @last_pin int, @last_pout int,
                        @last_tread int, @last_twrite int, @last_terr int, @last_now datetime
 
declare @secs int
 
/* Process Stats */
set nocount on
 
        /* Initialize */
        exec sp__stat2
                  @last_users           output,
                  @last_runnable        output,
                  @last_busy            output,
                  @last_io                      output,
                  @last_idle            output,
                  @last_connections output,
                  @last_pin             output,
                  @last_pout            output,
                  @last_tread           output,
                  @last_twrite  output,
                  @last_terr            output,
                  @last_now                             output

sql/Sybase/stat.sql  view on Meta::CPAN

139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
        waitfor delay '00:01:00'
else
begin
        print "Delay must be 1,2,3,4,5,10,30, or 60"
        return
end
 
exec sp__stat2
          @users                output,
          @runnable     output,
          @busy                         output,
          @io                   output,
          @idle                         output,
          @connections output,
          @pin                  output,
          @pout                         output,
          @tread                output,
          @twrite               output,
          @terr                         output,
          @now                  output
 
select @secs = @busy - @last_busy + @io - @last_io + @idle - @last_idle
if @secs = 0
        select @secs=1
 
if @batch is null
        select
                "Usrs"   = convert(char(4), @users),
                "Run"     = convert(char(3), @runnable),
                "%Cpu"     = convert(char(4), (100*(@busy-@last_busy))/@secs),
                "%IO"      = convert(char(4), (100*(@io-@last_io))/@secs),
                "Secs"    = convert(char(4), datediff(ss,@last_now,@now)),
                "Conn"    = convert(char(4), @connections - @last_connections),
                "Net in"  = convert(char(4), @pin               - @last_pin),
                "Net out" = convert(char(4), @pout              - @last_pout),
                "Reads"   = convert(char(4), @tread     - @last_tread),
                "Writes"  = convert(char(4), @twrite    - @last_twrite),
                "Errors"  = convert(char(4), @terr              - @last_terr)
else
        insert #stats
        select
                          Dt      = getdate(),
                          Usrs   = convert(char(4), @users),
                          Run     = convert(char(3), @runnable),
                          Cpu     = convert(char(4), (100*(@busy - @last_busy))/@secs),
                          IO      = convert(char(4), (100*(@io - @last_io))/@secs),
                          Secs    = convert(char(4), datediff(ss,@last_now,@now)),
                          conn    = convert(char(4), @connections - @last_connections),
                          net_in  = convert(char(4), @pin               - @last_pin),
                          net_out = convert(char(4), @pout              - @last_pout),
                          reads   = convert(char(4), @tread     - @last_tread),
                          writes  = convert(char(4), @twrite    - @last_twrite),
                          errors  = convert(char(4), @terr              - @last_terr)
 
select
          @last_busy            = @busy,
          @last_io                      = @io,
          @last_idle            = @idle,
          @last_connections = @connections,
          @last_pin             = @pin,
          @last_pout            = @pout,
          @last_tread           = @tread,
          @last_twrite  = @twrite,
          @last_terr            = @terr,
          @last_now             = @now

txt/Oracle/tune_wait.1.txt  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Notes:
----------------------------------------------------------------
 
1.    Not all waits are shown.
 
2.    Buffer busy waits may be caused by free list contention
.     for specific tables (create more free lists if neccesary)
.     or by insufficient rollback segments or extents
 
3.    Free buffer waits may be caused by excessive disk sorts
 
4.    Enqueue waits may indicate contention for table or row
.     locks (do you have foreign keys defined without indexes?)
 
5.    Examine v$latch (or run latch_sta.sql) if latch waits are
.     significant



( run in 0.393 second using v1.01-cache-2.11-cpan-d6f9594c0a5 )