关于外连接的一个实验(先过滤后连接,先连接后过滤)
[@more@]Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 Connected as mr========建立测试表WT1,WT2SQL> drop TABLE wt1;Table droppedSQL> drop TABLE wt2;Table droppedSQL> create TABLE wt1(x NUMBER, y NUMBER);Table createdSQL> SQL> INSERT INTO wt1 SELECT 1,11 from dual;1 row insertedSQL> INSERT INTO wt1 SELECT 2,22 from dual;1 row insertedSQL> commit;Commit completeSQL> create TABLE wt2(x NUMber,y NUMBER ,z NUMBER);Table createdSQL> SQL> INSERT IN
oracle 11gR2 advanced compress table
默认oracle建立表的时候是nocompress,compress for all operations 和 compress for direct_load operations都是11g以前的选项为了兼容以前而存在的。11g以后实际的压缩选项只有compress [basic]和compress for oltp两种,其他的query等是基于硬件的选项.{ COMPRESS [ BASIC | FOR { OLTP| { QUERY | ARCHIVE } [ LOW | HIGH ]}]| NOCOMPRESS }Compression can occur while data is being inserted, updated, or bulk loaded into a table. Operations that permit compression include:Single-row or array inserts and updatesThe foll
unix profile idletime
参考文章 Script for killing sniped sessions shadow processes [ID 96170.1]创建 idletime的profile,并修改用户的profile。例:alter system set resource_limit = true; create profile idletime limit idle_time 120; alter user scott profile idletime;当设定了如上的profile时,查询 v$session 视图,过了idletime后的session status 列标示为'sniped' 的。pmon 不会清除 sniped 的进程,使用'alter system kill session' 杀掉session但session status 标示为 killed ,最终不会清除超过idletime的session。 需要单独写个脚本利
oracle internal 研究的相关网址
http://www.ixora.com.au/http://www.jlcomp.demon.co.uk/http://blog.tanelpoder.comhttp://www.juliandyke.comhttp://www.dbazine.com/oracle/ora-articles/http://www.oaktable.net/articleshttp://blog.tanelpoder.com/?s=systemstatehttp://www.pythian.com/news/[@more@]
oracle11g 建表特性带来的误解
测试服务器:11.2.0.1测试客户端:10.2.0.1 sqlplus现象:建表之后,初始不会分配segment,造成dba_tables有表信息,而 dba_segments 没有信息。SQL> create tablespace tbs2 datafile 'tbs01.dbf'3 size 1m;表空间已创建。SQL> create table cui (id number) tablespace tbs;表已创建。SQL> select table_name from user_tables where tablespace_name='TBS';TABLE_NAME ------------------------------ CUI SQL> select segment_name from user_SEGMENTS where tablespace_name='TBS';未选定行SQL> drop tablespace tbs
x$kglob/x$kgltr 中library cache信息查看(结果同dump内容)
Kgl 解释 kernel layer generic layer library cache manager 以下两个表的说明可以先简单看下,然后看完这节内容之后再回过头来看下。X$kglob 表说明如下:Kglhdadr (children address) LIBRARY OBJECT HANDLE: handleKglhdpar (parent address) LIBRARY OBJECT HANDLE:handle Kglnaown 依赖object的owner nameKglnahsh sql的hash value (v$sql 中的hash_value)Kglnahsv sql 的hash value (长串格式:9a5fb5d584eb42ce5f55b9c92930cf55)Kglhdobj LIBRARY OBJECT: objectKglobhd0 data#=0 的 heap 地址Kglobhd1Kglobhd2Kglobhd3..7Kgl
DUAL表误删除恢复
昨天晚上接到同事来电,说dual表不小心被删除了,现在无法创建,于是研究了下dual表的恢复,现在模拟还原如下:dual表是系统的一个虚表,用来构成select的语法规则。如果不小心删除了的话,会导致数据库起不来,报错ORA-01092: ORACLE instance terminated. Disconnection forced。数据库版本10.2.0.4OS:linux[oracle@rac1 ~]$ uname -aLinux rac1 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686 athlon i386 GNU/Linux过程如下:[oracle@rac1 ~]$ sqlplus "/as sysdba"SQL*Plus: Release 10.2.0.4.0 - Production on
cursor handle heap0 subheap
SELECT * FROM x$kglob t WHERE t.KGLHDNSP=0;--cursor--3 B7F20884 4 1 804DF308 804DF3EC 4 select count(*) from snap$ s where bitand(s.flag, 8192) = 8192 and s.sowner not in ('SYS', 'SYSTEM', 'SH') <CLOB> 2247622696 a03d50151f420947b377a00e85f80028 2010-12-17 23:50:54 0 0 0 268501248 7F24A62C 2 0 1 0 0 1 0 1 1 0 0 3420 0 0 0 0 0 8136 0 7A4E9B90 00 00 00 00 00 77E7BA68 00 0 0 00 -32496 0 3 b6xx01u2zh018 1 1 1 7
table/procedure handle heap0 subheap
SELECT * FROM x$kglob t WHERE t.KGLHDNSP=1 AND t.kglhdadr='80BB2574';--table/procedure t.kglhdadr = t.kglhdparg_noap.CLT_CM_HWV3R8_BTSPWRC--1 B7F70694 1 1 80BB2574 80BB2574 5 G_NOAP CLT_CM_HWV3R8_BTSPWRC <CLOB> 1758986246 3325057b884121249d976d5468d80006 2010-10-28 14:23:16 1 0 0 33554432 74358D70 4 0 0 0 0 1857 0 5 1 2 0 1436 0 0 0 0 0 18696 0 7AFA99FC 00 00 00 00 00 74359048 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
solaris10 修改ip 后是否需要重启?
solaris10 下 修改ip 要更改 几 个文件/etc/hosts ---修改ip -- ln 自 /etc/inet/ipnodes/etc/netmasks --掩码改变时 修改掩码/etc/defaultrouter --网关改变时,重新制定网关。修改完成后 。不需重启机器。使用solaris 的svc 来重启 网卡服务。 svc 类似于 linux 的 service restart network 。 aix 的 startsrc stopsrc lssrc.bash-3.00# svcadm Usage: svcadm [-v] [cmd [args ... ]] svcadm enable [-rst] <service> ... - enable and online service(s) svcadm disable [-st] <service> ... -
asm删除磁盘
11r2 asm和db 分离,如果想用asm 需要先安装grid。 安装grid时推荐添加 grid用户。 #su - grid $ sqlplus "/as sysdba" SQL*Plus: Release 11.2.0.1.0 Production on Fri Dec 24 12:41:59 2010 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Automatic Storage Management option SQL> conn /as SP2-0306: Invalid option. Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM}]
11.2.0.1 exp-00006 exp-00000 bug
Applies to: Oracle Server - Enterprise Edition - Version: 11.1.0.7 to 11.2.0.1 - Release: 11.1 to 11.2Information in this document applies to any platform.SymptomsWhen exporting a composite or system partitioned table using conventional export utility, it fails with EXP-6 and EXP-0 errors.EXP-00006: internal inconsistency errorEXP-00000: Export terminated unsuccessfullyCauseA bug has been filed regarding this problem Bug 7834212However, it should be noted that the new composite partitioning and