view release on metacpan or search on metacpan
8384858687888990919293949596979899100101forum (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
1718192021222324252627282930
$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
739740741742743744745746747748749750751752753754755756757758759
$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
19771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008
-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
20462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083
)->
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
21262127212821292130213121322133213421352136213721382139214021412142214321442145
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
220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240
)->
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
235923602361236223632364236523662367236823692370237123722373237423752376237723782379
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
287528762877287828792880288128822883288428852886288728882889289028912892289328942895
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
29712972297329742975297629772978297929802981298229832984298529862987298829892990
$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
3236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293
$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
3333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363
}
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
355535563557355835593560356135623563356435653566356735683569357035713572357335743575$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
372437253726372737283729373037313732373337343735373637373738373937403741374237433744
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
3786378737883789379037913792379337943795379637973798379938003801380238033804380538063807
# 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
404740484049405040514052405340544055405640574058405940604061406240634064406540664067
$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
41774178417941804181418241834184418541864187418841894190419141924193419441954196
)->
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
4200420142024203420442054206420742084209421042114212421342144215421642174218421942204221
if
(
$action
eq
"totalspace"
){
"totalspace\n"
;
}
elsif
(
$action
eq
"tables"
){
"tables\n"
;
}
elsif
(
$action
eq
"indexes"
){
"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
4393439443954396439743984399440044014402440344044405440644074408440944104411441244134414
$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
466946704671467246734674467546764677467846794680468146824683468446854686468746884689
# $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
481848194820482148224823482448254826482748284829483048314832483348344835483648374838
$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
248249250251252253254255256257258259260261262263264265266267268(
$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
355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
L_TEXT
" "
;
$i
++;
}
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});
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'
){
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});
}
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
449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481my
$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
157515761577157815791580158115821583158415851586158715881589159015911592159315941595
-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
18881889189018911892189318941895189618971898189919001901190219031904190519061907
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
67891011121314151617181920212223242526datafiles. 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
12001201120212031204120512061207120812091210121112121213121412151216121712181219{
$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
341342343344345346347348349350351352353354355356357358359360
# 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
390391392393394395396397398399400401402403
}
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
1064106510661067106810691070107110721073107410751076107710781079108010811082$$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
10921093109410951096109710981099110011011102110311041105110611071108110911101111}
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
703704705706707708709710711712713714715716717718719720721722723724
# 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
11551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192
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
1234select
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
333435363738394041424344454647484950515253select
'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
5758596061626364656667686970717273747576777879808182union
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
52535455565758596061626364656667686970717273747576777879808182
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
84858687888990919293949596979899100101102103104if
@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
6162636465666768697071727374757677787980818283848586878889909192939495if
@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
293031323334353637383940414243444546474849
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
525354555657585960616263646566676869707172if
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
8687888990919293949596979899100101102103104105AS
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
109110111112113114115116117118119120121122123124125126127128129from record
where description=
@desc
and datediff(dd,date,getdate())<
@ndays
) <= 1
begin
"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
148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
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
211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
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
248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278END
go
"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
284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
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
/*
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
293031323334353637383940414243444546474849
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
525354555657585960616263646566676869707172if
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
8687888990919293949596979899100101102103104105AS
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
118119120121122123124125126127128129130131132133134135136137138END
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
151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
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
188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218END
go
"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
224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
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
/*
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
15161718192021222324252627282930313233343536373839
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
4748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
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
@ 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
139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
waitfor delay
'00:01:00'
else
begin
"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
1234567891011121314151617Notes:
----------------------------------------------------------------
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