Mysql 5.7 memcached plugin
mysql 5.7 memcached plugin通过在mysql进行写,memcached可以直接读取,适合在memcached加速读应用,不过限制多https://yq.aliyun.com/articles/8282mysql5.7 memcachedyum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm -yyum install libaio-devel ...
Memcached学习、应用
C/S架构,纯内存,集群之间无关,C语言2000行代码,高效,libevent数据清理:memcached当内存达到设定值时,会用LRU算法删除过期数据设定数据过期内存机制:内存分配:slab allocator,原先的malloc,采用Free来回收,易出现内存碎片预先分配大小内存块chunk,再把相同尺寸的chunk分成组(slab class),这些内存块...
Oracle全库导出
expdp \"/ as sysdba\" dumpfile =oafull.dmp full=y logfile=oafull.log directory=dir_dump2 job_name=my_job
实时统计PG连接数
more listpg.sh #!/bin/bashi=1while(( $i<61 ))do send=`date '+%Y-%m-%d %H:%M:%S'` conn=`ps -ef |grep postgres |wc -l` echo $send $conn >> /tmp/pgconn.log let "i++" sleep 10done
实时统计ORACLE连接数
more conn.sh #!/bin/bashwhile truedo send=`date '+%Y-%m-%d %H:%M:%S'` conn=`ps -ef |grep LOCAL=NO |wc -l` echo $send $conn >> /tmp/oraconn.log sleep 10done
通过触发器分发同步数据
通过触发器分发同步数据create table tab(id int not null primary key,name varchar(20),age int,address varchar(200));create table tab0(id int not null primary key,name varchar(20),age int,address varchar(200));create table tab1(id int not null primary key,name varchar(20),age int,address varchar(2...
Mysql技术小疑问
1.复制过滤问题: --replicate-do-db=db_name:USE prices; UPDATE sales.january SET amount=amount+1000;Statement-based replication:对于基于语句级的复制(或mixed级别),replicate_do_db这个参数指的是默认的数据库,即当前使用的数据库(use database),在默认数据库下更新replicate_do_db指定的数据...
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...