Error Repairing Sql databases..

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Error Repairing Sql databases..

Postby javad-afzal » Sun Aug 28, 2011 2:05 pm

Hi,
I tried to repair mysql databases with this command
"mysqlcheck -u root -p --auto-repair --check --optimize --all-databases"
at the end i get following error..


Repairing tables
asterisk.vicidial_agent_log
error : 5 when fixing table
Error : Error writing file '/var/lib/mysql/asterisk/vicidial_agent_log.MYI' (Errcode: 5)
status : Operation failed


i also get this auto generated mail messaage ,,
''''
DBD::mysql::st execute failed: Table './asterisk/vicidial_agent_log' is marked as crashed and last (automatic?) repair failed at /usr/share/astguiclient/AST_cleanup_agent_log.pl line 223.
executing: SELECT agent_log_id,pause_epoch,wait_epoch from vicidial_agent_log where pause_sec>43999 and event_time > "2011-08-28 23:03:02" and event_time < "2011-08-29 01:23:02"; Table './asterisk/vicidial_agent_log' is marked as crashed and last (automatic?) repair failed at /usr/share/astguiclient/AST_cleanup_agent_log.pl line 223.
''''


I m not very good on Sql databases, kindly help me on this... Thanks...
javad-afzal
 
Posts: 63
Joined: Sat Jun 11, 2011 6:11 pm

Postby williamconley » Sun Aug 28, 2011 5:43 pm

is your hard drive full?

Code: Select all
df -h
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

No Harddisk is not full

Postby javad-afzal » Sun Aug 28, 2011 6:40 pm

Thanks Bro for your reply
No Harddisk is not full butt whenever i try to repair it, there is an error on ssh which says "end_request: I/O error , dev sda, sector 139845254"

i have gone through logs they are as following..

Aug 29 07:15:09 vici kernel: sd 0:0:0:0: SCSI error: return code = 0x08000002
Aug 29 07:15:09 vici kernel: sda: Current: sense key: Medium Error
Aug 29 07:15:09 vici kernel: Add. Sense: Read retries exhausted
Aug 29 07:15:09 vici kernel:
Aug 29 07:15:09 vici kernel: Info fld=0x855de86
Aug 29 07:15:09 vici kernel: end_request: I/O error, dev sda, sector 139845254
.....
javad-afzal
 
Posts: 63
Joined: Sat Jun 11, 2011 6:11 pm

Postby williamconley » Sun Aug 28, 2011 8:03 pm

force a disk check and reboot (it can't check the disk while running, so it'll check during startup)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby javad-afzal » Sun Aug 28, 2011 8:09 pm

i have tried
Code: Select all
shutdown -rF 0
javad-afzal
 
Posts: 63
Joined: Sat Jun 11, 2011 6:11 pm

Postby williamconley » Sun Aug 28, 2011 8:19 pm

when it started up did it check the disk? and ... did it fix anything?

and more importantly ... do you have a good backup from which you can restore?

another "coool" trick ... is to EMPTY the agent log table with phpMyAdmin and then immediately back up your database before anything else can become corrupted.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby javad-afzal » Sun Aug 28, 2011 8:26 pm

ya it checked the disk but didnt repaired it.. still getting the same sector problem, can you tell if i can take all the backup means all the databases and put it in the new version goautodial? so now i have to change the HDD or is there any way of repairing it?
javad-afzal
 
Posts: 63
Joined: Sat Jun 11, 2011 6:11 pm

Postby williamconley » Sun Aug 28, 2011 9:54 pm

dude, if you can get a good database backup right now, count your lucky stars that you didn't lose your data. the cost of the HD is nothing compared to reconstruction.

let me ask you this: suppose you manage to get the database backed up, get the disk working again and have 25 agents working on this box ... how long will it be before this drive dies again? do you really wanna find out?

back up the data.

dump the disk in a trash can.

