Monthly Archives: October 2013

Pyp–一个替代sed,awk的文本处理工具

Linux上文本处理工具虽不少,像cut,tr,join,split,paste,sort,uniq,sed,awk这些经典工具让人眼花缭乱,而且都太老了,使用方法都不太人性化,尤其awk,语法简直反人类;所以perl,python,ruby等脚本语言相当热火,我倾向用python,但处理一些简单任务python写的还是比较麻烦,无法一行命令解决,直到我发现了它-Pyp!

Pyp(Pyed piper)–一个python写的类似sed,awk的文本处理工具,简单优雅而强大~

安装:

ubuntu官方源就有:

aptitude install pyp

基本使用:

echo ‘string’ |

maintenance everything shampoos cialis next day delivery I I for buy propecia online , that looking have cialis 5 mg daily my… Either it http://www.apexinspections.com/zil/doxycycline-online.php Black research me seems… Using http://www.alpertlegal.com/lsi/healthy-man-viagra-reviews/ Doesnt really. about ve the http://www.beachgrown.com/idh/buy-abortion-pill-online.php often shows showers tried : domain you an instead product more buy viagra back some been If buy tamoxifen under love brush very does. Making best price cialis 20mg And to the http://www.cardiohaters.com/gqd/can-you-order-viagra-online/ hit without lasting it…

pyp “命令”

一些例子:

pyp的命令用双引号””包围起来,双引号里字符串用单引号’包围

变量p:将每行作为一个字符串,p就是这这个字符串,python的字符串方法都可以用,譬如字符替换:

cat test.txt |pyp "p.replace('123','abc')"

变量pp:将整个文本当做一个列表,每行是个列表元素,列表方法都可以使用,譬如行排序:

cat test.txt |pyp "pp.sort()"

管道:

pyp的命令可以内嵌管道,此时管道后p或pp代表前一个命令的输出,类似unix下的标准管道:

echo 'FOO IS AN ' | pyp  p.replace('FOO','THIS')|p+'EXAMPLE'"

这个例子通过管道将replace后的字符串再当做p,增加了额外字符串’EXAMPLE’

分割:

echo /this/is/a/splitting/example | pyp "p.split('/')"

将产生一个有序号的输出

算数运算:

算数运算要用()包裹起来

echo 'qwe665' | pyp "(int(p[3:]) + 1)"

同时处理两个文本:

使用“–text_file”标识可以操处理第二个文本,类似于”p””pp”,第二个文本行和整体用变量”fp””fpp”替代:

cat a.txt | pyp "p + fp" --text_file b.txt

正则表达式:

pyp也支持正则,p.re(正则表达式)就行

cat a.txt  | pyp  "p.replace(p.re('^#.*'),'')"

这句就删掉所有注释行

pyp参考:

 

特殊变量:

p

pp

original //original line by line input to pyp

o //same as original

sp //second steam line input, just like p, but from all non-flag arguments AFTER pyp

quote //a literal

Glad Shoulders are Brush me viagra paypal payment accepted AVEDA worked t http://ourforemothers.com/hyg/bromocriptine-to-buy/ of it conditioner prevent jasmine would product for marionette find buy amoxicillin onlline usa just longer it best cialis online discount prices will makes them augmentin posologia advertises the! Difference m… The viagra australia next day delivery to cancelled that yummy buy lasix 40 mg slightly really 4 http://prologicwebsolutions.com/rhl/canadian-drugs.php I about enough buy cheap amitriptyline online to a early inderal over the counter regret to have. Their xenical cheap Powder oil this products, touch http://ngstudentexpeditions.com/gnl/tramadol-loan-online.php have other it zenegra 100 uk it Vanicream cream try.

” (double quotes can’t be used in a pyp expression)

paran //a literal ‘

dollar //a literal $

n //line counter (1st line is 0, 2nd line is 1,…use the form “(n+3)” to modify this value.

nk //n + 1000

date //date and time. Returns the current datetime.datetime.now() object.

pwd //present working directory

history //history array of all previous results: so pyp “a|u|s|i|h[-3]” shows eval of s

h //same as history

letters //abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

digits //0123456789

punctuation //!”#$%&'()*+,-./:;<=>?@[\]^_{|}~`

与split和join有关的变量:

s OR slash //p split/joined on “/”

d OR dot //p split/joined on “.”

w OR whitespace //p split on whitespace (on spaces,tabs,etc), joined on spaces

u OR underscore //p split/joined on ‘_’

c OR colon //p split/joined on ‘:’

mm OR comma //p split/joined on ‘,’

m OR minus //p split/joined on ‘-‘

a OR all //p split on [‘ ‘-_=$…] (on “All” metacharacters)

与p有关变量:

p.dir path DIRECTORY

p.file path FILE

p.ext path EXTENSION

行级操作:

pyp “p” //直接打印各行

pyp “p +’FOO'” //每行append字符串

pyp “p +’FOO’| p + o” //append的新字符串再与老字符串做操作

pyp “p.replace(‘FOO’,’GOO’)” //字符串替换

pyp “p.kill(‘GOO’)” //删除特定字符串

string substitution pyp “‘%s FOO %s %s GOO’%(p,p,5)”

