jackyrong

  博客园 :: 首页 :: 联系 :: 订阅 订阅 :: 管理
  927 Posts :: 2 Stories :: 1064 Comments :: 57 Trackbacks

公告

数据库相关/oracle

摘要: 1 使用explain语句去查看分析结果,如 explain select * from test1 where id=1; 会出现: id selecttype table type possible_keys key key_len ref rows extra各列 其中,type=const表示通过索引一次就找到了,key=primary的话,表示使用了主键 type=all,表示为全表...阅读全文
posted @ 2010-06-22 23:19 jackyrong的世界 阅读(200) | 评论 (0) 编辑

摘要: key_buffer_size - 这对MyISAM表来说非常重要。如果只是使用MyISAM表,可以把它设置为可用内存的 30-40%。合理的值取决于索引大小、数据量以及负载。 记住,MyISAM表会使用操作系统的缓存来缓存数据,因此需要留出部分内存给它们,很多情况下数据比索引大多了。尽管如此,需要总是检查是否所有的 key_buffer 都被利用了。 .MYI 文件只有 1GB,而 key_bu...阅读全文
posted @ 2010-05-19 22:48 jackyrong的世界 阅读(75) | 评论 (1) 编辑

摘要: SQL Server2005重装Performance Monitor Counter Requirement错误解决重装SQL Server 2005 时System Configuration Check 出现Performance Monitor Counter Requirement错误:错误信息如下:Messages Performance Monitor Counter Require...阅读全文
posted @ 2010-04-12 15:34 jackyrong的世界 阅读(117) | 评论 (0) 编辑

摘要: 对于任何一个数据库管理系统来说,内存的分配使用绝对可以算的上是其核心之一了,所以很多希望更为深入了解某数据库管理系统的人,都会希望一窥究竟,我也不例外。 从内存的使用方式MySQL 数据库的内存使用主要分为以下两类 * 线程独享内存 * 全局共享内存 今天这篇文章暂时先分析 MySQL 中主要的 “线程独享内存” 的。 在 MySQL 中,线程独享内存主要用于各客户端连接线...阅读全文
posted @ 2010-04-08 11:36 jackyrong的世界 阅读(98) | 评论 (0) 编辑

摘要: 在Oracle中,要按特定条件查询前N条记录,用个rownum就搞定了。 select * from emp where rownum <= 5 而且书上也告诫,不能对rownum用">",这也就意味着,如果你想用 select * from emp where rownum > 5 则是失败的。要知道为什么会失败,则需要了解rownum背后的机制: 1 Oracle execu...阅读全文
posted @ 2010-03-15 21:15 jackyrong的世界 阅读(89) | 评论 (0) 编辑

摘要: 如果你没有修改过MySQL的配置,缺省情况下,wait_timeout的初始值是28800。wait_timeout过大有弊端,其体现就是MySQL里大量的SLEEP进程无法及时释放,拖累系统性能,不过也不能把这个指设置的过小,否则你可能会遭遇到“MySQL has gone away”之类的问题,通常来说,我觉得把wait_timeout设置为10是个不错的选择,但某些情...阅读全文
posted @ 2010-02-02 14:24 jackyrong的世界 阅读(143) | 评论 (0) 编辑

摘要: 在 oracle中,要经常查看process:查看ORACLE最大进程数:SQL> select count(*) from v$session#连接数SQL> Select count(*) from v$session where status='ACTIVE' #并发连接数SQL> show parameter processes#最大连接SQL> alter sys...阅读全文
posted @ 2010-01-07 19:35 jackyrong的世界 阅读(175) | 评论 (0) 编辑

