gc buffer busy的优化
通常情况下是因为等待其他节点传送块,如果出现太多次,则意味着集群之间有contentionhttp://www.ardentperf.com/2007/09/12/gc-buffer-busy-waits-in-rac-finding-hot-blocks/ 过去几个小时系统...
不太常用的oracle hint整理
APPEND Hint The APPENDhint instructs the optimizer to use direct-path INSERT with the subquery syntax of the INSERT statement.· Conventional...
利用ipcrm清除数据库crash后没有释放的内存段
某测试库,开发报告无法连接使用,登陆进该server,首先输入ps –ef | grep ORACLE_SID发现该instance没有启动,查看alertlog,日志显示11月28号0:00db有过一次日志切换,10分钟后开始出现7445错误,过...
with as优化sql
with as是9.2推出的,在解析的时候被当成内联视图或者临时表(临时表可以被多次读取),使用/*+ materialize */可以让其转换成临时表国外有一篇文章介绍的挺细,转载一下以备后用,而且有牛人通过with as优化s...
sql profile的使用
本篇完全是根据老熊文章进行的实验再现,具体可以参照http://www.laoxiong.net/sql-profiles-part.html 或者《DBA手记3》首先创建两个测试表SQL> create table t1 as select object_id,object_name from dba_object...
利用oradebug锁定latch
select ksppinm name, ksppstvl value, ksppdesc descriptionfrom x$ksppi x, x$ksppcv ywhere (x.indx = y.indx)and ( ksppinm like '&1' or ksppdesc like '&1' )order by name;首先由隐含参数获知该数据库只有一...
利用REGEXP_LIKE查看包含大写字母的用户名
开发提出一个需求,要查询注册用户名中含有大写字母的用户,最简单的方式是 select * from user where user_name != lower(user_name);可是这样会全表扫描,该表又是非常大;可以改用正则表达式select * from user e...
恢复被执行truncate table的表数据
1、当开启db recovery的时候,只需闪回数据库即可SQL> create table test1(id number(5)) tablespace data01;Table created.SQL> create table test2(id number(5)) tablespace data01;Table created.SQL> declar...
手工创建oracle数据库
手工创建数据库--前提是已经安装了oracle软件1、设置.bash_profile(针对linux)export ORACLE_SID=market export ORACLE_HOME=/data/oracle/product/11202/db1[oracle@db ~]$ more .bash_profile_market# .bash_prof...
/etc/hosts配置出错导致listener无法启动
在一台机器上安装oracle,发现listener总是无法启动,查看跟踪日志<msg time='2011-10-21T06:53:17.324+08:00' org_id='oracle' comp_id='tnslsnr'type='UNKNOWN' level='16' host_id='whdbtest205.yihaodian.com'ho...
listener的ORACLE_HOME配置出错导致无法远程登陆数据库
C:\Documents and Settings\test>sqlplus justin/justin@justinSQL*Plus: Release 10.2.0.1.0 - Production on 星期五 10月 21 10:10:24 2011Copyright (c) 1982, 2005, Oracle. All rights reserved.ERROR...
同义词失效导致无法访问表
开发在测试库查询一张表,但是却报以下错误SQL> select count(*) from JUSTIN; select count(*) from JUSTIN ORA-04045: errors during recompilation/revalidation of JUSTIN.JUSTINORA-20110: No DDL in...
禁止DDL执行的trigger
禁止DDL执行的triggerCREATE OR REPLACE TRIGGER disable_ddlBEFORE DDL ON SCHEMABEGIN IF ora_sysevent <> 'TRUNCATE' &nbs...
move分区表
现在需要将一些分区表移到别的表空间下去,且该表是arc表,目前是没有任何程序访问,不需使用在线重定义,可以直接move.SQL> alter table JUSTIN move tablespace ARC;alter table JUSTIN move tablespace ARC ...
批量处理物理备库出现archive gap
物理备库出现gap,主库为5节点RAC,数据库版本10.2.0.5登录物理备库SQL> select * from v$archive_gap; THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#---------- ------------- -------------- &n...
db_file_name_convert设置出错导致备库无法recovery
一套10.2.0.5的physical standby,主库挂载了一系列的sas磁盘,新增的磁盘路径在备库上不存在,因此需要设置备库参数db_file_name_convert,但是敲入命令出错,原本的'/storage/disk00','/data/oracle/oradata/test'...
lob字段的ora-1555处理方案
从系统中导出两个含有lob字段的表,连续两次都因ora-1555错误而终止[oracle@db-8 ~]$ expdp justin/***** tables=temp_justin, justin_description parallel=8 directory=pump dumpfile=new_lobs_20111008_%U.dmpEx...
resize datafile以节省磁盘空间
因为磁盘空间不够,而表空间data中的很多表已经被迁移走,现在需要从表空间data中回收空间;一个数据文件能够resize(缩小)的最大限度需要取决于其max extent,通过以下sql可以查看select a.FILE#,  ...
11g 等频直方图下sql不走索引扫描
昨天下午开发人员报告一条非常奇怪的sql,使用该sql的执行计划使用全部扫描,但是查询列是建有索引的,oracle版本 11.2.0.2该sql格式如下 select * from doc_JUSTIN where do_no ='0069325106';当时第一反应是...
mysql导出某个表的部分数据
可以使用mysqldump中的where选项,与oracle的expdp功能类似;比如,需要导出某个表最近两天的数据[justin@localhost ~]$ mysqldump -u root -p justin justin_logs --where="datediff(curdate(),create_time) ...