随笔分类 -  oracle

摘要:2014年11月20日,星期四 更新1. 示例1declare/* type card_rec_type is record ( dn_no channel.dn_no%type, channel_id channel.channel_id%type); type nested_card_type is table of card_rec_type; card... 阅读全文
posted @ 2014-11-20 23:11 bowshy 阅读(266) 评论(0) 推荐(0)
摘要:3.Your database is in ARCHIVELOG mode. You have two online redo log groups, each of which contains one redo member. When you attempt to start the database, you receive the following errors: ORA... 阅读全文
posted @ 2014-04-18 08:39 bowshy 阅读(180) 评论(0) 推荐(0)
摘要:最后更新时间: 2014年4月13日,星期日存储过程分为两种,即DR(Definer's Rights ) Procedure和IR(Invoker's Rights ) Procedure。为什么会有两种存储过程呢?比如说用户user02创建了修改表t1的存储过程,当用户user01调用时,是修改的user01自己的t1表还是user02的t1表? 示例:用户user02将存过赋执行权限给use... 阅读全文
posted @ 2014-04-13 10:02 bowshy 阅读(1844) 评论(0) 推荐(0)
摘要:更新时间:2014年4月12日,星期六oracle支持正则表达式函数regexp_likeregexp_substrregexp_instrregexp_replace示例:createtablenamet1(varchar2(10));insertintot1values('AAAA');insertintot1values('BBB');insertintot1values('ABBB');i... 阅读全文
posted @ 2014-04-12 12:45 bowshy 阅读(985) 评论(0) 推荐(0)
摘要:更新时间:2014年4月12日 7:59:39★发生CKPT场景1. Consistent database shutdown,如: shutdown IMMEDIATE2. Online Redo log 切换时3. ALTER SYSTEM CHECKPOINT4. ALTER DATABASE BEGIN BACKUP5. Tablespace and data file checkpoin... 阅读全文
posted @ 2014-04-12 08:19 bowshy 阅读(307) 评论(0) 推荐(0)
摘要:Statement 1: SELECT employee_id, last_name, job_id, manager_id FROM employees START WITH employee_id = 101 CONNECT BY PRIOR employee_id = manager_id AND manager_id != 108 ; Statement 2: SELECT em... 阅读全文
posted @ 2014-04-06 16:03 bowshy 阅读(214) 评论(0) 推荐(0)
摘要:测试表: create table products(prod_id number(10), prod_name varchar(20)); create index idx_products_1 on products(upper(prod_name)); SQL> select upper(prod_name) from products a ; Execution Plan... 阅读全文
posted @ 2014-04-06 11:48 bowshy 阅读(484) 评论(0) 推荐(0)
摘要:#!/bin/bashsource $HOME/.bash_profiletoday=`date +%Y%m%d`workdir=$HOME/scripts/bak/proc/proc_bak=$HOME/scripts/bak/proc/proc_bak_$todaycd $workdirsqlplus -S tpss/AAA@orcl <<EOF set feedback off set ve... 阅读全文
posted @ 2014-02-25 21:02 bowshy 阅读(275) 评论(0) 推荐(0)
摘要:应用里面有一个表每天从别的系统导全量数据入库,所以这个表每天会进行一次truncate操作,但这个表里面有几条人为构造的数据想保留,于是想到是否可以实现DDL操作后触发DML操作,上网一查果然有现成案例,简单实现方式如下: --create tablecreate table lbx_1(id int);--create triggercreate or replace trigger tr... 阅读全文
posted @ 2014-02-16 10:54 bowshy 阅读(767) 评论(0) 推荐(0)
摘要:temporary tables定义 临时表中的数据只对当前Session有效,每个Session都有自己的临时数据,并且不能访问其它Session的临时表中的数据。因此,临时表不需要DML锁; DML操作的临时表不产生redo log重作日志,但会产生回滚日志Undo log;Undo的产生(rollback segment)会产生Redo log; 支持索引创建(创建索引时不能另指定表空... 阅读全文
posted @ 2014-02-15 22:30 bowshy 阅读(147) 评论(0) 推荐(0)
摘要:今天看一书中介绍索引组织表时,提到堆表和索引组织表对比,自己实验操作一下,发现和书上不太一致. 构造表: --索引组织表SQL> create table iot_addresses(empno number(10),addr varchar2(30),primary key(empno))organization index;--堆表SQL> create table heap_addresses(empno number(10),addr varchar2(30),primary key(empno)); SQL> insert into iot_addressessel 阅读全文
posted @ 2014-02-04 09:25 bowshy 阅读(144) 评论(0) 推荐(0)
摘要:修改 memory_max_target 为1G后,重启数据库出现以下错误提示:SQL> startupORA-00845: MEMORY_TARGET not supported on this system修改tmpfs,增加size=1024M[root@demo ~]# cat /etc/fstab LABEL=/ / ext3 defaults 1 1LABEL=/boot /boot ext3 defaults ... 阅读全文
posted @ 2014-01-29 17:24 bowshy 阅读(179) 评论(0) 推荐(0)