摘要: 表stuinfo,有三个字段recno(自增),stuid,stuname 建该表的Sql语句如下: CREATE TABLE [StuInfo] ( [recno] [int] IDENTITY (1, 1) NOT NULL , [stuid] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL , [stuname] [varchar] (10...阅读全文
posted @ 2009-10-20 12:34 jackyrong的世界 阅读(278) | 评论 (0) 编辑

摘要: 1 显示操作时间 set timing on;2 nvl(comm,0),如果COMM为空,则显示0,否则用COMM显示3 当 groupy,having,order by同时存在时,必须是先出现group by,然后是having,最后是order by4 select * from (select a1.*,rownum rn from (select * from scott.emp) a1...阅读全文
posted @ 2009-10-07 15:08 jackyrong的世界 阅读(86) | 评论 (0) 编辑

摘要: 最近遇到个问题,ORACLE 10G的数据库导出后,其实在9I中导入是有问题的,于是 尝试装了个9I,去连10G后,用9I的EXP命令导出,谁知道导出后还是错误,BLOB字段都丢失, 阅读全文
posted @ 2009-07-17 00:35 jackyrong的世界 阅读(267) | 评论 (0) 编辑

摘要: 当在tomcat下设置数据源时.比如<?xml version="1.0" encoding="UTF-8"?><Context><Resource name="jdbc/panyu" type="javax.sql.DataSource",不要忘记把驱动放在common\lib下,而不是放在工程的lib下,否则出错的阅读全文
posted @ 2009-06-23 16:38 jackyrong的世界 阅读(215) | 评论 (0) 编辑

摘要: 在Oracle的逻辑存储中,表空间由各种类型的段组成,而段则由区组成,区是段分配存储的单位。当建立一个表段时,Oracle为该段分配初始区,如果之后由于数据的插入,初始区装满后,将继续分配下一个区,区的大小在表段或者更高一级的存储参数中指定,下面通过实验的方式把分配的过程展示出来。 1. 在scott方案下建立初始表段SQL> conn scott/tiger 已连接。 SQL> c...阅读全文
posted @ 2009-06-22 21:47 jackyrong的世界 阅读(628) | 评论 (0) 编辑

摘要: 一般情况下@xxxxx.sql即可 先建立一个方案(schema),这里我的理解是oracle里的方案其实是相当于其他数据库中的"数据库",因为如果oracle里没特殊的要求,其实就在当前实例对应的数据库里建立不同的方案就可以了. 首先 1、创建一个表空间2、要在oracle中创建一个用户,因为oracle中的每个方案是与用户对应的。比如,并设置用户对该表空间的操作权限(connect,resou...阅读全文
posted @ 2009-05-15 11:10 jackyrong的世界 阅读(559) | 评论 (0) 编辑

posted @ 2008-10-26 21:19 jackyrong的世界 阅读(213) | 评论 (0) 编辑

posted @ 2008-09-21 10:20 jackyrong的世界 阅读(143) | 评论 (0) 编辑

posted @ 2008-09-12 18:17 jackyrong的世界 阅读(174) | 评论 (1) 编辑

posted @ 2008-09-11 17:40 jackyrong的世界 阅读(231) | 评论 (0) 编辑

posted @ 2008-09-03 00:02 jackyrong的世界 阅读(1245) | 评论 (0) 编辑

posted @ 2008-08-07 11:41 jackyrong的世界 阅读(172) | 评论 (0) 编辑

posted @ 2008-08-02 17:30 jackyrong的世界 阅读(120) | 评论 (0) 编辑

posted @ 2008-07-30 12:32 jackyrong的世界 阅读(169) | 评论 (0) 编辑

posted @ 2008-07-30 12:08 jackyrong的世界 阅读(322) | 评论 (0) 编辑

posted @ 2008-07-29 09:23 jackyrong的世界 阅读(127) | 评论 (0) 编辑

posted @ 2008-07-29 08:57 jackyrong的世界 阅读(410) | 评论 (0) 编辑

posted @ 2008-07-29 08:47 jackyrong的世界 阅读(522) | 评论 (0) 编辑

posted @ 2008-07-29 08:34 jackyrong的世界 阅读(147) | 评论 (0) 编辑

posted @ 2008-07-27 23:40 jackyrong的世界 阅读(78) | 评论 (0) 编辑

posted @ 2008-07-27 09:39 jackyrong的世界 阅读(139) | 评论 (0) 编辑

posted @ 2008-07-25 12:29 jackyrong的世界 阅读(109) | 评论 (0) 编辑

posted @ 2008-07-24 16:54 jackyrong的世界 阅读(115) | 评论 (0) 编辑

posted @ 2008-07-23 18:07 jackyrong的世界 阅读(150) | 评论 (0) 编辑

posted @ 2008-07-21 09:35 jackyrong的世界 阅读(314) | 评论 (0) 编辑

posted @ 2008-07-20 12:52 jackyrong的世界 阅读(664) | 评论 (0) 编辑

posted @ 2008-07-20 10:05 jackyrong的世界 阅读(119) | 评论 (0) 编辑

posted @ 2008-07-20 09:21 jackyrong的世界 阅读(566) | 评论 (0) 编辑

posted @ 2008-07-19 11:52 jackyrong的世界 阅读(798) | 评论 (0) 编辑

posted @ 2008-07-19 11:40 jackyrong的世界 阅读(90) | 评论 (0) 编辑

posted @ 2008-07-16 00:08 jackyrong的世界 阅读(112) | 评论 (0) 编辑

posted @ 2008-07-15 10:03 jackyrong的世界 阅读(269) | 评论 (0) 编辑

posted @ 2008-07-14 17:49 jackyrong的世界 阅读(234) | 评论 (0) 编辑

posted @ 2008-07-14 11:15 jackyrong的世界 阅读(130) | 评论 (0) 编辑

posted @ 2008-07-10 12:02 jackyrong的世界 阅读(82) | 评论 (0) 编辑

posted @ 2008-07-06 17:42 jackyrong的世界 阅读(108) | 评论 (0) 编辑

posted @ 2008-07-04 10:17 jackyrong的世界 阅读(64) | 评论 (0) 编辑

posted @ 2008-07-03 17:01 jackyrong的世界 阅读(337) | 评论 (0) 编辑

posted @ 2008-07-03 11:14 jackyrong的世界 阅读(99) | 评论 (0) 编辑

posted @ 2008-07-02 22:59 jackyrong的世界 阅读(449) | 评论 (0) 编辑

posted @ 2008-06-29 08:41 jackyrong的世界 阅读(155) | 评论 (0) 编辑

posted @ 2008-06-28 09:30 jackyrong的世界 阅读(99) | 评论 (0) 编辑

posted @ 2008-06-25 15:10 jackyrong的世界 阅读(69) | 评论 (0) 编辑

posted @ 2008-06-25 15:09 jackyrong的世界 阅读(62) | 评论 (0) 编辑

摘要: 之前有个项目,已经充分用MYSQL的调优调了,速度感觉还可以.但发现索引没用上.于是调整之.
阅读全文
posted @ 2008-06-22 18:58 jackyrong的世界 阅读(257) | 评论 (0) 编辑

posted @ 2008-06-22 18:34 jackyrong的世界 阅读(82) | 评论 (0) 编辑

posted @ 2008-06-22 12:58 jackyrong的世界 阅读(126) | 评论 (0) 编辑

posted @ 2008-06-12 09:11 jackyrong的世界 阅读(489) | 评论 (0) 编辑

posted @ 2008-05-25 09:38 jackyrong的世界 阅读(169) | 评论 (0) 编辑

posted @ 2008-05-04 21:26 jackyrong的世界 阅读(1796) | 评论 (0) 编辑

posted @ 2008-01-08 19:00 jackyrong的世界 阅读(212) | 评论 (0) 编辑

posted @ 2008-01-06 09:10 jackyrong的世界 阅读(111) | 评论 (0) 编辑

posted @ 2008-01-03 08:36 jackyrong的世界 阅读(132) | 评论 (0) 编辑

posted @ 2007-12-12 23:34 jackyrong的世界 阅读(171) | 评论 (0) 编辑

posted @ 2007-11-03 16:59 jackyrong的世界 阅读(529) | 评论 (2) 编辑

posted @ 2007-10-29 16:40 jackyrong的世界 阅读(283) | 评论 (1) 编辑

posted @ 2007-10-04 11:48 jackyrong的世界 阅读(171) | 评论 (0) 编辑

posted @ 2007-08-02 16:35 jackyrong的世界 阅读(443) | 评论 (0) 编辑

摘要: 偶的是WIN2000下的,MYSQL4的数据库,为了升级,一直担心到4。1会有问题,结果用PHPMYADMIN 2。7去导出再导入放到
MYSQL 4。1里,果然中文乱码,于是,只好把mysql 4.1的MY。INI的编码改为gb2312,并把原来mysql 4.0的DATA目录下的
数据库所有文件都直接COPY到4。1的DATA目录下,结果没乱码了,呵呵阅读全文
posted @ 2007-08-01 19:52 jackyrong的世界 阅读(325) | 评论 (2) 编辑

摘要: sql server 2005数据库转换到SQL 20000数据库的话,是比较麻烦的,不能通过向导的方式
那样转,那样的话会报错,必须按照如下步骤阅读全文
posted @ 2007-07-17 10:54 jackyrong的世界 阅读(4800) | 评论 (0) 编辑

摘要: 比如某个数据库下对SQL SERVER的数据库进行了每天的备份,现在要保留7天以内的,其他的删除掉,用ASP可以实现了,但要用到filesystemobject,不大爽阅读全文
posted @ 2007-06-29 17:09 jackyrong的世界 阅读(546) | 评论 (0) 编辑

摘要: 一段删除某个数据库下所有数据的好脚本阅读全文
posted @ 2007-06-29 16:21 jackyrong的世界 阅读(354) | 评论 (1) 编辑

摘要: 最近遇到了一个sql server 2000文件,ldf损坏了,但mdf还在,于是想办法恢复之,网上找到了些方法,
现小结之阅读全文
posted @ 2007-02-08 11:09 jackyrong的世界 阅读(1419) | 评论 (4) 编辑

摘要: 在数据挖掘的学习中,遇到了中位数的概念,一GOOGLe之下,其实发现以前的课本等是没学习到的,但现在的中小学生都有学了,
现在复习一下阅读全文
posted @ 2006-12-21 23:13 jackyrong的世界 阅读(1607) | 评论 (2) 编辑

posted @ 2006-12-14 10:13 jackyrong的世界 阅读(2370) | 评论 (0) 编辑

posted @ 2006-12-11 17:33 jackyrong的世界 阅读(1354) | 评论 (1) 编辑

摘要: 下面来说下,在SQL SERVER 2005的表分区里,如何对已经存在的有数据的表进行分区,其实道理和之前在http://www.cnblogs.com/jackyrong/archive/2006/11/13/559354.html说到一样,只不过交换下顺序而已,下面依然用例子说明:阅读全文
posted @ 2006-11-16 14:33 jackyrong的世界 阅读(2730) | 评论 (5) 编辑

posted @ 2006-11-09 15:07 jackyrong的世界 阅读(558) | 评论 (1) 编辑

摘要: 要开始系统学习些基本的ORACLE知识了,虽然不是DBA,但这次还是想把一些基本的知识学好,于是打算笔记之,做个提纲,太具体的
内容就不列出来了,只列要点阅读全文
posted @ 2006-09-11 22:55 jackyrong的世界 阅读(728) | 评论 (0) 编辑

摘要: 在sql server 2005中,可以允许用vs.net 2005来编写存储过程了,这比T-SQL有很大好处,但要注意的是,当要使用SQL SERVER 2005这个功能时,在安全性方面会有所降低,因为必须将CLR允许调试选项打开,因此建议只有当特别复杂的存储过程时,才用.net语言来编写,普通的CRUD还是用T-SQL.
阅读全文
posted @ 2006-08-02 08:53 jackyrong的世界 阅读(4154) | 评论 (0) 编辑

posted @ 2006-07-08 23:14 jackyrong的世界 阅读(358) | 评论 (0) 编辑

摘要: SQL Server 2005中有一种新的语法叫做通用表表达式,CTE(Common Table Expression)。
这种语法的好处就是可以创建出一张临时的表,这张表可以在定义中使用自引用,使得我们处理父-子关系变得前所未有的方便.下面举例子
说明之
阅读全文
posted @ 2006-07-08 22:49 jackyrong的世界 阅读(547) | 评论 (3) 编辑

摘要: 在SQL SERVER 2005中,终于出现了同义词了,大大方便了使用。阅读全文
posted @ 2006-06-15 09:58 jackyrong的世界 阅读(1790) | 评论 (0) 编辑

posted @ 2006-05-27 23:53 jackyrong的世界 阅读(490) | 评论 (0) 编辑

摘要: 一直学数据库的都知道,关系运算有交,差,并,等运算,而之前的版本一直只看到并,好象很少看到有差,交的运算显式的表达在操作SQL语句中,现在好了,SQL SERVER 2005中有差,交运算了,分别是except和intersect,、今天看到,学习之,并举例如下:
阅读全文
posted @ 2006-05-18 09:21 jackyrong的世界 阅读(820) | 评论 (1) 编辑

摘要: 今天看了下sql server 2005中的output子句,以使您可以从修改语句(INSERT、UPDATE、DELETE)中将数据返回到表变量中。阅读全文
posted @ 2006-04-20 12:54 jackyrong的世界 阅读(584) | 评论 (0) 编辑

摘要: mysql 5中新增了视图,存储过程,触发器等新功能,其中不少资料对其都有介绍,今天看到了
其中的一个叫store function的功能,和存储过程有点象,但返回的是值哦,用法挺灵活的,故介绍之
阅读全文
posted @ 2006-04-10 15:35 jackyrong的世界 阅读(542) | 评论 (0) 编辑

posted @ 2006-04-07 19:52 jackyrong的世界 阅读(650) | 评论 (4) 编辑

posted @ 2006-03-14 15:49 jackyrong的世界 阅读(746) | 评论 (1) 编辑

posted @ 2006-03-08 17:04 jackyrong的世界 阅读(540) | 评论 (0) 编辑

posted @ 2006-03-08 11:14 jackyrong的世界 阅读(682) | 评论 (1) 编辑

摘要: sql server 2005中新增加的try catch,可以很容易捕捉异常了,今天大概学习看了下,归纳下要点如下
阅读全文
posted @ 2006-03-02 23:39 jackyrong的世界 阅读(1547) | 评论 (1) 编辑

posted @ 2006-02-20 16:07 jackyrong的世界 阅读(404) | 评论 (0) 编辑

摘要: sql server 2005中新增了许多新的功能,其中OPENROWSET函数中的bulk功能, 可以批量将文件类型中的数据导入到数据库中去阅读全文
posted @ 2006-02-17 22:05 jackyrong的世界 阅读(894) | 评论 (1) 编辑

摘要: SQL SERVER 2005中,新增加了许多新的特性,其中的DDL触发器是个不错的选择,根据资料初步学习如下,现整理之:
阅读全文
posted @ 2006-02-01 22:55 jackyrong的世界 阅读(2363) | 评论 (1) 编辑

posted @ 2005-10-26 08:35 jackyrong的世界 阅读(589) | 评论 (0) 编辑

posted @ 2005-10-11 09:15 jackyrong的世界 阅读(422) | 评论 (0) 编辑

posted @ 2005-10-09 19:15 jackyrong的世界 阅读(509) | 评论 (0) 编辑

posted @ 2005-09-23 17:26 jackyrong的世界 阅读(1920) | 评论 (0) 编辑

posted @ 2005-09-09 20:45 jackyrong的世界 阅读(1371) | 评论 (0) 编辑

posted @ 2005-09-09 20:26 jackyrong的世界 阅读(524) | 评论 (0) 编辑

posted @ 2005-08-30 15:11 jackyrong的世界 阅读(758) | 评论 (0) 编辑

posted @ 2005-08-25 19:42 jackyrong的世界 阅读(747) | 评论 (0) 编辑

posted @ 2005-08-25 18:27 jackyrong的世界 阅读(260) | 评论 (0) 编辑

posted @ 2005-05-07 08:56 jackyrong的世界 阅读(493) | 评论 (0) 编辑

posted @ 2005-01-15 20:21 jackyrong的世界 阅读(729) | 评论 (0) 编辑

posted @ 2005-01-15 20:20 jackyrong的世界 阅读(535) | 评论 (0) 编辑