- 博客(86)
- 收藏
- 关注
原创 perl vim美化
格式优美的perl代码不但让人赏心悦目,而且可以方便阅读.perltidy的是sourceforge的一个小项目,在我们写完乱七八糟的代码后,他能像变魔术一样把代码整理得漂漂亮亮,快来体验一下吧!!!下载地址:http://jaist.dl.sourceforge.net/sourceforge/perltidy/Perl-Tidy-20071205.tar.gz安装方法:进入解压
2015-11-30 19:16:09 519
原创 14.7.1 Enabling File Formats
14.7 InnoDB File-Format Management InnoDB 文件-格式管理14.7.1 Enabling File Formats 14.7.2 Verifying File Format Compatibility 14.7.3 Identifying the File Format in Use 14.7.4 Modifying the File Format随着
2015-11-30 18:13:25 300
原创 14.5.7 Limits on InnoDB Tables InnoDB 表的限制
14.5.7 Limits on InnoDB Tables InnoDB 表的限制警告:不要转换MySQL 系统表 在MySQL 数据库里 从MyISAM表转换为InnoDB 表。这是一个不支持的操作,如果你这么做了,MySQL 不重启知道你恢复老的system tables 从一个备份或者重新生成 通过 mysql_install_db program。警告:不是一个好的注意配置InnoDB
2015-11-30 17:16:05 1011
原创 sql reg_substr
SQL> select ip, regexp_substr(ip,'[0-9]{1,3}',11) from machine_info;IP REGEXP_SUBSTR(IP,'[0-9]{1,3}',-------------------- ---------------------------------------------------------
2015-11-30 10:15:02 881
原创 nfs目录权限
jrhnpt01:/root# ls -ltr / | grep nfs01drwxr-xr-x 6 root root 4096 Oct 27 13:24 nfs01[root@nfs01 ~]# ls -ltr / | grep nfs01drwxr-xr-x 6 root root 4096 May 13 2015 nfjrhnpt01
2015-11-27 19:11:19 1005
原创 14.5.5 AUTO_INCREMENT Handling in InnoDB 在InnoDB AUTO_INCREMENT处理
14.5.5 AUTO_INCREMENT Handling in InnoDB 在InnoDB AUTO_INCREMENT处理14.5.5.1 Traditional InnoDB Auto-Increment Locking 14.5.5.2 Configurable InnoDB Auto-Increment LockingInnoDB 提供一个优化的显著的改善可扩展性和性能 ,插入记
2015-11-27 16:05:08 470
原创 Tk 表格的宽度
#禁止窗口缩放#$mw->resizable(0,0);require Tk::Table; $table_frame = $mw->Frame()->pack(-expand => 1,-fill => 'both'); $table = $table_frame->Table(-columns => 10, -rows =
2015-11-27 13:50:29 1711
原创 14.5.3 Grouping DML Operations with Transactions 分组DML 事务操作
14.5.3 Grouping DML Operations with Transactions 分组DML 事务操作默认情况下,连接到MySQL server 开启自动提交模式, 自动提交每个SQL 语句。这种模式的操作可能不熟悉的 如果你有其他数据库系统的经验,使用多个语句的事务,关闭自动提交 使用SQL语句 SET autocommit = 0 每个事务 COM
2015-11-27 09:34:07 372
原创 perl | 匹配多个
zjzc01:/root/test# cat a2.pl $a="1 a 2 3 ";if ($a =~/(a|b)/){print "1111111\n"};zjzc01:/root/test# perl a2.pl 1111111zjzc01:/root/test# cat a2.pl $a="1 b 2 3 ";if ($a =~/(a|b)/){print "11111
2015-11-27 09:21:44 3529
原创 perl 正则或匹配
if ($_ =~ /.*\s+"(POST|GET)\s*(.*?)\s*HTTP.*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/)10.252.142.174 - - [26/Nov/2015:20:28:02 +0800] "POST /api/register/device/detail HTTP/1.1" 200 77 0.008 123.173.1
2015-11-26 20:51:25 1022
原创 perl 监控日志告警
my $dir = '/usr/local/apache-tomcat-7.0.55_8082/logs';my $SDATE = strftime("%Y-%m-%d",localtime());my $file = "localhost.$SDATE.log";$mon_file = "$dir/$file";##########监控关键字,以空格隔开################
2015-11-26 17:14:41 871
原创 14.5.1 Creating InnoDB Tables
14.5 InnoDB Table Management InnoDB 表管理14.5.1 Creating InnoDB Tables14.5.2 Moving or Copying InnoDB Tables to Another Machine14.5.3 Grouping DML Operations with Transactions14.5.4 Converting Tab
2015-11-26 15:46:27 370
原创 14.4.4 InnoDB File-Per-Table Tablespaces
14.4.4 InnoDB File-Per-Table Tablespaces 14.4.4.1 Enabling and Disabling File-Per-Table Tablespaces从历史上看, 所有的InnoDB 表和Indexes 是存储在system 表空间。这个整体的方法是针对机器完全致力于数据库处理, 精心策划的数据增长,任何磁盘存储分配给MySQL 不需要用于其他的目的。
2015-11-26 11:11:54 762
原创 mysql pmax 分区
mysql> show create table ClientActionTrack\G;*************************** 1. row *************************** Table: ClientActionTrackCreate Table: CREATE TABLE `ClientActionTrack` ( `sn` big
2015-11-26 09:06:57 988
原创 14.4.2 Changing the Number or Size of InnoDB Redo Log Files 改变 InnoDB Redo Log Fiels 的大小和数量
14.4.2 Changing the Number or Size of InnoDB Redo Log Files 改变 InnoDB Redo Log Fiels 的大小和数量改变InnoDB redo log 文件的大小和数量 在MySQL 5.6.7 或者更早的版本,执行下面的操作:1.如果innodb_fast_shutdown 是设置为2, set innodb_fast_shutdo
2015-11-25 17:11:18 76
原创 mysql 普通表转分区表
1.按照现有表结构,创建一个临时表,用于分区表转换mysql> desc ClientActionTrack;+---------------+---------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra
2015-11-25 16:28:37 2973
原创 14.4.2 Changing the Number or Size of InnoDB Redo Log Files 改变 InnoDB Redo Log Fiels 的大小和数量
14.4.2 Changing the Number or Size of InnoDB Redo Log Files 改变 InnoDB Redo Log Fiels 的大小和数量改变InnoDB redo log 文件的大小和数量 在MySQL 5.6.7 或者更早的版本,执行下面的操作:1.如果innodb_fast_shutdown 是设置为2, set innodb_fast_shutdo
2015-11-25 13:49:21 113
原创 14.4 InnoDB Tablespace Management InnoDB 表空间管理
14.4 InnoDB Tablespace Management InnoDB 表空间管理:14.4.1 Resizing the InnoDB System Tablespace 14.4.2 Changing the Number or Size of InnoDB Redo Log Files 14.4.3 Using Raw Disk Partitions for the Syste
2015-11-25 13:19:41 576
原创 14.3.5 Configuring InnoDB Change Buffering
14.3.5 Configuring InnoDB Change Buffering14.3.5.1 Configuring the Change Buffer Maximum Size当 INSERT, UPDATE, and DELETE操作在表上执行, 索引列的值(特别是secondary keys的值)是经常在一个不排序的顺序,需要大量的I/O 带来给secondary indexesInn
2015-11-25 09:51:07 103
原创 14.3.4 Configuring the Memory Allocator for InnoDB 配置内存分配器
14.3.4 Configuring the Memory Allocator for InnoDB 配置内存分配器当InnoDB 被开发,内存分配器提供了操作系统和run-time 库往往缺乏性能和可扩展性。当时,没有内存分配器库调整用于多核CPUs.因此,InnoDB 实现它的自己的内存分配在内存子系统。这个分配器是通过一个单独的互斥保护,这可能是一个瓶颈。如今,随着多核系统越来越广泛的应用,
2015-11-24 17:56:54 504
原创 14.3.3.2 Configuring the Rate of InnoDB Buffer Pool Flushing 配置 InnoDB Buffer Pool 刷新频率
14.3.3.2 Configuring the Rate of InnoDB Buffer Pool Flushing 配置 InnoDB Buffer Pool 刷新频率InnoDB 执行某些后台任务,包括flush dirty pages(那些pages已经被修改了但是没有写入到database files)从buffer pool.InnoDB flushes buffer pool 页如
2015-11-24 17:03:46 92
原创 14.3.3 InnoDB Buffer Pool Configuration InnoDB Buffer Pool 配置:
14.3.3 InnoDB Buffer Pool Configuration InnoDB Buffer Pool 配置:14.3.3.1 Configuring InnoDB Buffer Pool Prefetching (Read-Ahead) 14.3.3.2 Configuring the Rate of InnoDB Buffer Pool Flushing 14.3.3.3 Ma
2015-11-24 16:08:31 83
原创 Perl 中的对象
Perl 中的对象让我们开始在Perl中实现对象之前,先来定义几个预备性的术语。一个对象(还可以称做一个实例,instance)就像一辆给定的轿车,拥有下面的这些内容:1.属性 又称特性(如颜色:红色;座位数:4;动力:180马力)2.标示(identity)3.行为(behavior) 某个特定类型的对象被称作属于一个类(class),我的车与你的车都属于叫做汽车的类,或者如果你并不关心具体的类别
2015-11-24 15:32:18 531
原创 第6章 模块
Perl 有着大量的第三方模块(module,即功能库) 可以使用,这也是为什么Perl如此成功的原因。Perl 允许你将代码划分成一个或多个可重用的模块,在这一章,我们将学习如何去完成下面的工作:1.使用关键字package 来定义模块2.使用use和require 来加载预定义模块,我们在前面章节中已经看到了几个使用use的例子3.使用”::” 记号来存取包的特定变量和子例程4.在运行时加载函数
2015-11-24 13:33:49 283
原创 mysql limit
select * from table limit 5; --返回前5行select * from table limit 0,5; --同上,返回前5行select * from table limit 5,10; --返回6-15行 limit 1770,15;这个意思是从1770行开始 取15行
2015-11-23 16:24:49 79
原创 svn 备份和恢复
一个较大的Subsersion版本库想用最少的空间来将它备份下来,用这个命令(请将/repo替换成你的版本库路径)svnadmin dump --deltas /repos |bzip2 |tee dump.bz2 | md5sum >dump.md5最重要的一步是 -deltas,将消耗更多的CPU资源,但拥有更有效的差异存储办法。bzip2压缩方案比gzip慢,但换来的更好的压缩率。更
2015-11-23 15:21:37 296
原创 14.2.6.4 Physical Structure of an InnoDB Index InnoDB Index 物理结构
14.2.6.4 Physical Structure of an InnoDB Index InnoDB Index 物理结构所有的InnoDB indexes 是B-trees ,index reocrds 是存储在树的leaf pages 里。默认的index page是16KB:当插入新的记录到一个InnoDB clustered index,InnoDB 尝试预留1/1
2015-11-23 14:14:18 125
原创 14.2.6.2 Clustered and Secondary Indexes 聚簇索引和第2索引
14.2.6.2 Clustered and Secondary Indexes 聚簇索引和第2索引每个InnoDB 表有一个特别的索引叫做clustered index,用于行的数据被保存,clustered index 是主键的同义词。 为了得到最好的查询性能,插入和其他数据库操作,你必须了解InnoDB如何使用 clustered index 来优化常用的查询和DML操作。
2015-11-23 11:13:56 454
原创 14.2.6.1 Role of the .frm File for InnoDB Tables
14.2.6 InnoDB Table and Index Structures InnoDB 表和索引结构:14.2.6.1 Role of the .frm File for InnoDB Tables14.2.6.2 Clustered and Secondary Indexes14.2.6.3 InnoDB FULLTEXT Indexes14.2.6.4 Physical
2015-11-23 10:18:17 88
原创 14.2.5 InnoDB Undo Logs
14.2.5 InnoDB Undo Logs一个undo log(或者rollback segment) 是一个存储区域,持有活动事务 数据修改的拷贝 。如果另外的事务需要看到一个原始的数据( 一致性读操作),没有提交的数据是从这个存储区域读取。默认的,这个区域是system 表空间的一部分。然而,在MySQL 5.6.3,undo log 可以放在单独的undo表空间。
2015-11-23 09:56:05 373
原创 14.2.4 InnoDB Redo Log
14.2.4 InnoDB Redo Log14.2.4.1 Group Commit for Redo Log Flushingredo log 是一个基于磁盘数据结构用于crash recovery 来校准被写入的数据 在不完整的事务。在正常的操作中, redo log 编码请求来改变InnoDB 表数据,可能是从SQL语句或者low-leble API请求。修改不完成修
2015-11-23 09:55:44 110
原创 14.2.3 InnoDB Multi-Versioning innoDB 多版本
14.2.3 InnoDB Multi-Versioning innoDB 多版本InnoDB 是一个多版本存储引擎, 它保留信息关于老版本的更改的行,为了支持事务的特性比如并发和恢复。这个信息是存在表空间在数据目录叫做回滚段(Oracle类似的数据结构).InnoDB 使用 回滚段的信息来执行回滚操作 。它也用于创建一致性读。在内部, InnoDB 增加 3个域给每个行存
2015-11-20 18:10:46 460
原创 14.2.2.7 Implicit Transaction Commit and Rollback和14.2.2.8 Deadlock Detection and Rollback
14.2.2.7 Implicit Transaction Commit and Rollback 隐式的事务提交和回滚默认情况下,MySQL 启动会话对于每个新的连接 是自动提交模式,所以MySQL 在每个SQL语句执行后提交 如果SQL语句不返回错误如果SQL 语句返回一个错误,commit 或者rollback 行为依赖错误。如果一个会话关闭自动提交,没有显示的提交最后的事务,MySQL
2015-11-20 15:13:51 420
原创 js 和css 加版本号问题
css和js带参数(形如.css?v=与.js?v= 或 .css?version=与.js?version= ) 使用参数有两种可能: 第一、脚本并不存在,而是服务端动态生成的,因此带了个版本号,以示区别。 即上面代码对于文件来说 等价于 但浏览器会认为他是 该文件的某个版本! 第二、客户端会缓存这些
2015-11-20 15:01:58 1507
原创 14.2.2.6 Locks Set by Different SQL Statements in InnoDB
14.2.2.6 Locks Set by Different SQL Statements in InnoDB锁定读,更新或者删除通常设置record locks 在每个index record,被扫描处理SQL语句。不重要的是 是否有WHERE 条件在语句里 来排除记录。InnoDB 不记住准确的WHERE 条件,但是只知道被扫描的索引范围。locks 通常是 next-key locks 也堵
2015-11-20 11:32:21 106
原创 perl dbi 控制事务
jrhxpt01:/root# cat dbi.pl use DBI; #!/usr/bin/perl $db_name='test';$ip='127.0.0.1';$user="root";$passwd="a2p13mvh";$dbh="";$dbh = DBI->connect("dbi:mysql:database=$db_name;host=$ip;port=33
2015-11-19 19:49:36 950
原创 READ-COMMITTED 不能进行可重复读和防止幻读
mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+----------------+| @@GLOBAL.tx_isolation | @@tx_isolation |+-----------------------+----------------+| REPEATABLE-READ
2015-11-19 17:03:32 1778
原创 REPEATABLE-READ 预读
SELECT @@GLOBAL.tx_isolation, @@tx_isolation; SESSION A:mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+-----------------+| @@GLOBAL.tx_isolation | @@tx_isolation |
2015-11-19 16:43:38 282
原创 【MySQL】gap lock 浅析
【MySQL】gap lock 浅析 【定义】 innodb 行级锁 record-level lock大致有三种:record lock, gap lock and Next-KeyLocks。 record lock 锁住某一行记录 gap lock 锁住某一段范围中的记录 next key lock 是前两者效果的叠加。下面是MYSQL官方文档中相关内容的链接 http://
2015-11-19 13:16:52 569
原创 REPEATABLE-READ和READ-COMMITTED幻读
SELECT @@GLOBAL.tx_isolation, @@tx_isolation; SESSION A: mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +———————–+—————–+ | @@GLOBAL.tx_isolation | @@tx_isolation | +———————–+—————–+ | REP
2015-11-19 12:55:08 423
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人