mysql DBA技术难度低为什么工资比oracle高

mysql DBA技术难度低为什么工资比oracle高,第1张

这标题,mysql DBA难度底?你那来得底气说的这话?

有空多了解了解大项目中使用的mysql比oracle简单?

所谓DBA,常用的数据库都会!

回答你的问题:

随着时间发展,oracle的优势,几乎就当然无存,而且用这东西,价格不菲,06年单位买了3用户授权的10G版本7000美刀。按当时汇率折合RMB56000,傻子设计才天天想着用他。

阿里的技术大牛,提出去IOE(IBM的小机,oracle数据库,E是一个存储整列)化,并实践了技术可行性(数据库这块用mysql代替了oracle)。谁闲着蛋疼还必须花钱买oracle?也就这波mysql用得原来越多。相应的DBA逆转也正常。

你是用ado连接数据库的吧,我在VC下也同样出现这样的问题,使用游标的时候获取不到输出值,且还会导致连接中断。估计是mysql存储过程还不够完善,在oracle使用就没有任何问题。

你可以用Mysql Api直接连接mysql,应该没有这样的问题.

python抓取汇率

1 # -*- coding: utf-8 -*- 2 """ 3 获取实时汇率 4 Created on Fri Oct 18 13:11:40 2013 5  6 @author: alala 7 """ 8  9 import httplib10 import re11 import MySQLdb12 import datetime13 14 URL = 'fx.cmbchina.com' #网站名15 PATH = '/hq/'           #页面路径16 HOST = 'localhost'      #数据库地址(ip)17 DB = "money"            #数据库名称18 USER = 'root'           #数据库用户名19 PSWD = 'sheet'          #数据库密码20 21 httpClient = None22 23 try:24     #抓去网页内容25     httpClient = httplib.HTTPConnection(URL, 80, timeout=30)26     httpClient.request('GET', '/hq/')27     response = httpClient.getresponse()28     html = response.read()    

29     #print html30     31     #用正则表达式抓去汇率数据32     reg = re.compile(r"""33     <tr>\s*<td\s+class="fontbold">\s*(?P<name>\S+)\s*</td>\s*         #交易币34     <td\s+align="center">\s*(?P<unit>\d+)\s*</td>\s*                  #交易币单位35     <td\s+align="center"\s+class="fontbold">\s*(?P<base>\S+)\s*</td>\s*  #基本币    

36     <td\s*class="numberright">\s*(?P<midPrice>\d+\.\d+)\s*</td>\s*       #中间价37     <td\s*class="numberright">\s*(?P<sellPrice>\d+\.\d+)\s*</td>\s*                     #卖出价38     <td\s*class="numberright">\s*(?P<buyPrice1>\d+\.\d+)\s*</td>\s*                     #现汇买入价39     <td\s*class="numberright">\s*(?P<buyPrice2>\d+\.\d+)\s*</td>\s*                     #现钞买入价40     <td\s*align="center">\s*(?P<time>\d+:\d+:\d+)\s*</td>\s*                       #时间41     """, re.MULTILINE | re.X)42     rows = reg.findall(html)43     #打印汇率数据44     for r in rows:45         print ','.join(map(str,r)), '\n'46         47     #数据库 *** 作48     #确保mysqldb已经安装,可以用下面的命令安装49     #pip install MySQL-python50 51     #建立和数据库系统的连接52     conn = MySQLdb.connect(host=HOST, user=USER,passwd=PSWD)53 54     #获取 *** 作游标55     cursor = conn.cursor()56     #执行SQL,创建一个数据库.57     cursor.execute("CREATE DATABASE IF NOT EXISTS " + DB)58 59     #选择数据库60     conn.select_db(DB)61     #执行SQL,创建一个数据表.62     cursor.execute("""CREATE TABLE IF NOT EXISTS exchange_rate(63                     name VARCHAR(50) COMMENT '交易币' PRIMARY KEY,

64                     unit INT COMMENT '交易币单位',65                     base VARCHAR(50) COMMENT '基本币',66                     midPrice FLOAT COMMENT '中间价',67                     sellPrice FLOAT COMMENT '卖出价',68                     buyPrice1 FLOAT COMMENT '现汇买入价',69                     buyPrice2 FLOAT COMMENT '现钞买入价',70                     time DATETIME COMMENT '时间' ) """)71     records = []                

72     for r in rows:73         (name,unit,base,midPrice,sellPrice,buyPrice1,buyPrice2,time) = r74         time = datetime.datetime.strptime(datetime.datetime.now().strftime('%Y-%m-%d')75             + " " + time,'%Y-%m-%d %H:%M:%S')76         record = (name,int(unit),base,float(midPrice),float(sellPrice),77                   float(buyPrice1),float(buyPrice2),time)78         records.append(record)79     #print records80     #更新汇率81     cursor.executemany("REPLACE exchange_rate VALUES(%s,%s,%s,%s,%s,%s,%s,%s)"82             ,records)83     conn.commit()84 85     #关闭连接,释放资源86     cursor.close()87         88 except Exception,e:89     print e90 finally:91     if httpClient:92         httpClient.close()


欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/zaji/7364878.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-04
下一篇 2023-04-04

发表评论

登录后才能评论

评论列表(0条)

保存