- 博客(34)
- 资源 (4)
- 收藏
- 关注
原创 第33个python程序:while循环
[root@mysql1 pshell]# cat ex33.py #!/usr/bin/env Python#-*-coding:utf-8-*-i=0numbers=[]while i print "at the top i is %d" % i numbers.append(i) i=i+1 print "numnbers now: "
2016-09-30 15:36:38 300
原创 第32个python程序:循环和列表
[root@mysql1 pshell]# cat ex32.py #!/usr/bin/env Python#-*-coding:utf-8-*-the_count=[1,2,3,4,5]fruits=['apples','oranges','pears','apricots']change=[1,'pennies',2,'dimes',3,'quarters']
2016-09-30 15:06:28 327
原创 insert产生死锁dead lock的实验
session 1:mysql> create table test(id int primary key,name char(3)); Query OK, 0 rows affected (0.09 sec)mysql> begin;Query OK, 0 rows affected (0.00 sec)mysql> insert into test val
2016-09-30 10:43:31 1292
原创 第31个python程序:逻辑判断
[root@mysql1 pshell]# python ex31.pyyou enter a dark room with two doors. do you go through door #1 or door #2?> 1there's a giant bear here eating a cheese cake. what do you do?1. take the cak
2016-09-29 17:32:43 1079
原创 第30个python程序:else和if
[root@mysql1 pshell]# cat ex30.py #!/usr/bin/env Python#-*-coding:utf-8-*-people=30cars=40buses=15if cars>people: print "we should take the cars."elif cars print "we sho
2016-09-29 17:01:39 275
原创 第29个python程序:if语句
[root@mysql1 pshell]# cat ex29.py #!/usr/bin/env Python#-*-coding:utf-8-*-people=20cats=30dogs=15if people print "too many cats! the world is doomed!"if people>cats:
2016-09-28 15:09:23 280
原创 第28个python程序:布尔表达式练习
[root@mysql1 pshell]# pythonPython 2.6.6 (r266:84292, Jan 22 2014, 01:49:05) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2Type "help", "copyright", "credits" or "license" for more information
2016-09-28 14:54:13 1038
原创 ORA-02266: 表中的唯一/主键被启用的外键引用
如果一个表,它的主键是其他表的外键关联的,那么这个表在truncate的时候会报错SQL> create table gw1(id int primary key);Table created.SQL> create table gw2(sid int ,foreign key (sid) references gw1(id));Table crea
2016-09-28 11:38:41 2849
原创 第25个python程序
[root@mysql1 pshell]# cat ex25.py#!/usr/bin/env Python#-*-coding:utf-8-*-def break_words(stuff): """this function will break up words for us.""" words=stuff.split(' ') return words
2016-09-26 11:34:34 605 1
原创 第24个python程序:更多练习
[root@mysql1 pshell]# cat ex24.py #!/usr/bin/env Python#-*-coding:utf-8-*-print "let's practice everything."print 'you\'d need to know \'bout escapes with \\ that do \n newline and \t ta
2016-09-26 10:57:39 271
原创 第21个python程序:函数可以返回东西
[root@mysql1 pshell]# cat ex21.py #!/usr/bin/env Python#-*-coding:utf-8-*-def add(a,b): print "adding %d + %d" % (a,b) return a+bdef subtract(a,b): print "subtracting %d - %d"
2016-09-20 11:33:13 353
原创 第20个python程序:函数和文件
[root@mysql1 pshell]# cat ex20.py #!/usr/bin/env Python#-*-coding:utf-8-*-from sys import argvscript,input_file=argvdef print_all(f): print f.read()def rewind(f): f.s
2016-09-19 11:48:24 696
原创 第18个python程序:命名变量代码函数
[root@mysql1 pshell]# cat ex18.py #!/usr/bin/env Python#-*-coding:utf-8-*-# this one is like your scripts with argvdef print_two(*args): arg1,arg2=args print "arg1: %r,arg2: %r" %
2016-09-19 11:19:18 382
原创 第19个python程序:函数和变量
[root@mysql1 pshell]# cat ex19.py #!/usr/bin/env Python#-*-coding:utf-8-*-def cheese_and_crackers(cheese_count,boxes_of_crackers): print "you have %d cheeses!" % cheese_count print "you
2016-09-19 11:16:14 462
原创 mysql将死锁信息记录到error log
由一个参数控制mysql> show variables like '%deadlock%';+----------------------------+-------+| Variable_name | Value |+----------------------------+-------+| innodb_print_all_deadlocks
2016-09-18 14:47:05 3891
原创 第17个python程序:拷贝文件
[root@mysql1 pshell]# cat ex17.py #!/usr/bin/env Python#-*-coding:utf-8-*-from sys import argvfrom os.path import existsscipt, from_file, to_file = argvprint "copying from %s t
2016-09-12 15:23:07 432
原创 ORACLE DBA_JOBS中的FAILURES
今天,开发反应一个job执行有时成功,有时失败,让帮忙查看下原因。检查dba_jobs视图发现FAILURES为0,broken为N检查alert log发现了报错信息:ORA-12012: 自动执行作业 43 出错ORA-01400: 无法将 NULL 插入 ("a"."gw")ORA-06512: 在 "a.gw", line 22ORA-06512: 在 "a.pre
2016-09-08 11:47:04 2994 1
原创 第16个python程序:读写文件
[root@mysql1 pshell]# cat ex16.py #!/usr/bin/env Python#-*-coding:utf-8-*-from sys import argvscript,filename = argvprint "we're going to erase %r." % filenameprint "if you don
2016-09-08 11:11:15 338
原创 mysql binlog server
MySQL Binlog Server:是利用某个工具,把线上活跃的库的日志拉取到本地进行备份。在MySQL 5.6以后,可以利用mysqlbinlog这个命令去把远程机器的日志备份到本地目录,从而达到增量或是日志安全方面的备份。利用mysql 5.6的mysqlbinlog命令,可以把远程的binlog完全镜象一份放到本地,方法如下:/usr/local/mysql/bin/mysq
2016-09-08 10:47:58 552
原创 第15个python程序:读文件
[root@mysql1 pshell]# cat ex15.py #!/usr/bin/env Python#-*-coding:utf-8-*-from sys import argvscript,filename = argvtxt = open(filename)print "here's your file %r:" % filenamepri
2016-09-08 10:42:25 380
原创 第14个python程序:提示和传递
[root@mysql1 pshell]# cat ex14.py #!/usr/bin/env Python#-*-coding:utf-8-*-from sys import argvscript,user_name,user_id = argvprompt = '>> 'print "hi %s, i'm the %s script. your
2016-09-07 18:17:10 344
原创 in和exists的区别
in 是把外表和内表作hash join,而exists是对外表作loop,每次loop再对内表进行查询。一直以来认为exists比in效率高的说法是不准确的。如果查询的两个表大小相当,那么用in和exists差别不大。如果两个表中一个较小,一个是大表,则子查询表大的用exists,子查询表小的用in:create table gw4
2016-09-07 17:22:38 475
原创 in和exists和null,not in和not exists和null的研究
创建测试表:create table gw1(id int,name varchar2(1));create table gw2(id int,name varchar2(1));create table gw3(id int,name varchar2(1));insert into gw1 values(1,'a');insert into gw1 values(2,'b'
2016-09-07 16:45:08 1523
原创 第13个python程序:参数
[root@mysql1 pshell]# python ex13.py a b cthe script is called: ex13.pyyour first variable is: ayour second variable is: byour third variable is: c[root@mysql1 pshell]# cat ex13.py #!/usr/
2016-09-02 17:21:58 257
原创 python查看帮助文档的命令--pydoc
[root@mysql1 pshell]# pydoc raw_inputHelp on built-in function raw_input in module __builtin__:raw_input(...) raw_input([prompt]) -> string Read a string from standard input.
2016-09-02 16:33:04 2197
原创 第7个python程序:更多打印
[root@mysql1 pshell]# cat ex7.py #!/usr/bin/env Python#-*-coding:utf-8-*-print "mary had a little lamb."print "its fleece was white as %s." % 'snow'print "and everywhere that mary went."
2016-09-02 16:30:18 254
原创 第12个python程序:提示输入
[root@mysql1 pshell]# cat ex12.py #!/usr/bin/env Python#-*-coding:utf-8-*-age = raw_input("how old are you? ")height = raw_input("how tall are you? ")weight = raw_input("how much do you
2016-09-02 16:28:02 887
原创 mysql的半同步复制的配置
半同步复制:5.5开始支持当Master上开启半同步复制的功能时,至少应该有一个Slave开启其功能。此时,一个线程在Master上提交事务将受到阻塞,直到得知一个已开启半同步复制功能的Slave已收到此事务的所有事件,或等待超时。环境:mysql5.6.301.检查是否支持动态载入插件:mmysql> show variables like 'have
2016-09-02 15:50:30 301
原创 mysql的flush语法
MySQL的FLUSH句法(清除或者重新加载内部缓存) FLUSH flush_option [,flush_option],如果你想要清除一些MySQL使用内部缓存,你应该使用FLUSH命令。为了执行FLUSH,你必须有reload权限。FLUSH HOSTS 清空主机缓存表。如果你的某些主机改变IP或如果你得到错误消息Host ... is blocked,你应
2016-09-02 14:21:30 538
原创 mysql参数之:SQL_QUOTE_SHOW_CREATE
执行show create语句的时候,是否用·包含mysql> show variables like 'SQL_QUOTE_SHOW_CREATE';+-----------------------+-------+| Variable_name | Value |+-----------------------+-------+| sql_quote
2016-09-02 11:28:06 1088
原创 解析mysqldump的过程和文件
环境:mysql5.6.30数据库:gw1,gw2表:gw1.t1 myisam,gw2.t2 innodb执行的语句:mysqldump --single-transaction --master-data=2 --databases gw1 gw2 > 3306_20160902.sql通过general log查看的,mysqldu
2016-09-02 11:04:28 810
原创 深入研究ora-01555(1)
ORA-01555(快照过旧)问题让很多人感到十分头痛。最近我们的生产系统上也报出了ORA-01555错误。就结合这次案例将ORA-1555问题作个案例分析,并浅析产生原因和各种解决办法。如果要了解1555错误产生的原因,就需要知道ORACLE的两个特性:一致性读和延迟块清除。(1)一致性读: 当Oracle更新数据块(Data Block Oracle中最小的存储单
2016-09-01 18:26:08 478
原创 第11个python程序:接收输入
[root@mysql1 pshell]# cat ex11.py#!/usr/bin/env Python#-*-coding:utf-8-*-print "how old are you?",age = raw_input()print "how tall are you?",height = raw_input()print "how much do yo
2016-09-01 11:41:54 1128
原创 第10个python程序:转义
[root@mysql1 pshell]# cat ex10.py #!/usr/bin/env Python#-*-coding:utf-8-*-print "i am 6'2\" tall." #将字符串中的双引号转义print 'i am 6\'2" tall.' #将字符串中的单引号转义#使用3引号""",可以在3引号之间放入任意多行的文字
2016-09-01 10:55:14 495
clickhouse20.8.2.3全套rpm包
2020-09-23
linux上oracle监控端需要安装的rpm包
2018-06-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人