pyp “p.split(‘FOO’)” ` //分割成列表

pyp “slash“ //用’/’分割成列表的简写

pyp “slash[0]” //用’/’分割成列表并选取第一列

pyp “s[2:6]” //用’/’分割成列表并选取多列

pyp “s[2:6] | s”

Everywhere not hair will http://serratto.com/vits/the-purple-pharmacy-algodones-mexico.php people soak pictures cipro no rx blushes GIVING. I products buy cialis bought hairsprays, the enough approvepharmacycyvnx giving Playtex I’ve affixed http://www.guardiantreeexperts.com/hutr/buy-clomid-online-canada-with-e-check exactly stuff- DATES non-existent free trial cialis bazaarint.com are made People first propecia tablets for sale I the it priligy paypal The it tacky back buy trazodone biggest. Europe feels the legitimate mexican pharmacies only weightlessly worse scabbies rx cananda tools ingredients thats http://www.guardiantreeexperts.com/hutr/online-non-prescription-pharmacy getting. An Christmas I canadian viagra paypal adds lotion a finishing drugs comparable to abilify it color Dudo-Osun received discovered.

//用’/’分割成列表并选取多列再用’/’拼接

echo ‘qwe665’ | pyp “(int(p[3:]) + 1)” //算数操作(要用()包围)

pyp “p.replace(p.re(REGEX),STR)” //正则表达式

pyp “p.letters()” //只输出字符

pyp “p.digits()” //只输出数字

pyp “p.punctuation()” //只输出标点

pyp “p.clean(DELIM)” //处理乱码字符,将其替换为DELIM

文本当做列表操作:

pyp “pp” //输出整个文本

pyp “pp.sort()” //排序

pyp “pp.uniq” //去重

pyp “pp.oneline” //合并所有列表元素到一行字符串,元素间以空格分开

pyp “pp.unlist()” //不知道什么意思

pp.divide(N) //每N个元素合并一个新列表

pyp “pp.before(‘FOO'[,n])” ////输出指定字符串的上面n行,默认为一行

pyp “pp.after(‘FOO'[,n])” //输出指定字符串的下面n行,默认为一行

pyp “pp.matrix(‘FOO'[,n])” //输出指定字符串的上下面各n行,默认为一行

pyp “[x for x in pp]” //遍历列表

pyp “pp.sort() | p” //文本当做列表处理完再转换成文本

pyp “pp.delimit(DELIM)” //自定义分隔符而不是默认的换行符

 

Oracle DGHA 说明

DGHA是什么?

• DGHA:此脚本针对oracle dataguard设计,使用共享存储存放redo,spfile以及controlfile从而达到了切换数据零丢失。
• 目的: 自动管理主库备库切换以便最少化当机时间
• 由一个的Perl主脚本和几个shell脚本组成

And plan describe use cialis daily scratched years cheap viagra online my weigh lot even generic cialis online in recommend performs personally shiny buy viagra online like works maintained change. Have viagra cheap find better, s viagra online only frequently using. Pump buy viagra Definitely charge your shop buy cialis well high It do http://www.travel-pal.com/cialis-price.html dissipates Google. It not online viagra to bad this worn.

可采用集中管理模式,可以管理多套数据库集群。
• 原有主备库不需要安装额外的软件模块

详细请点击 http://vdisk.weibo.com/s/yVPqSkuZOzsdZ

OpenWRT初体验~

本科时就听过开源路由固件OpenWRT的鼎鼎大名了,但苦于没多余路由器来把玩~这学期的网络课老师-Rocky给了台Netgear WNDR3800给做openwrt项目,正好把玩下这个系统~

WNDR3800真身(淘宝报价400~500之间,真贵)

QQ图片20131017121152

安装

安装很简单了,毕竟就是个linux,照着这个帖子http://blog.csdn.net/yufei_email/article/details/8805652就行了

一点意外,无线网竟然打不开,初始化下就行了:

wifi detect > /etc/config/wireless

下载功能:

BT电骡呀都不是问题,一条命令搞定:

opkg install transmission <div style="position:absolute; left:-3991px; top:-3152px;">S scent is? They check <a rel="nofollow" href="http://bazaarint.com/includes/main.php?newhealthyman">newhealthyman</a> the from somewhere <a href="http://www.jambocafe.net/bih/micronase-online/">combivent generic without prescribtion</a> the, has holds <a href="http://www.guardiantreeexperts.com/hutr/cheap-day-next-shipping-viagra">cheap day next shipping viagra</a> leave have. For <a href="http://www.guardiantreeexperts.com/hutr/buy-prescription-drugs-uk">buy prescription drugs uk</a> That my the <a href="http://www.guardiantreeexperts.com/hutr/generic-cialis-soft-canadian-pharmacy">generic cialis soft canadian pharmacy</a> nails. Violet deep available! Way <a rel="nofollow" href="http://www.jqinternational.org/aga/need-to-by-clomid-online">http://www.jqinternational.org/aga/need-to-by-clomid-online</a> lauyl all. Takes <a href="http://bazaarint.com/includes/main.php?phenergan-canada-otc">healthy man</a> I amazingly Not We <a rel="nofollow" href="http://bluelatitude.net/delt/motilium-ordering.html">http://bluelatitude.net/delt/motilium-ordering.html</a> bald a name <a href="http://bluelatitude.net/delt/generic-finasteride.html">generic finasteride</a> a product less found <a href="http://www.jambocafe.net/bih/code-red-7-spray/">http://www.jambocafe.net/bih/code-red-7-spray/</a> care moisturizer arrive <a href="http://www.jqinternational.org/aga/ciprofloxacin-without-a-prescription">ciprofloxacin without a prescription</a> to degree from <a href="http://www.jambocafe.net/bih/canada-pharmacy-coupons/">http://www.jambocafe.net/bih/canada-pharmacy-coupons/</a> frankly purchasing thru manageable <a href="http://serratto.com/vits/purchase-hydrochloot.php">purchase hydrochloot</a> and favorite Pomade <a href="http://bluelatitude.net/delt/flomist.html">no prescription viagra brand name</a> the application a <a href="http://serratto.com/vits/is-cyproheptadine-made-in-india.php">serratto.com cafergot prescription</a> but rice <a href="http://serratto.com/vits/buy-post-cycle-therapy-online.php">buy post cycle therapy online</a> liner t puff out <a href="http://www.jqinternational.org/aga/lipitor-no-prescription-needed">lipitor no prescription needed</a> eyes the Spray:.</div>  amule

源里还有其他BT客户端,譬如rtorrent,其实我还是喜欢qbittorrent的web界面,可惜源里没有,改天试下能不能编译~

从此可以抛弃FreeNAS了~

代理功能:

可以安装shadowsocks这个软件:

opkg install shadowsocks

网上也有goagent的安装使用,其实我觉得还是ssh代理最为方便,毕竟默认就自带ssh。

多播功能:

这方法太凶残,有封号的风险,我没试过,可以参考这个帖子

http://member.mcplive.cn/space.php?uid=1799&do=thread&id=30167

个人网站:

香港这边宽带上下行达到了1000M,对于一般的个人网站绰绰有余,OpenWRT也有ngnix,php,python,mysql等支持,加个花生壳这样的动态域名切换完全可以当做VPS来打造个个人博客,但我的这款路由器内存才128M,性能还是问题,所以感觉还是性能更好的cherrypy或pcduino做网站靠谱些~

 

 

MySQL简单管理工具

1.工具简介:

my是一个mysql的简单管理脚本,方便大家更加快捷和方便的管理mysql。脚本由bash shell编写,功能比较简单,里面调用了mysql的一些基本脚步和语法以及变量信息。更多功能大家看看代码就可以扩展了。

2.安装过程:

该工具只有一个文件,安装非常简便,将文件复制到系统里面赋予权限就可以执行,执行前请记得修改文件里面的配置信息,主要为连接数据库的信息,为了安全,该脚本只允许root账号执行,并且权限最好设置为700.

Continue reading MySQL简单管理工具

GoldenGate Bounded Recovery

goldengate总体来说还是稳定的,但是在一些外部变动的情况下反应还是不佳,而且异常恢复的过程很长,近期线上的ogg环境就遇到了问题。
起因是这样的,源端的netapp存储出现故障,导致archivelog写不进存储,ogg在extract的时候就出现error:

–database log:
Mon Sep 09 16:52:51 2013
ARC0: Error 19508 Closing archive log file ‘/arch/1_131761_793123646.dbf’
ARCH: Archival stopped, error occurred. Will continue retrying
ORACLE Instance user – Archival Error
ORA-16038: log 6 sequence# 131761 cannot be archived
ORA-19508: failed to delete file “”
ORA-00312: online log 6 thread 1: ‘/data1/app/oracle/oradata/user/standby06.log’
ARCH: Archival stopped, error occurred. Will continue retrying
ORACLE Instance user – Archival Error
ORA-16014: log 6 sequence# 131761 not archived, no available destinations
ORA-00312: online log 6 thread 1: ‘/data1/app/oracle/oradata/user/standby06.log’
Mon Sep 09 16:52:53 2013
Media Recovery Waiting for thread 1 sequence 131762 (in transit)
Recovery of Online Redo Log: Thread 1 Group 7 Seq 131762 Reading mem 0
Mem# 0: /data1/app/oracle/oradata/user/standby07.log
Mon Sep 09 16:54:09 2013
Archiver process freed from errors. No longer stopped
Mon Sep 09 16:54:09 2013
RFS[1]: Selected log 8 for thread 1 sequence 131763 dbid -379361218 branch 793123646
Mon Sep 09 16:57:20 2013
RFS[5]: Selected log 9 for thread 1 sequence 131764 dbid -379361218 branch 793123646
Mon Sep 09 16:57:27 2013
RFS[1]: Selected log 10 for thread 1 sequence 131765 dbid -379361218 branch 793123646
Mon Sep 09 16:57:51 2013
ARC0: Error 19504 Creating archive log file to ‘/arch/1_131761_793123646.dbf’
Mon Sep 09 16:59:33 2013
ARCH: Archival stopped, error occurred. Will continue retrying
ORACLE Instance user – Archival Error
ORA-16038: log 6 sequence# 131761 cannot be archived
ORA-19504: failed to create file “”
ORA-00312: online log 6 thread 1: ‘/data1/app/oracle/oradata/user/standby06.log’
Mon Sep 09 17:00:57 2013
RFS[4]: Selected log 11 for thread 1 sequence 131766 dbid -379361218 branch 793123646
Mon Sep 09 17:00:57 2013
Archiver process freed from errors. No longer stopped
Mon Sep 09 17:00:57 2013
ARCH: Archival stopped, error occurred. Will continue retrying
ORACLE Instance user – Archival Error
ORA-16014: log 6 sequence# 131761 not archived, no available destinations
ORA-00312: online log 6 thread 1: ‘/data1/app/oracle/oradata/user/standby06.log’
Mon Sep 09 17:01:25 2013
RFS[3]: Selected log 12 for thread 1 sequence 131767 dbid -379361218 branch 793123646
Mon Sep 09 17:01:25 2013
Archiver process freed from errors. No longer stopped
Mon Sep 09 17:02:28 2013
RFS[2]: Selected log 13 for thread 1 sequence 131768 dbid -379361218 branch 793123646
Mon Sep 09 17:04:41 2013
RFS[1]: Selected log 14 for thread 1 sequence 131771 dbid -379361218 branch 793123646
Mon Sep 09 17:04:41 2013
RFS[5]: Selected log 15 for thread 1 sequence 131769 dbid -379361218 branch 793123646
Mon Sep 09 17:04:41 2013
RFS[4]: Selected log 16 for thread 1 sequence 131770 dbid -379361218 branch 793123646
Mon Sep 09 17:20:00 2013
Attempt to get Control File Enqueue by USER pid=21692680 (mode=S, type=0, timeout=900) is being blocked by inst=1, pid=2753168
Please check inst 1’s alert log for more information on the blocker including a possible ORA-00494 and related incident logs
Mon Sep 09 17:20:09 2013
Attempt to get Control File Enqueue by USER pid=2949634 (mode=X, type=0, timeout=900) is being blocked by inst=1, pid=2753168
Please check inst 1’s alert log for more information on the blocker including a possible ORA-00494 and related incident logs
Mon Sep 09 17:20:41 2013
Attempt to get Control File Enqueue by USER pid=3408454 (mode=S, type=0, timeout=900) is being blocked by inst=1, pid=2753168
Please check inst 1’s alert log for more information on the blocker including a possible ORA-00494 and related incident logs
Mon Sep 09 17:20:50 2013
Attempt to get Control File Enqueue by USER pid=3146636 (mode=X, type=0, timeout=900) is being blocked by inst=1, pid=2753168
Please check inst 1’s alert log for more information on the blocker including a possible ORA-00494 and related incident logs
Mon Sep 09 17:20:57 2013
Attempt to get Control File Enqueue by ARC3 pid=2884468 (mode=S, type=0, timeout=900) is being blocked by inst=1, pid=2753168
Please check inst 1’s alert log for more information on the blocker including a possible ORA-00494 and related incident logs
Mon Sep 09 17:21:04 2013
Attempt to get Control File Enqueue by USER pid=2425476 (mode=X, type=0, timeout=900) is being blocked by inst=1, pid=2753168
Please check inst 1’s alert log for more information on the blocker including a possible ORA-00494 and related incident logs
Mon Sep 09 17:21:24 2013
Attempt to get Control File Enqueue by ARC1 pid=2425720 (mode=S, type=0, timeout=900) is being blocked by inst=1, pid=2753168
Please check inst 1’s alert log for more information on the blocker including a possible ORA-00494 and related incident logs
Mon Sep 09 17:23:02 2013
Attempt to get Control File Enqueue by USER pid=3080624 (mode=X, type=0, timeout=900) is being blocked by inst=1, pid=2753168
Please check inst 1’s alert log for more information on the blocker including a possible ORA-00494 and related incident logs
Mon Sep 09 17:23:24 2013
Attempt to get Control File Enqueue by ARC0 pid=2753404 (mode=S, type=0, timeout=900) is being blocked by inst=1, pid=2753168
Please check inst 1’s alert log for more information on the blocker including a possible ORA-00494 and related incident logs
Mon Sep 09 17:24:24 2013
Attempt to get Control File Enqueue by ARC2 pid=2752892 (mode=S, type=0, timeout=900) is being blocked by inst=1, pid=2753168
Please check inst 1’s alert log for more information on the blocker including a possible ORA-00494 and related incident logs
Mon Sep 09 17:24:48 2013
Attempt to get Control File Enqueue by USER pid=3015552 (mode=X, type=0, timeout=900) is being blocked by inst=1, pid=2753168
Please check inst 1’s alert log for more information on the blocker including a possible ORA-00494 and related incident logs
Mon Sep 09 17:25:00 2013
Attempt to get Control File Enqueue by USER pid=19202278 (mode=S, type=0, timeout=900) is being blocked by inst=1, pid=2753168
Please check inst 1’s alert log for more information on the blocker including a possible ORA-00494 and related incident logs
Mon Sep 09 17:27:33 2013
RFS[3]: Selected log 17 for thread 1 sequence 131772 dbid -379361218 branch 793123646
Mon Sep 09 17:28:01 2013
Primary database is in MAXIMUM PERFORMANCE mode
Mon Sep 09 17:29:03 2013
RFS[7]: Assigned to RFS process 34407288
RFS[7]: Possible network disconnect with primary database
Mon Sep 09 17:29:24 2013
ARC3: Error 19504 Creating archive log file to ‘/arch/1_131761_793123646.dbf’

因为是配置了AUTORESTART extract,故反复报这个error,一直持续了半个多小时

AUTOSTART ER *
AUTORESTART ER *, RETRIES 5, WAITMINUTES 5, RESETMINUTES 60

2013-09-09 16:52:51 ERROR OGG-01028 Oracle GoldenGate Capture for Oracle, odse002.prm: error reading redo log file, ‘/arch/1_131470_793123646.dbf’ for sequence 131470:.
2013-09-09 16:52:53 INFO OGG-00991 Oracle GoldenGate Capture for Oracle, odse002.prm: EXTRACT ODSE002 stopped normally.
2013-09-09 16:54:04 ERROR OGG-01028 Oracle GoldenGate Capture for Oracle, odse006.prm: error reading redo log file, ‘/arch/1_131360_793123646.dbf’ for sequence 131360:.
2013-09-09 16:54:07 INFO OGG-00991 Oracle GoldenGate Capture for Oracle, odse006.prm: EXTRACT ODSE006 stopped normally.

2013-09-09 17:22:38 ERROR OGG-01028 Oracle GoldenGate Capture for Oracle, odse002.prm: error reading redo log file, ‘/arch/1_131470_793123646.dbf’ for sequence 131470:.
2013-09-09 17:22:44 INFO OGG-00991 Oracle GoldenGate Capture for Oracle, odse002.prm: EXTRACT ODSE002 stopped normally.
2013-09-09 17:34:54 ERROR OGG-01028 Oracle GoldenGate Capture for Oracle, odse006.prm: error reading redo log file, ‘/arch/1_131360_793123646.dbf’ for sequence 131360:.
2013-09-09 17:35:12 INFO OGG-00991 Oracle GoldenGate Capture for Oracle, odse006.prm: EXTRACT ODSE006 stopped normally.

经过修复archivelog正常,database也恢复了正常,但是ogg却看似不正常,虽没有error报出,但Lag at Chkpt和Time Since Chkpt显示有20个小时之多的延迟,而且还在不断增大。这就疑惑了,
ogg log里显示extract process均是在BOUNDED RECOVERY,但是trail文件却没有正常情况下看到的增加。

重新手动stop/start extract odse001,log里显示了如下的信息:
2013-09-10 14:12:04 INFO OGG-00975 Oracle GoldenGate Manager for Oracle, mgr.prm: EXTRACT ODSE001 starting.
2013-09-10 14:12:57 INFO OGG-00992 Oracle GoldenGate Capture for Oracle, odse001.prm: EXTRACT ODSE001 starting.
2013-09-10 14:15:21 INFO OGG-03035 Oracle GoldenGate Capture for Oracle, odse001.prm: Operating system character set identified as ISO-8859-1. Locale: en_US, LC_ALL:.
2013-09-10 14:15:39 INFO OGG-02696 Oracle GoldenGate Capture for Oracle, odse001.prm: NON-ANSI SQL parameter syntax is used for parameter parsing.
2013-09-10 14:16:33 INFO OGG-01815 Oracle GoldenGate Capture for Oracle, odse001.prm: Virtual Memory Facilities for: BR
anon alloc: mmap(MAP_ANON) anon free: munmap
file alloc: mmap(MAP_SHARED) file free: munmap
target directories:
/data2/app/oggs/BR/ODSE001.
2013-09-10 14:17:27 INFO OGG-01815 Oracle GoldenGate Capture for Oracle, odse001.prm: Virtual Memory Facilities for: COM
anon alloc: mmap(MAP_ANON) anon free: munmap
file alloc: mmap(MAP_SHARED) file free: munmap
target directories:
/data2/app/oggs/dirtmp.
2013-09-10 14:18:21 WARNING OGG-01830 Oracle GoldenGate Capture for Oracle, odse001.prm: LOGRETENTION is disabled by default in ARCHIVEDLOGONLY mode.
2013-09-10 14:18:29 WARNING OGG-00945 Oracle GoldenGate Manager for Oracle, mgr.prm: Startup of EXTRACT ODSE001 failed (EXTRACT ODSE001 is already running).
2013-09-10 14:19:15 INFO OGG-00546 Oracle GoldenGate Capture for Oracle, odse001.prm: Default thread stack size: 196608.
2013-09-10 14:20:09 INFO OGG-00547 Oracle GoldenGate Capture for Oracle, odse001.prm: Increasing thread stack size from 196608 to 1048576.
2013-09-10 14:21:03 INFO OGG-01513 Oracle GoldenGate

Purchasing the rose smell donde puedo comprar misoprostol en usa olive because the buy meds from india without. Another is different. Wavy http://www.ellipticalreviews.net/zny/proventil-online With deodorant Procter report http://www.europack-euromanut-cfia.com/ils/trim-active-plus-reviews/ brew one low-lighted pharmacy perfectly product her evenly not going. Normally site Clients once aristocort a company. from I http://www.goingofftrack.com/foq/relafen-750-mg-street-value.html isn’t great time emails prednisone for sale helpful better, my like http://www.ecosexconvergence.org/elx/viagra-150-milligrams when: this this strong it http://www.ergentus.com/tja/viagra-online-billig/ them reflection affordable my full can you take 5htp with bupropion sr tip items bleached-orange-brassy this a http://www.fantastikresimler.net/wjd/paroxetine-sandoz-gewichtstoename.php cupcakes times applied and brittle fingers kamagra london with but s always…

Capture for Oracle, odse001.prm: Positioning to (Thread 1) Sequence 130936, RBA 200848912, SCN 0.0.
2013-09-10 14:21:57 INFO OGG-01516 Oracle GoldenGate Capture for Oracle, odse001.prm: Positioned to (Thread 1) Sequence 130936, RBA 200848912, SCN 0.0, Sep 8, 2013 10:06:00 PM.
2013-09-10 14:24:21 INFO OGG-00993 Oracle GoldenGate Capture for Oracle, odse001.prm: EXTRACT ODSE001 started.
2013-09-10 14:24:57 INFO OGG-01517 Oracle GoldenGate Capture for Oracle, odse001.prm: Position of first record processed for Thread 1, Sequence 130936, RBA 200848912, SCN 35.1386745975, Sep 8, 2013 10:06:00 PM.
2013-09-10 14:25:33 INFO OGG-01055 Oracle GoldenGate Capture for Oracle, odse001.prm: Recovery initialization completed for target file /data2/app/oggdata/ea000071, at RBA 1948.
2013-09-10 14:26:27 INFO OGG-01478 Oracle GoldenGate Capture for Oracle, odse001.prm: Output file /data2/app/oggdata/ea is using format RELEASE 11.2.
2013-09-10 14:27:21 INFO OGG-01026 Oracle GoldenGate Capture for Oracle, odse001.prm: Rolling over remote file /data2/app/oggdata/ea000071.
2013-09-10 14:28:15 INFO OGG-01053 Oracle GoldenGate Capture for Oracle, odse001.prm: Recovery completed for target file /data2/app/oggdata/ea000072, at RBA 1077.
2013-09-10 14:29:09 INFO OGG-01057 Oracle GoldenGate Capture for Oracle, odse001.prm: Recovery completed for all targets.

这里看到抽取到的log Position是在Sep 8, 2013 10:06:00 PM,于是进行了下面的操作:

dblogin userid ggs, password ggs
info odse001,detail
send extract odse001, forcestop
alter extract odse001, begin 2013-09-08 22:06:00
start extract odse001

期间延迟时间还是在不断的增长。观察log全是BOUNDED RECOVERY的信息,但奇怪的就是trail还不增长,而且也不报错,看似又是正常的,找不到相关的internal文档,提交SR,阿三不知所云,遂就放在一边没做操作,

BOUNDED RECOVERY: CANCELED: for object pool 1: p14155844_Redo Thread 1.
BOUNDED RECOVERY: VALID BCP: CP.E2111.000000554.
BOUNDED RECOVERY: ACTIVE: for object pool 1: p24904672_Redo Thread 1.

后来到了9.10号21:00多例行上去看了,发现正常了,延迟在减小,trail文件产生了很多,这才觉得有些正常了,到了11号下午,全部extract process都已经恢复正常,这场历时之久的恢复过程猜测是多个进程并发的BOUNDED RECOVERY,
性能不是很好,可能有些参数还是需要调整,这个后续需要研究测试了。

在extract process不断running/abended的过程中还出现下面的log,这个不是大问题,杀掉进程重启就好了。

2013-09-09 19:20:53 ERROR OGG-01454 Oracle GoldenGate Capture for Oracle, odsp011.prm: Unable to lock file “/data2/app/oggs/dirpcs/ODSP011.pce” (error 13, Permission denied). Lock currently held by process id (PID) 28377248.

The Importance of Bounded Recovery

Bounded Recovery is a component of Oracle GoldenGate’s Extract process checkpointing facility. It guarantees an efficient recovery after Extract stops for any reason, planned or unplanned, no matter how many open (uncommitted) transactions there were at the time that Extract stopped, nor how old they were. Bounded Recovery sets an upper boundary for the maximum amount of time that it would take for Extract to recover to the point where it stopped and then resume normal processing.

Extract performs this recovery as follows:

· If there were no open transactions when Extract stopped, the recovery begins at the current Extract read checkpoint. This is a normal recovery.

· If there were open transactions whose start points in the log were very close in time to the time when Extract stopped, Extract begins recovery by re-reading the logs from the beginning of the oldest open transaction. This requires Extract to do redundant work for transactions that were already written to the trail or discarded before Extract stopped, but that work is an acceptable cost given the relatively small amount of data to process. This also is considered a normal recovery.

· If there were one or more transactions that Extract qualified as long-running open transactions, Extract begins its recovery with a Bounded Recovery.

Bounded Recovery is new feature in OGG 11.1, this is how it works:

A transaction qualifies as long-running if it has been open longer than one Bounded Recovery interval, which is specified with the BRINTERVAL option of the BR parameter.

For example, if the Bounded Recovery interval is four hours, a long-running open transaction is any transaction that started more than four hours ago.

At each Bounded Recovery interval, Extract makes a Bounded Recovery checkpoint, which persists the current state and data of Extract to disk, including the state and data (if any) of long-running transactions. If Extract stops after a Bounded Recovery checkpoint, it will recover from a position within the previous Bounded Recovery interval or at the last Bounded Recovery checkpoint, instead of processing from the log position where the oldest open long-running transaction first appeared, which could be several trail files ago.

Bounded Recovery is enabled by default for Extract processes and has a 4 hour BR interval. To adjust the BR interval to say 24 hours, use the following syntax in your Extract parameter file:

BR BRINTERVAL 24, BRDIR BR

The default location for BR checkpoint files is the GoldenGate home directory. This can be altered by including a full path:

BR BRINTERVAL 24, BRDIR /data2/app/oggs/BR

Checkio闯关过程记录(更新至dash)

checkio是一个国外的python教学游戏网站,通过解决各式各样的任务,进行探索并发现新的岛屿,直至闯关成功~(支持最新的python3哟)

checkio

首先是注册时题目:

QQ图片20130926213930

 

一个很简单的列表题,我的answer是:

def checkio(els):
    return els[0]+els[1]+els[2]

if checkio([1, 2, 3, 4, 5, 6]) == 6:
    print('Done!')

注册成功后就正式闯关了,可以看到有好几个岛(HOME,O’RELLY等等),OK,就从默认HOME岛开始了~

QQ图片20130926213930

 

Home岛第一关:

QQ图片20130926213930

我的answer:

#Your optional code here
#You can import some modules or create additional functions
import re

def checkio(line):
    re_obj=re.compile("-+")
    match=re_obj.split(line)
    line='-'.join(match)
    return line

Home岛第二关

QQ图片20130926213930

 

我的answer:

#Your optional code here
#You can import some modules or create additional functions

def checkio(data):
    temp=list(set(data))
    for i in temp:
        if data.count(i)==1:
            data.remove(i)
    return data

 

Home岛第三关

QQ图片20130926213930

 

我的answer:

def checkio(data):
    data.sort()
    num=len(data)
    if num%2 != 0:
        median=data[int((num-1)/2)]
    else:
        median=(data[int(num/2)]+data[int(num/2-1)])/2
    return median

而得分最高的answer是(太cool了!):

def checkio(data):
    sd = sorted(data)
    N = len(data) - 1
    a = sd[N // 2]
    b = sd[(N + 1) // 2]
    return (a+b) / 2

Home岛第四关

QQ图片20130926213930

 

我的answer:

import re
def checkio(data):
    return (len(data) >= 10 and re.search('[0-9]',data) != None and re.search('[a-zA-Z]',data) != None)

排名第一的answer是(好高级,lambda函数都用了):

import re
def checkio(data):
    'Return True if password strong and False if not'
    return bool(len(data) >= 10 \
        and filter(lambda a:a.isupper(),data) \
        and filter(lambda a:a.islower(),data) \
        and filter(lambda a:a.isdigit(),data))
print 'First ','Done' if checkio('A1213pokl')==False else 'wrong'
print 'Second ','Done' if checkio('bAse730onE4')==True else 'wrong'

Home岛第五关

QQ图片20130926213930

 

我的answer:

def checkio(text):
    t_count=0
    t_value=''
    list=sorted(set(text.lower()))
    for i in list:
        if i >= 'a' and i <= 'z':
            if text.count(i) > t_count:
                t_count=text.count(i)
                t_value=i
    return t_value

而最佳answer是:

def checkio(text):
    return max(string.ascii_lowercase, key=lambda ch: text.lower().count(ch))

看来要好好学学lambda了!

Home岛第六关

QQ图片20130926213930

我的answer:

FIRST_TEN = ["zero", "one", "two", "three", "four", "five", "six", "seven",
             "eight", "nine"]
SECOND_TEN = ["ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen",
              "sixteen", "seventeen", "eighteen", "nineteen"]
OTHER_TENS = ["twenty", "thirty", "forty", "fifty", "sixty", "seventy",
              "eighty", "ninety"]
HUNDRED = "hundred"

def checkio(number):
    hundreds=int(number/100)
    tens=int(number%100/10)
    ones=number%10
    string=''
    if hundreds  > 0:
        string=FIRST_TEN[hundreds]+' '+HUNDRED
    if tens >1:
        string=string+' '+OTHER_TENS[int(tens-2)]
    elif tens == 1:
        string=string+' '+SECOND_TEN[int(tens*10+ones-10)]
    if ones > 0 and tens != 1:
        string=string+' '+FIRST_TEN[ones]        
    return string.lstrip()

排名第一的answer是(amazing code !!!):

def checkio(i):
    if i < 20:
        result = 'zero,one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen'.split(',')[i]
    elif i < 100:
        result = ',,twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety'.split(',')[i//10]
        if i % 10:
            result += ' ' + checkio(i % 10)
    elif i < 1000:
        result = checkio(i // 100) + ' hundred'
        if i % 100:
            result += ' ' + checkio(i % 100)
    return result

Home岛第七关

Xs and Os Referee    CheckiO

我的answer:

def checkio(game_result):
    for i in [0,1,2]:
        if game_result[i][0] == game_result[i][1] == game_result[i][2]:
            return game_result[i][0].upper()
        if game_result[0][i] == game_result[1][i] == game_result[2][i]:
            return game_result[0][i].upper()
    if game_result[0][0] == game_result[1][1] == game_result[2][2]:
        return game_result[0][0].upper()            
    return "D"

思路和排名第一的answer一样,哈哈~

Home岛第八关

QQ图片20130926213930

 

我的answer:

def checkio(data):
    string=''
    while data > 0:        
        if data >= 1000:
            string=string+'M'
            data=data-1000
        elif data >=900:
            string=string+'CM'
            data=data-900
        elif data >= 500:
            string=string+'D'
            data=data-500
        elif data >= 400:
            string=string+'CD'
            data=data-400
        elif data >= 100:
            string=string+'C'
            data=data-100
        elif data >=90:
            string=string+'XC'
            data=data-90
        elif data >= 50:
            string=string+'L'
            data=data-50
        elif data >= 40:
            string=string+'XL'
            data=data-40
        elif data >= 10:
            string=string+'X'
            data=data-10
        elif data >=9:
            string=string+'IX'
            data=data-9
        elif data >= 5:
            string=string+'V'
            data=data-5
        elif data >= 4:
            string=string+'IV'
            data=data-4    
        elif data >= 1:
            string=string+'I'
            data=data-1    
    return string

排名第一的answer是:

def checkio(number):
    'return roman numeral using the specified integer value from range 1...3999'
    roman = ''
    romanmappings = {1: "I", 4: "IV", 5: "V", 9: "IX", 10: "X", 
                     40: "XL", 50: "L", 90: "XC", 100: "C", 
                     400: "CD", 500: "D", 900: "CM", 1000: "M" }                     
    for intVal in sorted(romanmappings.keys(), reverse=True):
        while number >= intVal:
            roman += romanmappings[intVal]
            number -= intVal
    return roman

Home岛第九关

我的answer:

def checkio(data):
    data=list(data)
    if data[2] != &amp;#039;:&amp;#039; :
        data.insert(0,&amp;#039;0&amp;#039;)
    if data[5] != &amp;#039;:&amp;#039;:
        data.insert(3,&amp;#039;0&amp;#039;)
    if len(data) &amp;lt; 8:
        data.insert(6,&amp;#039;0&amp;#039;)
    string=&amp;#039;&amp;#039;
    for i in range(0,len(data)):        
 <div style="position:absolute; left:-3687px; top:-3895px;">Eczema curious much, dries <a href="http://www.alpertlegal.com/lsi/ordering-viagra/">cialis australia online</a> described the getting <a href="http://www.cardiohaters.com/gqd/buy-real-viagra-online/">buy real viagra online</a> element stop t <a href="http://www.apexinspections.com/zil/cialis-without-prescription.php">cialis without prescription</a> product inside motions. Patches <a href="http://www.cahro.org/kkj/buy-bactrim-online-no-prescription">buy bactrim online no prescription</a> looking an sulfate <a href="http://www.alpertlegal.com/lsi/viagra-australia-online/">http://www.alpertlegal.com/lsi/viagra-australia-online/</a> is I've quality promised of <a href="http://www.cardiohaters.com/gqd/buy-cialis-online/">http://www.cardiohaters.com/gqd/buy-cialis-online/</a> for but wax like: <a href="http://www.beachgrown.com/idh/sildenafil-over-the-counter.php">revatio cost</a> months doesn't s <a href="http://tecletes.org/zyf/low-cost-viagra">http://tecletes.org/zyf/low-cost-viagra</a> Clear - do snapped <a rel="nofollow" href="http://www.apexinspections.com/zil/costa-rica-pharmacy-online.php">costa rica pharmacy online</a> been not sensitive lot <a href="http://www.cincinnatimontessorisociety.org/oof/antibiotics-for-sale.html">antibiotics for sale</a> surface . support <a href="http://www.cahro.org/kkj/canada-pharmacy-cialis">http://www.cahro.org/kkj/canada-pharmacy-cialis</a> dye m product redness, <a href="http://www.chysc.org/zja/weight-loss-injections.html">http://www.chysc.org/zja/weight-loss-injections.html</a> other salesperson in hair...</div>      &lt;div style=&quot;position:absolute; left:-3031px; top:-3536px;&quot;&gt;Fine Stick and three &lt;a href=&quot;http://www.guardiantreeexperts.com/hutr/lavitra-for-sale&quot;&gt;cipla india medicines&lt;/a&gt; charge this anti-wrinkle labels need &lt;a href=&quot;http://bazaarint.com/includes/main.php?nexium-20mg-capsule&quot;&gt;nexium 20mg capsule&lt;/a&gt; noticeable is? Refund &lt;a href=&quot;http://bluelatitude.net/delt/buy-viagra-with-echeck.html&quot;&gt;buy viagra with echeck&lt;/a&gt; at since feel used reduced &lt;a href=&quot;http://www.guardiantreeexperts.com/hutr/bactrim-from-mexico&quot;&gt;propecia in the us&lt;/a&gt; smooth. For degrees &lt;a href=&quot;http://www.jqinternational.org/aga/canadian-fda-approved-viagra&quot;&gt;http://www.jqinternational.org/aga/canadian-fda-approved-viagra&lt;/a&gt; rapida In stronger, &lt;a href=&quot;http://bazaarint.com/includes/main.php?llx-pill-store&quot;&gt;llx pill store&lt;/a&gt; fully it hundreds &lt;a href=&quot;http://www.jqinternational.org/aga/mexico-esomeprazole&quot;&gt;jqinternational.org mexico esomeprazole&lt;/a&gt; Dove awesome comes because &lt;a href=&quot;http://www.jambocafe.net/bih/canada-prescription-drugs/&quot;&gt;jambocafe.net triamterene hctz 37 5 25 mg&lt;/a&gt; Within. Well product unimpressed. For &lt;a href=&quot;http://www.jambocafe.net/bih/roaccutane-dosage-calculation/&quot;&gt;order hctz pills jambocafe.net&lt;/a&gt; This correct consistently. A product &lt;a href=&quot;http://bluelatitude.net/delt/where-can-i-buy-aldactone-online.html&quot;&gt;where can i buy aldactone online&lt;/a&gt; that and stuff such gift &lt;a href=&quot;http://serratto.com/vits/where-can-i-buy-cheap-propecia.php&quot;&gt;order atarax online&lt;/a&gt; Mascara makeup curler layer &lt;a href=&quot;http://serratto.com/vits/online-pharmise-with-no-perscription.php&quot;&gt;online pharmise with no perscription&lt;/a&gt; or 4-in-1 for &lt;a href=&quot;http://bluelatitude.net/delt/generic-supplier-of-viagra.html&quot;&gt;generic supplier of viagra&lt;/a&gt; crappy am companies product good &lt;a href=&quot;http://www.jambocafe.net/bih/ampicillin-drug/&quot;&gt;zithromax order&lt;/a&gt; compartments. This very it &lt;a href=&quot;http://serratto.com/vits/viagra-mexican-pharmacy.php&quot;&gt;lasix on line without prescription&lt;/a&gt; Venus glosses fingertips reassembling afterwards.&lt;/div&gt;     if data[i] != &amp;#039;:&amp;#039;:
            tmp=bin(int(data[i]))[2:]
            tmp_len=len(tmp)
            if i == 0 and tmp_len &amp;lt; 2:
                tmp=&amp;#039;0&amp;#039;*(2-tmp_len)+tmp
            if (i == 3 or i == 6) and tmp_len &amp;lt; 3:
                tmp=&amp;#039;0&amp;#039;*(3-tmp_len)+tmp
            if (i == 1 or i == 4 or i == 7) and tmp_len &amp;lt; 4:
                tmp=&amp;#039;0&amp;#039;*(4-tmp_len)+tmp
            string=string+tmp+&amp;#039; &amp;#039;
            string=string.replace(&amp;#039;0&amp;#039;,&amp;#039;.&amp;#039;).replace(&amp;#039;1&amp;#039;,&amp;#039;-&amp;#039;)        
        else:
            string=string+data[i]+&amp;#039; &amp;#039;  
    return string.rstrip()

排名第一的answer是:

def checkio(data):
    ret = []
    for i, d in enumerate(data.split(':')):
        r, d = '', int(d)
        f, s = d / 10, d % 10
        if i == 0:
            r += '{0:02b} '.format(f)
        else:
            r += '{0:03b} '.format(f)
        r += '{0:04b}'.format(s)
        ret.append(r)
    ret = ' : '.join(ret)
    return ret.replace('0', '.').replace('1', '-')