add verbose mode

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9618 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2011-05-17 17:01:27 +00:00
parent b7f2dba42e
commit 7c49fcb183

View File

@ -18,6 +18,7 @@ BEGIN
use lib "$::XCATROOT/lib/perl";
use xCAT::Utils;
use Getopt::Long;
use strict;
use warnings;
@ -27,6 +28,9 @@ use warnings;
# the XCATDB schema
# Then use runsqlcmd to run the reorg on the list of tables,
# allow read/write by other applications during reorg
#
GetOptions( 'V|verbose' => \$::VERBOSE );
my $cmd="$::XCATROOT/sbin/runsqlcmd \"select tabname from syscat.tables where TABSCHEMA='XCATDB';\"";
my @tablist = xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
@ -52,11 +56,13 @@ foreach my $table (@tablist) {
if ($table =~ /^\s*$/) { # skip blanks
next;
}
if ($table =~ m/[^a-zA-Z0-9_]/) # skip non alphanumeric lines or underscore
if ($table =~ m/[^a-zA-Z0-9_]/) # skip non alphanumeric lines not underscore
{
my $stoppoint=1;
next;
}
if ($::VERBOSE) {
print " Reorg of table $table\n";
}
$cmd="$::XCATROOT/sbin/runsqlcmd \"reorg indexes all for table $table allow write access;\"";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)