From 0acd5a76db2f55490cc90f984640ef3748e3cb14 Mon Sep 17 00:00:00 2001 From: mattf Date: Sun, 10 Sep 2006 06:41:36 +0000 Subject: [PATCH] added several tables to the DBoptimize script removed park_log query from flush script git-svn-id: svn://192.168.202.10@267 3d104415-ff17-0410-8863-d5cf3c621b8a --- bin/AST_DB_optimize.pl | 65 ++++++++++++++++++++++++++++++++++++++++ bin/AST_flush_DBqueue.pl | 12 +------- 2 files changed, 66 insertions(+), 11 deletions(-) diff --git a/bin/AST_DB_optimize.pl b/bin/AST_DB_optimize.pl index 1db3a1d5..579ed663 100644 --- a/bin/AST_DB_optimize.pl +++ b/bin/AST_DB_optimize.pl @@ -169,6 +169,71 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA $sthA->finish(); } + $stmtA = "optimize table vicidial_campaign_stats;"; + if($DB){print STDERR "\n|$stmtA|\n";} + if (!$T) { + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + @aryA = $sthA->fetchrow_array; + if (!$Q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} + $sthA->finish(); + } + + $stmtA = "optimize table vicidial_dnc;"; + if($DB){print STDERR "\n|$stmtA|\n";} + if (!$T) { + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + @aryA = $sthA->fetchrow_array; + if (!$Q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} + $sthA->finish(); + } + + $stmtA = "optimize table vicidial_callbacks;"; + if($DB){print STDERR "\n|$stmtA|\n";} + if (!$T) { + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + @aryA = $sthA->fetchrow_array; + if (!$Q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} + $sthA->finish(); + } + + $stmtA = "optimize table vicidial_agent_log;"; + if($DB){print STDERR "\n|$stmtA|\n";} + if (!$T) { + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + @aryA = $sthA->fetchrow_array; + if (!$Q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} + $sthA->finish(); + } + + $stmtA = "optimize table vicidial_conferences;"; + if($DB){print STDERR "\n|$stmtA|\n";} + if (!$T) { + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + @aryA = $sthA->fetchrow_array; + if (!$Q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} + $sthA->finish(); + } + + $stmtA = "optimize table vicidial_hopper;"; + if($DB){print STDERR "\n|$stmtA|\n";} + if (!$T) { + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + @aryA = $sthA->fetchrow_array; + if (!$Q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} + $sthA->finish(); + } $dbhA->disconnect(); diff --git a/bin/AST_flush_DBqueue.pl b/bin/AST_flush_DBqueue.pl index e35df4ab..f2abcd7e 100644 --- a/bin/AST_flush_DBqueue.pl +++ b/bin/AST_flush_DBqueue.pl @@ -13,6 +13,7 @@ # CHANGES # 60717-1214 - changed to DBI by Marin Blu # 60717-1536 - changed to use /etc/astguiclient.conf for configs +# 60910-0238 - removed park_log query # $secX = time(); @@ -135,17 +136,6 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA if (!$T) { $affected_rows = $dbhA->do($stmtA);} if (!$Q) {print " - vicidial_manager 2 hour flush\n";} - $stmtA = "update park_log set status='HUNGUP' where hangup_time is not null;"; - if($DB){print STDERR "\n|$stmtA|\n";} - if (!$T) { - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthA->finish(); - } - - if (!$Q) {print " - park_log HUNGUP flush \n";} - - $stmtA = "optimize table vicidial_manager;"; if($DB){print STDERR "\n|$stmtA|\n";} if (!$T)