database.sarang.net
UserID
Passwd
Database
DBMS
ㆍMySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
MySQL Q&A 26899 게시물 읽기
No. 26899
MYSQL ERROR : 1194 (ER_CRASHED_ON_USAGE) 어떤 경우 발생하는 에러인가요?
작성자
김지숙(koyoro)
작성일
2007-07-31 11:06ⓒ
2007-07-31 11:32ⓜ
조회수
7,827

1.
QUERY : SELECT * FROM tableName WHERE step_id=0 AND section_id=1 AND seq_num=1 AND r_date='20070730'
MYSQL ERROR : 1194 - Table 'tableName' is marked as crashed and should be repaired

2.
QUERY : INSERT INTO tableName VALUES (0,1,1,'20070730',0)
MYSQL ERROR : 1062 - Duplicate entry '0-1-1-20070730' for key 1


C 프로그램에서 1번과 같은 query로 해당 데이터가 존재하는지 확인 한 후
존재할 경우 UPDATE query를, 존재하지 않을 경우 INSERT query를 실행하게 프로그램했습니다.
해당 query는 socket통신으로 데이터가 올라올 때 마다 실행되고요..

어느날부터 2번의 오류가 나기 시작했습니다. 데이터를 한꺼번에 빠른 속도로 많이 올린 경우에 발생했습니다.
그 이후로 계속 업데이트가 안되더니 1번의 오류까지 나기 시작했습니다.
2번 오류는 lock unlock 그런게 안맞아서 그런건가..라는 추측도 해보았지만
1번 오류는 처음보는 것이라 어찌해야할지 모르겠네요

현재 mysql database에서 직접 query를 실행해도 report_info table은 읽혀지지 않습니다.
깨진것 같은데 어떻게 복원해야할지 모르겠네요 ㅠ_ㅠ

혹시 이런 경우 어떻게 처리해야하는지, 왜 이런 에러가 발생하는지 아시는 분..조언 부탁드립니다.
인터넷 검색으로 찾아서 다음 명령은 내렸는데 복원이 안되네요..

mysql> repair table tableName; //"tableName"는 오류가 생긴 테이블 입니다.
mysql>analyze table tableName;를 실행하면 테이블에 대한 보고서가 작성됩니다.
mysql>repair table tableName;를 실행하면 복원이 됩니다.


다음은 MySQL err log입니다.

070730 15:23:27 [ERROR] /usr/local/mysql-enterprise-5.0.36-solaris10-sparc/bin/mysqld: Incorrect key file for table './axmds10_sys/report_info.MYI'; try to repair it
070730 15:25:35 [ERROR] /usr/local/mysql-enterprise-5.0.36-solaris10-sparc/bin/mysqld: Incorrect key file for table './axmds10_sys/report_info.MYI'; try to repair it
070730 16:07:36 [ERROR] /usr/local/mysql-enterprise-5.0.36-solaris10-sparc/bin/mysqld: Incorrect key file for table './axmds10_sys/report_info.MYI'; try to repair it
070730 18:03:29 [ERROR] /usr/local/mysql-enterprise-5.0.36-solaris10-sparc/bin/mysqld: Incorrect key file for table './axmds10_sys/report_info.MYI'; try to repair it
070730 21:12:12 [ERROR] Got error 127 when reading table './axmds10_sys/report_info'
070730 21:37:41 [ERROR] /usr/local/mysql-enterprise-5.0.36-solaris10-sparc/bin/mysqld: Sort aborted
070731 11:13:19 [Note] Retrying repair of: './axmds10_sys/report_info' with keycache
070731 11:14:15 [ERROR] /usr/local/mysql-enterprise-5.0.36-solaris10-sparc/bin/mysqld: Table './axmds10_sys/report_info' is marked as crashed and last (automatic?) repair failed
070731 11:14:15 [ERROR] /usr/local/mysql-enterprise-5.0.36-solaris10-sparc/bin/mysqld: Table './axmds10_sys/report_info' is marked as crashed and last (automatic?) repair failed
070731 11:14:38 [Note] Retrying repair of: './axmds10_sys/report_info' with keycache
070731 11:14:48 [ERROR] /usr/local/mysql-enterprise-5.0.36-solaris10-sparc/bin/mysqld: Table './axmds10_sys/report_info' is marked as crashed and last (automatic?) repair failed
070731 11:14:48 [ERROR] /usr/local/mysql-enterprise-5.0.36-solaris10-sparc/bin/mysqld: Table './axmds10_sys/report_info' is marked as crashed and last (automatic?) repair failed
070731 11:19:31 [ERROR] /usr/local/mysql-enterprise-5.0.36-solaris10-sparc/bin/mysqld: Table './axmds10_sys/report_info' is marked as crashed and last (automatic?) repair failed
070731 11:19:31 [ERROR] /usr/local/mysql-enterprise-5.0.36-solaris10-sparc/bin/mysqld: Table './axmds10_sys/report_info' is marked as crashed and last (automatic?) repair failed
070731 11:19:43 [Note] Retrying repair of: './axmds10_sys/report_info' with keycache
070731 11:20:07 [ERROR] /usr/local/mysql-enterprise-5.0.36-solaris10-sparc/bin/mysqld: Table './axmds10_sys/report_info' is marked as crashed and last (automatic?) repair failed
070731 11:20:07 [ERROR] /usr/local/mysql-enterprise-5.0.36-solaris10-sparc/bin/mysqld: Table './axmds10_sys/report_info' is marked as crashed and last (automatic?) repair failed

