Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- NCP
- REDIS
- DELETE
- Connection
- opensource
- Maria
- percona
- mongo
- OD
- RDS
- autovacuum
- 6.2.7
- InnoDB
- MyISAM
- RDBMS
- Docker
- vacuum
- NOSQL
- Cloud DB for MySQL
- slack
- zabbix
- jmeter
- ncloud
- mysql
- DML
- maxclients
- cdb
- postgresql
- 성능테스트
- online ddl
Archives
- Today
- Total
개인 공부
MySQL / MariaDB 이관 정합성 확인 본문
반응형
갸 꿀~~~
이관 정합성 확인 쿼리
select table_schema
,concat(if(group_concat(SIZE separator '')!='',group_concat(SIZE separator ''),'0'),'(MB)') as "SIZE(MB)"
,if(group_concat(TAB separator '')!='',group_concat(TAB separator ''),'0') as "TABLE"
,if(group_concat(idx separator '')!='',group_concat(idx separator ''),'0') as "INDEX"
,if(group_concat(vie separator '')!='',group_concat(vie separator ''),'0') as "VIEW"
,if(group_concat(PRO separator '')!='',group_concat(PRO separator ''),'0') as "PROCEDURE"
,if(group_concat(FUNC separator '')!='',group_concat(FUNC separator ''),'0') as "FUNCTION"
,if(group_concat(TRI separator '')!='',group_concat(TRI separator ''),'0') as "TRIGGER"
,if(group_concat(EVN separator '')!='',group_concat(EVN separator ''),'0') as "EVENT"
from
(
select
table_schema,
if(object_type='SIZE',cnt,'') as "SIZE",
if(object_type='TABLE',cnt,'') as "TAB",
if(object_type='INDEX',cnt,'') as "idx",
if(object_type='VIEW',cnt,'') as "vie",
if(object_type='PROCEDURE',cnt,'') as "PRO",
if(object_type='FUNCTION',cnt,'') as "FUNC",
if(object_type='Trigger',cnt,'') as "TRI",
if(object_type='Event',cnt,'') as "EVN"
from (
SELECT 'SIZE' AS 'OBJECT_TYPE',TABLE_SCHEMA,round(sum(data_length+index_length)/1024/1024,0) as cnt from information_schema.tables where table_schema not in ('mysql','performance_schema','information_schema','sys') group by table_schema
union
select 'TABLE' as 'Object_type',table_schema,count(*) as cnt from information_schema.tables where table_schema not in ('mysql','performance_schema','information_schema','sys') group by table_schema
union
select 'INDEX' as 'Object_type' ,database_name,count(*) as cnt from
mysql.innodb_index_stats where database_name not in ('mysql','performance_schema','information_schema','sys') group by database_name
union
select 'VIEW' as 'Object_type',table_schema,count(*) as cnt
from information_schema.views where table_schema not in ('mysql','performance_schema','information_schema','sys') group by table_schema
union
select ROUTINE_TYPE as 'Object_type',routine_schema,count(ROUTINE_NAME) as cnt FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_schema not in ('mysql','performance_schema','information_schema','sys') and
ROUTINE_TYPE in ("PROCEDURE","FUNCTION") group by ROUTINE_TYPE,routine_schema
union
select 'Trigger' as 'Object_type',TRIGGER_SCHEMA,count(*) as cnt from INFORMATION_SCHEMA.TRIGGERS where trigger_schema not in ('mysql','performance_schema','information_schema','sys') group by trigger_schema
union
select 'Event' as 'Object_type', event_schema,count(*) as cnt from INFORMATION_SCHEMA.events where event_schema not in ('mysql','performance_schema','information_schema','sys') group by event_schema)a ) B group by table_schema order by table_schema;
반응형
'MySQL & Maria' 카테고리의 다른 글
[ MySQL & MariaDB ] OS Buffer Cache 공간 확인 ( Use. Percona ) (0) | 2022.11.21 |
---|---|
[ MySQL ] MTS ( Multi Thread Slave ) (1) | 2022.11.17 |
Thread Pool (0) | 2022.11.03 |
Mysqldump (1) | 2022.10.06 |
MySQL Python 사용하여 원하는 데이터 가져오기 (0) | 2022.09.26 |