shell按列求和
http://www.linuxsong.org/2008/08/shell_05.html[@more@]Shell中如何按列求和? 转载http://www.linuxsong.org/2008/08/shell_05.html在Shell中,我们可以用awk实现按列求和的功能,非常简单。看下面的例子:1.简单的按列求和[linux@test /tmp]$ cat test123.52125.54126.36[linux@test /tmp]$ awk '{sum += $1};END {print sum}' test375.422.对符合某些条件的行,按列求和[linux@test /tmp]$ cat testaaa 123.52bbb 125.54aaa 123.52aaa 123.52ccc 126.36对文件test中 第一列为aaa的行求和[linux@test /tmp]$ awk '/aaa/ {sum += $2};E
mysql表结构复制
作者: 弦乐之花 | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明链接http://shiri512003.itpub.net/post/37713/500220[@more@]我们特别是oracle dbas常常会通过ctas来复制表结构,这样复制出来的表实际上会丢掉表的一些属性,索引就更不说了,在mysql中这样来复制表其实得到的也只是表大体结构而已。还好mysql提供了create table like命令方便进行表结构的复制,废话不说了root@mysql 02:55:17>use testDatabase changedroot@test 03:25:22>create table t1(a int,b int,key (a)) engine=myisam;Query OK, 0 r
InnoDB Plugin has been upgraded to version 1.0.8
test[@more@]InnoDB Plugin has been upgraded to version 1.0.8http://dev.mysql.com/doc/refman/5.1/en/news-5-1-47.html目前能看到的plugin本身的改进并不多,不知道正式发布后的change log list能有多长。对于选择plugin版本的用户而言,希望percona&google&facebook这些分支所提供的一些优秀的patch,能够尽快经过innodb的测试认可,这样大家可以在收到性能收益的时候,也能更加安心的使用,个人而言是把innodb作为稳定性测试的最后一道卡。InnoDB stores redo log records in a hash table during recovery. On 64-bit syst
How to Brainstorm New Ideas
http://www.theopenforce.com/2010/05/more_brainstorm.html[@more@]转载自http://www.theopenforce.com/2010/05/more_brainstorm.htmlMake it safe to contribute ideasThe best way to do this is encourage risk taking and acknowledge that some ideas will fail and that's acceptable. The people I know who are the most creative are also the most prolific when it comes to idea generation. And some of those ideas are, objectively speaking, total crap. But there are so many good ideas generated in the process
How To Kill Good Ideas
http://www.theopenforce.com/2010/05/brainstorm.htmlhttp://mysqlmusings.blogspot.com/2006/08/two-more-ways-to-kill-good-ideas.html [@more@]转载自http://www.theopenforce.com/2010/05/brainstorm.htmlThis past week I was in a couple of different strategic planning meetings. Some sessions were noticeably more effective than others in encouraging creative ideas. I started to wonder why that is and came up with the top ways to kill new ideas. If you see these tenets taking hold in your organization, the
DBI@参数数据类型
DBI@[@more@]简单记录下先http://search.cpan.org/~timb/DBI/DBI.pm#DBI_Constantshttp://perl.enstimac.fr/perl5.6.1/site_perl/5.6.1/sun4-solaris/DBD/Oracle.html#item_ora_type foreach (@{ $DBI::EXPORT_TAGS{sql_types} }) { printf "%s=%dn", $_, &{"DBI::$_"}; }
mysql innodb之select for update nowait
作者: 弦乐之花 | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明链接http://shiri512003.itpub.net/post/37713/499937[@more@]mysql innodb之select for update nowait习惯了oracle数据库的select for update nowait的同学,如果转在mysql环境开发的话,也许会不太适应——目前builtin版本的innodb不支持nowait句法的。早在08年已经被作为bug提了出来(http://bugs.mysql.com/bug.php?id=36285)。还好innodb plugin1.0.2开始支持bug文章里提及的session级innodb_lock_wait_timeout控制(http://dev.mysql.com/doc/i
mysql dead lock detection
作者: 弦乐之花 | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明链接http://shiri512003.itpub.net/post/37713/499911[@more@]在一组测试中发现并发从14到150(16core)性能有50%+的下降:#测试是通过sysbench进行的Activ Cmmit C_sel C_ins C_del C_upd15 24K 333K 24K 24K 71K14 25K 343K 25K 25K 74K13 24K 329K 24K 24K 71K15 24K 331K 24K 24K 71K16 24K 336K 24K 24K 72K16 24K 341K 24K 24K 73K16 23K 327K 23K 23K 70K12 23K 324K 23K 23K 69KActiv Cmmit C_sel C_ins C_del C_upd 149 8216 164K 8214 8214
解决TIME_WAIT的问题
原文链接:http://bbs.linuxtone.org/thread-853-1-1.html IT运维专家网--"自由平等,互助分享!"[@more@]原文链接:http://bbs.linuxtone.org/thread-853-1-1.html IT运维专家网--"自由平等,互助分享!" #netstat -n | awk ‘/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}’LAST_ACK 14SYN_RECV 348ESTABLISHED 70FIN_WAIT1 229FIN_WAIT2 30CLOSING 33TIME_WAIT 18122状态:描述CLOSED:无连接是活动的或正在进行LISTEN:服务器在等待进入呼叫SYN_RECV:一个连接请求已经到达,等待确认SYN_SENT:应用已经开始
并发执行hang问题
作者: 弦乐之花 | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明链接http://shiri512003.itpub.net/post/37713/499650[@more@]首先看下下面这个案例。http://www.oracleblog.cn/working-case/sql-wait-long-time-on-px-deq-execute-reply/oracle并发执行挂起的情况并不是特别多,但是并不稀奇,并发执行时,如果子进程无法返回父进程状态reply,父进程又没有相应处理措施,可能会处于傻等状态-挂起的情况。脚本使用到os并发进程&线程处理的时候,需要注意这个问题。
一些关于磁盘IO的文章
一些关于磁盘IO的文章[@more@]http://www.fishpool.org/post/2008/03/31/Optimizing-Linux-I/O-on-hardware-RAIDhttp://en.wikipedia.org/wiki/Tagged_Command_Queuinghttp://en.wikipedia.org/wiki/Native_command_queuing
转:linux io调度深入分析
http://www.lupaworld.com/56821/viewspace-142725.html[@more@]读完这篇最好读下http://kerneltrap.org/node/7637,really great转自http://www.lupaworld.com/56821/viewspace-142725.html一)I/O调度程序的总结:1)当向设备写入数据块或是从设备读出数据块时,请求都被安置在一个队列中等待完成.2)每个块设备都有它自己的队列.3)I/O调度程序负责维护这些队列的顺序,以更有效地利用介质.I/O调度程序将无序的I/O操作变为有序的I/O操作.4)内核必须首先确定队列中一共有多少个请求,然后才开始进行调度.二)I/O调度的4种算法1)CFQ(完全公平排队I
ocfs2之琐记
作者: 弦乐之花 | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明链接http://shiri512003.itpub.net/post/37713/499500[@more@]1.版本确认echo ocfs2-`uname -r` 2.下载版本http://oss.oracle.com/projects/ocfs2-tools/files/RedHat/RHEL5/x86_64/1.4.4-1/http://oss.oracle.com/projects/ocfs2/files/RedHat/RHEL5/x86_64/1.4.7-1/3.安装rpm -ivh *rpm4.命令行工具/etc/init.d/o2cbo2cb_ctlocfs2_hb_ctlcluster配置:/etc/ocfs2/cluster.confcluster:node_count = 3name = webclusternode:ip_port = 7777ip_address
通过hostname获取IP的perl脚本
作者: 弦乐之花 | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明链接http://shiri512003.itpub.net/post/37713/499431[@more@]有时候我们会需要获取主机IP信息,下面收录一个通过主机名获取IP的perl脚本http://www.metalshell.com/source_code/36/Hostname_Lookup.html#!/usr/bin/perl # resolv.pl written by detour@metalshell.com # # Resolves an ip into a host or a host into an ip. # # http://www.metalshell.com/ # use Socket; use strict; my $host_name = hostname($ARGV[0]); print &
oracle & NFS & backup & event & 10298
作者: 弦乐之花 | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明链接http://shiri512003.itpub.net/post/37713/499390[@more@]摘自metalink:From Oracle 10G R2 , Oracle checks the options with which a NFS mount is mounted on the filesystem. and this is done to ensure that no corruption of the database can happen as incorrectly mounted NFS volumes can result in data corruption. There are no single set of NFS mount options that work across all Oracle platforms Please ensure that you ha
oracle10g之standby tempfile自动创建
作者: 弦乐之花 | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明链接http://shiri512003.itpub.net/post/37713/499385[@more@]文档提到oracle 10g支持temp文件自动创建,但一直没有真正去关注这个过程,偶然的一次机会发现了这个自动创建的过程。一次open read only dg的时候,发现异常的慢,于是查看alert日志发现如下信息:Tue Apr 20 09:52:58 2010alter database open read onlyTue Apr 20 09:52:59 2010SMON: enabling cache recoveryTue Apr 20 09:53:01 2010Re-creating tempfile /opt/oracle/oradata/test/t
Opiino: Attach Failed! Error=-1 Ifvp=0
作者: 弦乐之花 | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明链接http://shiri512003.itpub.net/post/37713/499375[@more@]按照文档ID 399727.1说明,产生这种现象一般有两种情况:1.使用低版本的监听程序监听高版本的服务,如使用9i的监听器监听10g的服务。2.由于client端连接的不稳定性。如瞬间的大量连接则可能导致这样的问题。不过是哪种原因导致的,这时候系统都处于非健康状态,实际环境需要注意。关于该问题的详细说明请参考https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&docty
Improve reporting with duplicate server-ids
作者: 弦乐之花 | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明http://shiri512003.itpub.net/post/37713/499272[@more@]测试xtrabackup搭建slave过程中,疏忽使用了其他slave的参数文件,导致一个master下面挂了两个server_id一样的slave,结果自然是出现些意外。还好master没有什么影响,除了不断的conn&disconn。。。,原本的slave自然也是错误不断加不停的conn&disconn。。。,数据库频繁的login/out在繁忙事情是很危险的操作,特别是对于大量的conn&disonn,对于数据库就是灾难~相关的一些信息:1.
linux cron三言两语
作者: 弦乐之花 | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明http://shiri512003.itpub.net/post/37713/499162[@more@]crontab对于dba而言应该是很熟悉的了,然而crontab到底做什么的呢?crontab的man:Crontab is the program used to install, deinstall or list the tables used to drive the cron(8) daemon in ISC Cron.Each user can have their own crontab, and though these are files in /var, they are not intended to be edited directly.事实上crontab只是个传话的工具而已,或者只是个秘书,仵作,
innodb plugin 1.0.7 GA版本
作者: 弦乐之花 | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明http://shiri512003.itpub.net/post/37713/499158[@more@]innodb plugin自从09年11月发布1.0.6版本后,至今数月时间一直没有什么动静,现在为止1.0.6版仍然是作为RC版本包含在oracle@mysql分支中。生产环境我们已经尝试使用plugin版本。测试中发现plugin版本和percona出品的xtradb在性能上表现差不多的,while测试过程中并做针对性的参数调整,plugin和xtradb使用的是相同的参数文件。还有一个小小的发现是,同样性能下,plugin的主机cpu使用率要比xtr