随笔分类 -  Oracle

摘要:还原DUMP出来的数字SQL> select dump(2000,16) from dual;DUMP(2000,16)------------------Typ=2 Len=2: c2,15SQL> declare n number; 2 begin 3 dbms_stats.convert_ra... 阅读全文
posted @ 2014-03-20 01:49 princessd8251 阅读(794) 评论(0) 推荐(0)
摘要:一.Memory Dumps1).Global AreaALTER SESSION SET EVENTS 'immediate trace name global_area level n';1 包含PGA2 包含SGA4 包含UGA8 包含indrect memory2).Library Cach... 阅读全文
posted @ 2014-03-19 13:51 princessd8251 阅读(424) 评论(0) 推荐(0)
摘要:应用场景:有如下的SQL:select t.*, t1.ownerfrom t, t1where t.id=t1.id;表t ,t1的数据量比较大,比如200W行.但是两张表能关联的行数却很少,比如不到50条. T1表的行比较宽,且在id列上有单列索引.这里限制t1的索引为单列索引是为了让访问t1表... 阅读全文
posted @ 2014-02-16 20:57 princessd8251 阅读(1830) 评论(0) 推荐(0)
摘要:dbms_random是一个可以生成随机数值或者字符串的程序包。这个包有initialize(),seed(),terminate(),value(),normal(),random(),string(), 其中常用的有value(),random(),string()第一种:FUNCTIONval... 阅读全文
posted @ 2014-02-16 20:35 princessd8251 阅读(502) 评论(0) 推荐(0)
摘要:1. 把有NULL值的列与一个常数,或者一个带有not null约束的列一同索引create index ind_01 on t01(col01,1);或者create index ind_01 on t01(col01,col02); --col02 必须带有NOT NULL约束.下面是例子:CR... 阅读全文
posted @ 2014-02-15 13:13 princessd8251 阅读(1342) 评论(0) 推荐(0)
摘要:堆组织表的存储速度因为不用考虑排序, 所以存储速度会比较快. 但是要查找符合某个条件的记录, 就必须得读取全部的记录以便筛选.而这个时候为了加快查询速度, 索引就出现了, 索引是针对少量特定字段的值拿出来进行排序存储, 并记录在表中的位置,而因为索引是有序的, 所以就会很容易通过索引查询到具体的记录... 阅读全文
posted @ 2014-02-15 02:03 princessd8251 阅读(1028) 评论(0) 推荐(0)
摘要:下面是创建一个表,并在上面建立一些index的SQL.我们会新建一个用户,然后再那个schema下运行下面的SQL.create table indtest (f1_num number(10) not null,f2_char varchar2(20) not null,f3_numnull nu... 阅读全文
posted @ 2014-02-07 20:38 princessd8251 阅读(603) 评论(0) 推荐(0)
摘要:SQL> explain plan for select rowid rid from 2 scott.emp e where e.empno >100 and e.empno SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY(NULL, NULL, 'ADVANCED... 阅读全文
posted @ 2014-02-03 02:42 princessd8251 阅读(417) 评论(0) 推荐(0)
摘要:转自 http://blog.csdn.net/staricqxyz/article/details/8624549Find internal of "show parameter" by session tracingSQL>select*fromv$version; BANNER--------... 阅读全文
posted @ 2014-01-29 21:30 princessd8251 阅读(2556) 评论(0) 推荐(0)
摘要:SQL> select * from v$version;BANNER-------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Rel... 阅读全文
posted @ 2014-01-29 01:42 princessd8251 阅读(380) 评论(0) 推荐(0)
摘要:官网文档说明ROW_NUMBERSyntaxDescription of the illustration row_number.gifSee Also:"Analytic Functions"for information on syntax, semantics, and restriction... 阅读全文
posted @ 2014-01-11 21:41 princessd8251 阅读(287) 评论(0) 推荐(0)
摘要:转自 http://www.oracle.com/technetwork/cn/articles/database-performance/oracle-rac-connection-mgmt-1650424-zhs.htmlOracle RAC 环境下的连接管理作者:崔华这篇文章详细介绍了Orac... 阅读全文
posted @ 2014-01-11 14:54 princessd8251 阅读(1723) 评论(0) 推荐(0)
摘要:rman备份控制文件分为两种情况。1、自动备份需要配置configure controlfile autobackup on配置之后,控制文件和spfile会在每次rman备份之后自动备份controlfile和spfile另外在数据库的structure变化之后,也会自动备份controlfile... 阅读全文
posted @ 2013-09-26 00:38 princessd8251 阅读(358) 评论(0) 推荐(0)
摘要:1. 如果你的LOCAL_LISTENER 指定的是一个别名 比如L2*.local_listener='L2'启动实例的时候 会先到 tnsnames.ora 文件里取查找定义名为L2的TNS服务名.实例起来后会尝试把数据库服务注册到ADDRESS指定地址。而这个地址就是你自己定义的Listene... 阅读全文
posted @ 2013-09-25 22:41 princessd8251 阅读(285) 评论(0) 推荐(0)
摘要:转自 http://www.cnblogs.com/dba001/archive/2011/10/22/2221267.html前一段时间修改了主机的hostname,重启oracle是提示错误ORA-00119: invalid specification for system parameter... 阅读全文
posted @ 2013-09-25 21:46 princessd8251 阅读(255) 评论(0) 推荐(0)
摘要:虽然很多地方不建议这么做,可是有HA、oracle软件建在本地盘的情况下,如果spfile放在dbs下,会导致每次修改spfile都要去手动copy到备机上,这是很麻烦的一件事情,所以我把spflie放在随ha切换的存储磁盘上。(1)通过$ORACLE/dbs下的pfile起库startuppfil... 阅读全文
posted @ 2013-09-06 22:23 princessd8251 阅读(509) 评论(0) 推荐(0)
摘要:create or replace function get_param(p_name in varchar2)return varchar2as l_param_type number;l_intval binary_integer;l_strval varchar2(256);invalid_... 阅读全文
posted @ 2013-08-31 16:23 princessd8251 阅读(479) 评论(0) 推荐(0)
摘要:原文出自:http://xxscfh.itpub.net/post/304/49530在oracle数据库中,我们有时候需要杀掉某个session,但是如果我们用alter system kill session 'sid, serial#'方式来杀的话,系统仅仅是标志该session的状态位为ki... 阅读全文
posted @ 2013-03-28 11:14 princessd8251 阅读(296) 评论(0) 推荐(0)
摘要:原文出自:http://xxscfh.itpub.net/post/304/494009个重要视图 1)v$lock给出了锁的信息,如type字段, user type locks有3种:TM,TX,UL,system type locks有多种,常见的有:MR,RT,XR,TS等。我们只关心TM... 阅读全文
posted @ 2013-03-28 10:55 princessd8251 阅读(220) 评论(0) 推荐(0)
摘要:Though the initialization parameter is modifiable, it cannot be modified using the specified command.For example, you try to change the memory_target ... 阅读全文
posted @ 2013-03-20 00:08 princessd8251 阅读(1927) 评论(0) 推荐(0)