crsd.log中有大量OCRSRV相关信息产生
数据库版本和clusterware都是 10.2.0.1在[ OCRSRV][3736]th_select_handler: Failed to retrieve procctx from ht. constr = [15299816] retval lht [-27] Signal CV 这样的信息。在网上查了下是一个for devlopement...
Oracle监听启动后自动关闭
机子上的TNSLSNR服务没有启动,就去服务里面,却发现启动了马上就自动关闭了2.在命令行下: > lsnrctl LSNRCTL> start -----------------------------------------------------------------------&nb...
RAC中一个节点监听问题
在sqlplus /nolog下:节点二不能执行 SQL>conn sys/123@racdb2 as sysdba显示错误信息为没有监听 ora-12514:解决如下:安装RAC中,在节点二执行 lsnrctl status 时显示没有监听,而执行 crs_stat -t时显示节点二上是...
虚拟机做ISCSI共享存储
准备公用卷:iscsirpm -ivh compat-db-4.2.52-5.1.i386.rpmrpm -ivh libXp-1.0.0-8.1.el5.i386.rpmrpm -ivh openmotif22-2.2.3-18.i386.rpm划分磁盘空间12G作为共享磁盘fdisk /dev/sda 此处省略 我的划分出为sda5iscs...
linux 上执行DBCA报错ora-00600 ora-03114
今天帮同时在linux上安装Oracle 10g,单机。在执行dbca后,在安装进度到12%的时候,报错ora-00600。查看日志信息,报错为ora-03114 not collect oracle。前期的准备都有的,怎么会报这个错呢,查了相关资料后,怀疑...
使用rman修复坏块
有时候由于各方面的原因,有可能导致数据文件中出现坏块,但是出现坏块的时候,数据文件还是一样的可用,数据库也同样可用open,但是如果查询的时候扫描到了坏块,就会报错SQL> select * from t2;select * from t2&n...
ASM管理
单机ASM管理:要想使用ASM,必须先安装oracleasm相关的三个包 ,oracleasm-support,oracleasmlib,oracleasm,根据内核下载相应的lib包。安装完之后,先进行oracleasm的配置,/etc/init.d/oracleasm createdisk ...
sql优化之多列索引的使用
在一个表的多列上建立索引create index ind_t on t(id,object_id,owner);查询的where 条件中只有包含了索引第一列才会使索引生效。下面的使用情况使索引生效;select * from t where id=20;select * from t where id=20 and owner='SCOTT';select * from t where id=20 and object_type='TABLE';包含第一列,索引就会生效。没有包含第一列,索引将失效。eg:select * from t where object_id=20;select * from t where owner='SCOTT';索引都将失效。[@more@]
sql 优化过程之union 替换 or
在网上看了一些sql优化的文章,其中有一条就是使用union 替换 or。原因是在索引列上使用or,会使索引失效,从而走全表扫描。说的比较笼统,我今天特意试验了一下:在什么情况下可以用union 替换 or才会使索引生效。create table t as select * from all_objects;然后又在t上添加了一列id,使用object_id填充的。create index ind_t_id on t(id);只在id上建立索引。set autotrace traceonlyselect * from t where object_id=10 or id=20;SQL> select * from t where object_id=10 or id=20;未选定行执行计划---------------------------
查找一个表的一列插入到另一个表
create table t as select * from all_objects;create table t1 as select * from all_objects;alter table t add id number;现在要往t中的id列用object_id填充不使用存贮过程:1.使用updateupdate t a set a.id=(select object_id from t1 b where a.object_id=b.object_id);已用时间: 00: 00: 00.26SQL> update t a set a.id=(select object_id from t2 b where a.object_id=b.object_id);已更新53842行。已用时间: 00: 11: 40.23执行计划----------------------------------------------------------Plan hash value: 848927671--
Merge用法
Merge是一个非常有用的功能,类似于Mysql里的insert into on duplicate key. Oracle在9i引入了merge命令, 通过这个merge你能够在一个SQL语句中对一个表同时执行inserts和updates操作. 当然是update还是insert是依据于你的指定的条件判断的,Merge into可以实现用B表来更新A表数据,如果A表中没有,则把B表的数据插入A表. MERGE命令从一个或多个数据源中选择行来updating或inserting到一个或多个表 语法如下 MERGE INTO [your table-name] [rename your table here] USING ( [write your query here] )[rename your query-sql and using ju
第一天
今天在itpub开通了博客,目的是为了记录学习和使用Oracle过程中的感想和收获。[@more@]