摘要:
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author:guozhen.zhang import MySQLdbimport timeimport os # 创建备份binlog目录project_path = '/data/binlog_back 阅读全文
摘要:
今天早上来上班,发现zabbix一直告警主从延迟,mysql slave Seconds_Behind_Master (mysql.slave_status[Seconds_Behind_Master]): 69登录MySQL从库查看 slave状态,Seconds_Behind_Master: 1 阅读全文
摘要:
1、# cat db.txtbackend 3310base 3320storage 3330payment 3340promotion 3350 2、# cat restart_mysql_slave.sh#!/bin/shexport PATH=$PATH:/usr/local/mysql/bi 阅读全文
摘要:
#创建基表 CREATE TABLE `table_sum` ( `id` int(11) NOT NULL AUTO_INCREMENT, `table_name` varchar(50) DEFAULT NULL, `table_rows` int(11) DEFAULT NULL, `tota 阅读全文
摘要:
1、在数据库中查找要下线的从库 SQL> show parameter log_archive_dest NAME TYPE VALUE log_archive_dest stringlog_archive_dest_1 string LOCATION=/u01/app/archive_log va 阅读全文
摘要:
cat rman_back.sh #!/bin/bash source /home/oracle/.bash_profile rman log=/u01/backup/backupall_rman.log <<EOF connect target / run { CONFIGURE RETENTIO 阅读全文
摘要:
(对一列数字求和) 在日常工作当中需要对文本过滤出来的数字进行求和运算,例如想统计一个MySQL分区表现在有多大 # ls -lsh AdPlateform#P#p*.ibd |grep G 2.6G -rw-rw 1 mysql mysql 2.6G Mar 4 01:05 AdPlateform 阅读全文
摘要:
#!/bin/bashcnn_db=$1table=$2alter_conment=$3cnn_host='192.168.10.14'cnn_user='root'cnn_pwd='123456'echo "$cnn_db"echo "$table"echo "$alter_conment"/ap 阅读全文
摘要:
#!/bin/bashtime=`date -d yesterday +"%Y-%m-%d"`slowlog='/usr/local/percona/data/slow.log'#提前创建好一个存放目录:/usr/local/percona/slow_log cut_slowlog='/usr/lo 阅读全文
摘要:
#!/bin/shexport PATH=$PATH:/application/mysql/3306/binlogFile=`date +"%Y-%m-%d %H:%M:%S"`_check_mysql_slave.logmysql='/application/mysql/3306/bin/mysq 阅读全文