blow the $40 on a new one (or pull one from a Workstation if you're really cheap!)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby javad-afzal » Mon Aug 29, 2011 10:31 am

Thanks bro Thank you very much for your kind support..
yeh thats what i want to do now, Buy another HDD and and put all the databases in it, thats what i was wondering, How to take backup of the databases and put it in the latest version which is GOAutodial.. currently i m using an old version of Vicidialnow.. i dont know how to take my current databases backup.. can you plz guide me through it, it will be really kind of you..




kernel #1 SMP i686 i386

vici.vicidialnow.org 2.6.18-164.el5.vnow | Vicidial VERSION: 2.0.5-174 BUILD: 90522-0506 | Asterisk 1.2.30.2 | Single Server | No Extra Software After Installation
javad-afzal
 
Posts: 63
Joined: Sat Jun 11, 2011 6:11 pm

Postby javad-afzal » Mon Aug 29, 2011 10:35 am

I mean all my current campaigns, their settings, all my sip trunks, all phone logins and users, most importantly all my current LEADS which are in it..
javad-afzal
 
Posts: 63
Joined: Sat Jun 11, 2011 6:11 pm

Postby friendlysol » Mon Aug 29, 2011 12:22 pm

You can use "hdclone" to clone the drive and hope the data is good.
ViciBox Redux v.3.1.10 | VERSION: 2.4-349a
BUILD: 111122-133 | Asterisk 1.4.39.2-vici | Single Server | No Digium/Sangoma Hardware | No Extra Software After Installation
friendlysol
 
Posts: 76
Joined: Thu May 19, 2011 9:18 pm

Postby javad-afzal » Mon Aug 29, 2011 12:53 pm

by hdclone i ll be getting same old version for vicidial & a corrupted database. i want to use my existing database in goautodial.. is it possible to import my old dump file from vicidialnow to Goautodial?
javad-afzal
 
Posts: 63
Joined: Sat Jun 11, 2011 6:11 pm

Postby friendlysol » Mon Aug 29, 2011 1:43 pm

MAYBE if you did it on a few select tables you could import if the schema is similar.

You could then maybe move lists, phones, users, etc. But I don't know the schema of goautodial so don't take my advise unless you know what you are doing.
ViciBox Redux v.3.1.10 | VERSION: 2.4-349a
BUILD: 111122-133 | Asterisk 1.4.39.2-vici | Single Server | No Digium/Sangoma Hardware | No Extra Software After Installation
friendlysol
 
Posts: 76
Joined: Thu May 19, 2011 9:18 pm

Postby williamconley » Mon Aug 29, 2011 7:14 pm

vicidial's manager manual should describe the use of the backup function.

all perl scripts are in /usr/share/astguiclient ... including "ADMIN_backup.pl".

execute:

Code: Select all
perl /usr/share/astguiclient/ADMIN_backup.pl --help


will back up data to /var/log/astguiclient/archive

another simpler method is:

Code: Select all
mysqldump asterisk > 2011-08-29_1234_asterisk.sql -p
the -p is only necessary if you have a mysql root password.

then you use another cool package named "WinSCP" (Free!) in SFTP mode (which uses your ssh putty console credentials!) to copy this to your Windows Hard drive. Then you can push it right back to the next machine (but make sure that gets copied off your system NOW in case the machine dies tonight!)

then you will need to put it into an identical system to use it or upgrade the database to whatever version you install on the next machine using the information in the UPGRADE document in /usr/share/astguiclient/VERSION
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Error Repairing Sql databases..

Postby Robin009 » Fri May 16, 2014 5:33 pm

mysqlcheck doesn't support multiple contradicting commands. i am facing this error when i try to repair my database using this command mysqlcheck -u cron -p --auto-repair --check --optimize --all-databases

do reply me fast
Robin009
 
Posts: 20
Joined: Wed Apr 09, 2014 5:07 pm

Re: Error Repairing Sql databases..

Postby williamconley » Tue Jun 10, 2014 2:39 am

Robin009 wrote:mysqlcheck doesn't support multiple contradicting commands. i am facing this error when i try to repair my database using this command mysqlcheck -u cron -p --auto-repair --check --optimize --all-databases

do reply me fast

1) Welcome to the Party! 8-)

2) As you are obviously new here, I have some suggestions to help us all help you:

When you post, please post your entire configuration including (but not limited to) your installation method and vicidial version with build.

This IS a requirement for posting along with reading the stickies (at the top of each forum) and the manager's manual (available on EFLO.net, both free and paid versions)

You should also post: Asterisk version, telephony hardware (model number is helpful here), cluster information if you have one, and whether any other software is installed in the box. If your installation method is "from scratch" you must post your operating system and should also post the .iso version from which you installed your original operating system. If your installation is "Hosted" list the site name of the host.

If this is a "Cloud" or "Virtual" server, please note the technology involved along with the version of that techology (ie: VMware Server Version 2.0.2). If it is not, merely stating the Motherboard model # and CPU would be helpful.

Similar to This:

Vicibox X.X from .iso | Vicidial X.X.X-XXX Build XXXXXX-XXXX | Asterisk X.X.X | Single Server | No Digium/Sangoma Hardware | No Extra Software After Installation | Intel DG35EC | Core2Quad Q6600

3) Optimize already runs in crontab -e, no need to run it randomly (so skip --optimize). Check is implied by "mysqlCHECK" already (so skip --check).
Code: Select all
mysqlcheck -u cron -p --auto-repair --all-databases


4) Happy Hunting 8-)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to Support

Who is online

Users browsing this forum: No registered users and 102 guests

cron