RSS구독하기:SUBSCRIBE TO RSS FEED
즐겨찾기추가:ADD FAVORITE
글쓰기:POST
관리자:ADMINISTRATOR
출처 블로그 > Do it Now
원본 http://blog.naver.com/idxzone/60000551074


mysql> use g_gaya;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Didn't find any fields in table 'XN__free'
Didn't find any fields in table 'XN__qna'
Database changed
mysql>

mysql> desc XN__free ;
ERROR 1016: Can't open file: 'XN__free.MYD'. (errno: 145)
mysql>

[10:24:12  /usr/local/mysql/data/g_gaya]# /usr/local/mysql/bin/myisamchk  XN__free.*
[10:24:51  /usr/local/mysql/data/g_gaya]# /usr/local/mysql/bin/myisamchk -o  XN__free.*

[10:25:57  /usr/local/mysql/data/g_gaya]# /usr/local/mysql/bin/myisamchk  XN__qna.*
[10:27:18  /usr/local/mysql/data/g_gaya]# /usr/local/mysql/bin/myisamchk -o   XN__qna.*

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
어느날 갑자기 정전이 되거나 하드디스크가 꽉차거나 하여
데이터가 깨지는 수가 있다.

복구방법

myisamchk 라는 것이 있다.

# myisamchk -r TEST.MYI


참고) man myisamchk

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
어느날 아침 로긴이 안되거나 혹은 게시판에서 데이터 베이스 엑세스를 할수 없습니다.. 이런 메세지를 볼수 있다. 난감하기 그지 없다... 어떻게 극복을 할것인가... ?
데이터 베이스는 항상 깨지기 마련이다. 1년은 운영한다면.. 적어도 1~2회 정도는 화일을 열수 없습니다.

에러 메세지 :
ERROR 1016: Can't open file: 'xxxxxx.MYD'. (errno: 145)
만약 /usr/local/mysql/var/데이터 베이스에 들어 가면 각각의   .......

--
myisamchk 복원 안되는게 몇가지 있는데, 두번째 mysqlcheck 는 100% 되더군요.
그외 비정상적으로 복원되는 경우는 DB수정에 의한 경우 밖에 없더군요..^^;
--
문제는 왜 이런 오류가 발생하는지가 궁금하네요.
글고 저같은 경우는 위 방법이 복잡하여...`ㅡ`;;
mysqlcheck -u아이디 -p비번 --auto-repair -B 복원할 DB명
을 사용합니다^^
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/usr/local/mysql/data/
   *.FRM : 테이블 정보
   *.MYI : 인덱스 정보
   *.MYD : 데이타 정보


#myisamchk 옵션을 보면
   # -r -o로 복구가 안되면다 -f 옵션을 이용한다.
   -f, --force Overwrite old temporary files.

   #복구
   -r, --recover Can fix almost anything except unique keys that aren't unique.

   #안전하게 복구
   -o, --safe-recover Uses old recovery method; Slower than '-r' but can
   handle a couple of cases where '-r' reports that it
   can't fix the data file.

   #데이터 정렬 및 속도 증가 -R1 저도 주면 될듯 싶네요
   -R, --sort-records=#
   Sort records according to an index. This makes your
   data much more localized and may speed up things


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
You should also check your tables regularly during normal system operation. At MySQL AB, we run a cron job to check all our important tables once a week, using a line like this in a `crontab' file:

35 0 * * 0 /path/to/myisamchk -s /path/to/datadir/*/*.MYI

This prints out information about crashed tables so we can examine and repair them when needed.


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


myisamchk , 디비 복구에 관련된 url 들

http://www.mysql.com/doc/en/myisamchk_repair_options.html

http://database.sarang.net/database/mysql/doc/mysql-3.23.32/manual-split/manual_Maintenance.html

http://www.mysql.com/doc/en/Repair.html

http://linuxpro.pe.kr/document.files/man/mysql_3.23.28/manual_Table_types.html

2006/09/08 12:33 2006/09/08 12:33
이 글에는 트랙백을 보낼 수 없습니다
웅쓰:웅자의 상상플러스
웅자의 상상플러스
전체 (379)
게임 (5)
영화 (2)
기타 (23)
맛집 (5)
영어 (2)
대수학 (3)
형태소 (5)
Hacking (9)
Linux (112)
HTML (48)
Application_developing (48)
Web_developing (102)
Window (11)
«   2024/03   »
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
  1. 2016/01 (1)
  2. 2015/12 (3)
  3. 2015/10 (3)
  4. 2015/03 (2)
  5. 2015/01 (4)