http://iotn.co.kr 연락처: gilho.kr@gmail.com [ The Japanese government should apologize to Japanese Military Sexual Slavery victim. / 日本政府は日本軍の性的奴隷?牲者に謝罪すべき. ]

사용자

ID:
PW:

INDEX
01.게시판
게시판 [69]
02.File Book
File 자료실 [95]
Site Link [18]
개인폴더 [194]
03.Field Book
Altibase [19]
Tibero [30]
MS-SQL [18]
MySQL [40]
DB2 [79]
ORACLE [2888]
PostgreSQL [103]
기타정보 [150]
운영체제 [577]
04.Q/A Book
Q/A [53]
05.방명록
방명록 [54]
레벨업 [37]
구인/구직 [2]

기념일
Search
LINK
+ 가족 Hompy
+ DNSEver
IOTN :: Work Book :: MySQL

 회원가입

mysqlbinlog [ oracle logminer ]
최길호 [LIST]   2019-08-02 00:45:16, 조회 : 410

[mariadb]        
# log 활성화
log-bin
server_id=1
#server_id=2
log-basename=master1 # log name 정의
#log-basename=master2
character-set-server=utf8
datadir=/mariadb/data  # dbf,log 위치 정의
socket=/tmp/mysql.sock
user=mysql
max_binlog_size=1G  # log size / 없어도 default: 1G
expire_logs_days=30  # log 30일 보관


-- show variables like 'datadir';
-- show variables like 'log%name';
cat /mariadb/data/master1-bin.index  [ log list ]
-- log switch
MariaDB [(none)]> flush logs;
-- log 삭제
MariaDB [(none)]> purge master logs to 'master1-bin.000009';  [ expire_logs_days=30 30일 안에 있으면 삭제 안된다. ]


mysqlbinlog /datadir/mysql-bin.000004 > binlog.sql
mysqlbinlog --database=testdb --start-date="2017-07-19 17:00:00" --stop-date="2017-07-19-18:00:00" /datadir/mysql-bin.000004 > binlog.sql

출처: https://blog.naver.com/ncloud24/221055112009



[dbsvr:root bin]# mysqlbinlog -vv  /mariadb/data/master1-bin.000010
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#190802  0:25:03 server id 1  end_log_pos 256   Start: binlog v 4, server v 10.2.25-MariaDB-log created 190802  0:25:03 at startup
# Warning: this binlog is either in use or was not closed properly.
ROLLBACK/*!*/;
BINLOG '
TwRDXQ8BAAAA/AAAAAABAAABAAQAMTAuMi4yNS1NYXJpYURCLWxvZwAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAABPBENdEzgNAAgAEgAEBAQEEgAA5AAEGggAAAAICAgCAAAACgoKAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAEEwQADQgICAoKCgHPuEqd
'/*!*/;
ERROR: Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 43, event_type: -93      >>>>>>>>>>>>>>>>>  version이 안맞아서 발생  <<<<<<<<<<<<<<<<
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;



[dbsvr:root bin]# /usr/bin/mysqlbinlog -V
/usr/bin/mysqlbinlog Ver 3.3 for redhat-linux-gnu at x86_64
[dbsvr:root bin]# ./mysqlbinlog -V
./mysqlbinlog Ver 3.3 for Linux at x86_64



[dbsvr:root bin]# ./mysqlbinlog -vv  /mariadb/data/master1-bin.000010
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#190802  0:25:03 server id 1  end_log_pos 256 CRC32 0x9d4ab8cf  Start: binlog v 4, server v 10.2.25-MariaDB-log created 190802  0:25:03 at startup
ROLLBACK/*!*/;
BINLOG '
TwRDXQ8BAAAA/AAAAAABAAAAAAQAMTAuMi4yNS1NYXJpYURCLWxvZwAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAABPBENdEzgNAAgAEgAEBAQEEgAA5AAEGggAAAAICAgCAAAACgoKAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAEEwQADQgICAoKCgHPuEqd
'/*!*/;
# at 256
#190802  0:25:03 server id 1  end_log_pos 299 CRC32 0x4219eb5a  Gtid list [0-1-8139]
# at 299
#190802  0:25:03 server id 1  end_log_pos 344 CRC32 0x7d3d9802  Binlog checkpoint master1-bin.000010
# at 344
#190802  0:29:33 server id 1  end_log_pos 386 CRC32 0x381726cd  GTID 0-1-8140 ddl
/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=8140*//*!*/;
# at 386
#190802  0:29:33 server id 1  end_log_pos 475 CRC32 0xbf21f04d  Query   thread_id=11    exec_time=0     error_code=0
use `repdb`/*!*/;
SET TIMESTAMP=1564673373/*!*/;
SET @@session.pseudo_thread_id=11/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=33/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table a(b int)                                      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< test SQL
/*!*/;
# at 475
#190802  0:36:43 server id 1  end_log_pos 524 CRC32 0x432649a3  Rotate to master1-bin.000011  pos: 4
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;


  LIST

Copyright 1999-2022 Zeroboard / skin by 최길호(gilho.kr@gmail.com)
최근 댓글
2008/12/15
MySQL이 안좋은건가? 장애도 쉽게 나고,...
by 최길호
최근 게시물
06/29
[ORACLE]
DDE: Problem Key 'ORA 600 [133....
by 최길호
06/25
[ORACLE]
Replication may not be valid i....
by 최길호
06/22
[운영체제]
CentOS7 홈페이지 Migration 메모.
by 최길호