Python列表排序
列表排序:>>> help(sorted)Help on built-in function sorted in module __builtin__:sorted(...) sorted(iterable, cmp=None, key=None, reverse=False) --> new sorted list---------------------------------sort---------------------------------------->>> help(list.sort)Help on method_d...
grep 搜索日志,如何同时显示匹配结果的前后 10 行
grep 搜索日志,如何同时显示匹配结果的前后 10 行grep -A 10 -B 10 -i "create" 15.sql-A 是匹配行之前的行数,-B 是之后的行数。
MegaCLI Scripts
Installing the MegaCLI binaryIn order to communicate with the LSI card you will need the MegaCLI or MegaCLI64 (64bit) program. The install should be quite easy, but LSI make us jump through a few hoops. This is what we found:Go to the LSI Downloads page: LSI DownloadsSearch ...
Oracle之清理sysaux表空间数据(暴力)
查看在sysaux表空间中数据比较大的表:select * from (select segment_name,PARTITION_NAME,segment_type,bytes/1024/1024 from dba_segments where tablespace_name='SYSAUX' order by 4 desc) where rownum<=10;查看要删除的表:select table_name, num_rows from dba_tables where table_name in ...
Oracle安装之图形界面
[oracle@virtdb52 database]$ ./runInstaller Starting Oracle Universal Installer...Checking Temp space: must be greater than 120 MB. Actual 50216 MB PassedChecking swap space: must be greater than 150 MB. Actual 3980 MB PassedChecking monitor: must be...
Mysql分析监控之Performance_schema SQL执行统计
查看执行最频繁的SQLselect DIGEST_TEXT as sql_text,COUNT_STAR as exec_count,IF(SUM_NO_GOOD_INDEX_USED > 0 OR SUM_NO_INDEX_USED > 0, '*', '') AS full_scan from events_statements_summary_by_digest where SCHEMA_NAME='ticket' and digest_text LIKE 'SELECT%' order by COUNT_STAR desc limit 10;...
Oracle Latch快照
创建Latch快照表CREATE TABLE snap_latch asSELECT 0 snap_id, sysdate snap_date, a.* FROM V$LATCH a; ALTER TABLE snap_latch add (constraint snap_filestat primary key (snap_id, name));定期insert数据INSERT INTO snap_latchSELECT 1, sysdate, a.* FROM V$LATCH a;查询LatchSE...
Percona mysql 5.6审计日志功能
Percona mysql 5.6审计日志功能https://www.percona.com/blog/2014/05/16/introduction-to-the-percona-mysql-audit-log-plugin/http://my.oschina.net/anthonyyau/blog/296650[mysqld]plugin-load="audit_log=audit_log.so"INSTALL PLUGIN audit_log SONAME 'audit_log.so';show plugins;show global ...
mysql 用户权限回收
mysql 用户权限回收show grants for 'monitor'@'%';+--------------------------------------------------------------------------------------------------------+| Grants for monitor@% ...
Mysql 误删除数据库恢复
----误删除数据库恢复-------------备份时间点:-- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000211', MASTER_LOG_POS=12737491;全备恢复:mysql -uroot -p -h127.0.0.1/tmp/monitor_binlog...
high undo tablespace and enq: U.S. - Contention
high undo tablespace and enq: U.S. - ContentionThese days encounter an error, I do not know if it's wrong, because there is no error, but the operating table in a sudden just 2 minutes suddenly reduced, causing the software to restart. To view the alert log there is no error, but in th...
Mysql索引使用监控脚本
开启变量:默认是关闭的,它在内存中创建了几个HASH表set global userstat=on;set global thread_statistics=on;查看索引使用情况:可以判断索引是否用到select * from t where c1='a1' and c2='a2' and c5='a5' order by c2,c3; SELECT * FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE...
mysql 5.6分区表应用
mysql 5.6分区表测试:DROP TABLE IF EXISTS `my_orders`;CREATE TABLE `my_orders` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '表主键', `pid` int(10) unsigned NOT NULL COMMENT '产品ID', `price` decimal(15,2) NOT NULL COMMENT '单价', `num` int(11) NOT NULL COM...
生成大量测试数据脚本
生成大量数据来测试:create table t1 (id int not null primary key auto_increment,age int,name varchar(20),createtime date);create index idx_age_name_create on t1(age,name,createtime);vi create-data.sh#!/bin/bashi=1;MAX_INSERT_ROW_COUNT=$1;while [ $i -le $MAX_INSERT_ROW_COUNT ]do &n...
Mysql GITD复制中断处理
从库发现复制错误: "root@localhost:mysqld.sock [test]>show slave status\G;*************************** 1. row *************************** Slave_IO_State: Waiting for master to send event &nbs...
MHA_VIP配置
版本说明:MHA 0.56 is now available +2 Vote Up -0Vote Downposted by Yoshinori Matsunobu on Tue 01 Apr 2014 04:50 UTC Tags: (edit) mysql,MHAI released MHA version 0.56 today. Downloads are available here. MHA 0.56 includes below features.Supporting MySQL 5.6 GTID. If GTID and auto posit...
Percona server mysql之索引监控
User Statistics开启变量:默认是关闭的,它在内存中创建了几个HASH表set global userstat=on;set global thread_statistics=on;查看索引使用情况:可以判断索引是否用到select * from t where c1='a1' and c2='a2' and c5='a5' order by c2,c3; SELECT * FROM INFORMATION_SCHEMA.INDEX_STATISTICS ...
Mysql之复合索引使用规则
复合索引验证:从左向右发挥作用索引:(c1,c2,c3,c4):找到c1的基础上,可以找到c2,找到c3的基础上,可以找到c4a:select * from t where c1=x and c2=x and c3=x and c4=x;b:select * from t where c1=x and c2=x and c4>x and c3=x;用到了c1+c2+c3+c4c:select * from t where c1=x and c2=x and c4=x order by c3; &n...
Linux系统工具
yum install nmon
安装PIP
OS:Centos 6.7yum -y install epel-releaseyum -y install python-pipyum clean all