이 글에 대한 댓글이 총 2건 있습니다.

: MYSQL ERROR : 1194 - Table 'tableName' is marked as crashed and should be repaired


테이블이 깨졌으니 복구 하랍니다. 


: MYSQL ERROR : 1062 - Duplicate entry '0-1-1-20070730' for key 1


주 키 가 중복이 일어나는군요..


데이터의 인서트가 빠른순간에 여러 클라이언트에서 일어난다면 주의해주셔야겟죠. 


어떤 프로그램인지는 모르겟습니다만 큐 를 이용해서 클라이언트에서 들어온 값들을 쌓아놓고 큐에서 데이터를 빼서 업데이트를 해보시지요.


repair 명령으로 복구가 안돼시면 myisamchk 같은 유틸리티로 복구를 해보시죠.


-r 이나 -o 옵션으로 하면 에지간하면 복구 됩니다. 그 밖에 다양한 옵션들이 많으니 적절한 옵션을 찾아보시길...(물론 MySQL 서버 끄고 해야겟죠?)



그럼..

team b(teamb)님이 2007-07-31 17:16에 작성한 댓글입니다.

조언 감사합니다~~^^
친절하게 해석까지 ^^;;;

어제는 너무 급해서 backup server에 남아 있는 데이터로 복원 했는데요...
(table삭제-> table생성-> backup data load)
복원한 table까지 1194 (ER_CRASHED_ON_USAGE) 에러가 발생하더군요..ㅠ_ㅠ
깨진 database는 백업을 해뒀으니 알려주신 방법으로 해보겠습니다. ^^

김지숙(koyoro)님이 2007-08-01 13:56에 작성한 댓글입니다.
이 댓글은 2007-08-01 14:07에 마지막으로 수정되었습니다.
[Top]
No.
제목
작성자
작성일
조회
26902안녕하세요.~! 오랫만에..질문 올립니다...^^; [1]
박남춘
2007-08-01
1657
26901mysql5.0에서의 트랜잭션 [1]
이창형
2007-07-31
2424
26900mysql 의 bin log 파일 삭제해도 문제없나요? [2]
홍진수
2007-07-31
2564
26899MYSQL ERROR : 1194 (ER_CRASHED_ON_USAGE) 어떤 경우 발생하는 에러인가요? [2]
김지숙
2007-07-31
7827
26898MySQL에서 캐릭터셋 변환하는 방법은 어떻게 하나요? [2]
이재훈
2007-07-30
2674
26897날짜로 조건 검색시 제외된 날짜에서 찾으려면. [1]
박신득
2007-07-30
2173
26896MySQL 쿼리 질문입니다 [2]
산토스
2007-07-29
2162
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.018초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다