티스토리 뷰
MySQL 용량 확인
DB를 사용하다 보면 DB 또는 table별 용량 확인이 필요하고 이를 위해서는 information_schema 이용한다.
1. DB 용량확인 -> zabbix db 용량 확인
SELECT table_schema "Database Name",
SUM(data_length + index_length) / 1024 / 1024 "Size(MB)"
FROM information_schema.TABLES
GROUP BY table_schema;
2.table 용량확인 -> zabbix의 history_unit 테이블 용량 확인
먼저 zabbix db를 선택하고 show tables;로 확인 한다.
이후 아래 쿼리문으로 history_unit 테이블의 사이즈를 확인 한다.
SELECT
concat(table_schema,'.',table_name),
concat(round(table_rows/1000000,2),'M') rows,
concat(round(data_length/(1024*1024*1024),2),'G') DATA,
concat(round(index_length/(1024*1024*1024),2),'G') idx,
concat(round((data_length+index_length)/(1024*1024*1024),2),'G') total_size,
round(index_length/data_length,2) idxfrac
FROM
information_schema.TABLES
where table_name = 'history_uint' ;
'DB' 카테고리의 다른 글
[mysql] 유저 생성 및 삭제 (0) | 2017.07.20 |
---|---|
[mysql] 기초 쿼리문 (0) | 2017.07.20 |
[mysql] DB 백업 및 복원 (0) | 2017.07.20 |
- Total
- Today
- Yesterday
- ansible ios
- 특정 문구 치환
- kernel 변경
- 특정 라인삭제
- DL20 GEN9 장비에 CentOS 7
- ILO
- nutanix rac
- ios ansible
- cisco ansible
- ISCSI 볼륨 RAC
- ipmi
- CentOS 7 GUI
- nxos ansible
- ansible network
- 윈도우 cmd 계정 관리
- 윈도우서버 계정 관려
- linux command log
- cmd로 계정 생성
- dl20
- centos7 ntp
- oracle linux8 kernel
- dl20 g9 centos7 설치
- chrony
- 리눅스 커맨드 로그남기기
- shell connmad log
- cmd로 윈도우 계정 관리
- dl20 centos7
- cgroup
- vm rac
- windows.old 강제삭제
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |