- 浏览: 7270117 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (1546)
- 企业中间件 (236)
- 企业应用面临的问题 (236)
- 小布Oracle学习笔记汇总 (36)
- Spring 开发应用 (54)
- IBatis开发应用 (16)
- Oracle基础学习 (23)
- struts2.0 (41)
- JVM&ClassLoader&GC (16)
- JQuery的开发应用 (17)
- WebService的开发应用 (21)
- Java&Socket (44)
- 开源组件的应用 (254)
- 常用Javascript的开发应用 (28)
- J2EE开发技术指南 (163)
- EJB3开发应用 (11)
- GIS&Mobile&MAP (36)
- SWT-GEF-RCP (52)
- 算法&数据结构 (6)
- Apache开源组件研究 (62)
- Hibernate 学习应用 (57)
- java并发编程 (59)
- MySQL&Mongodb&MS/SQL (15)
- Oracle数据库实验室 (55)
- 搜索引擎的开发应用 (34)
- 软件工程师笔试经典 (14)
- 其他杂项 (10)
- AndroidPn& MQTT&C2DM&推技术 (29)
- ActiveMQ学习和研究 (38)
- Google技术应用开发和API分析 (11)
- flex的学习总结 (59)
- 项目中一点总结 (20)
- java疑惑 java面向对象编程 (28)
- Android 开发学习 (133)
- linux和UNIX的总结 (37)
- Titanium学习总结 (20)
- JQueryMobile学习总结 (34)
- Phonegap学习总结 (32)
- HTML5学习总结 (41)
- JeeCMS研究和理解分析 (9)
最新评论
-
lgh1992314:
[u][i][b][flash=200,200][url][i ...
看看mybatis 源代码 -
尼古拉斯.fwp:
图片根本就不出来好吧。。。。。。
Android文件图片上传的详细讲解(一)HTTP multipart/form-data 上传报文格式实现手机端上传 -
ln94223:
第一个应该用排它网关吧 怎么是并行网关, 并行网关是所有exe ...
工作流Activiti的学习总结(八)Activiti自动执行的应用 -
ZY199266:
获取不到任何消息信息,请问这是什么原因呢?
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息 -
xiaoyao霄:
DestinationSourceMonitor 报错 应该导 ...
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息
第十章创建其他对象(视图,索引,序列,同义词) 视图的优点: 1.简化查询 2.可以限制数据访问 3.提供数据的独立性 4.同样的数据可以采用不同的视图展示 创建视图: create view emp_view as select employee_id id_number, last_name name, salary*12 any_salary from employees where department_id=50; 修改视图: create or replace view emp_view (id_number ,name,sal,department_id) as select employee_id,first_name||' '||last_name ,salary,department_id from employees where department_id=80; 创建复杂的视图: create or replace view dept_sum_vu (name,minsal,maxsal ,avgsal) as select d.department_name,min(e.salary), max(e.salary),avg(e.salary) from employees e join departments d on ( e.department_id=d.department_id) group by d.department_name; 创建只读视图: create view mv as select * from employees with read only; 以下情况不能通过视图添加数据: 1.分组函数,group by 功能 2.包含distinct关键字 3.包含伪列rownum关键字 4.通过表达式定义列 Sequence 创建序列 create sequence dept_id_seq increment by 10 start with 120 maxvalue 9999 nocache nocycle; 备注:伪列nextval和currentval的使用. 序列的使用: insert into departments(department_id,department_name,location_id) values(dept_id_seq.nextval ,'Support',2500); 查看序列值 select dept_id_seq.nextval from dual; 修改序列 alter sequence dept_id_seq increment by 20 maxvalue 99999 nocache nocycle; Indexes:提高查询的效率. create index emp_last_name_idx on employees(last_name); Oracle创建索引的几条策略 学习Oracle时,经常会遇到Oracle索引问题,这里将介绍Oracle索引问题的解决方法。Oracle索引和对应的表应该位于不同的表空间中,Oracle能够并行读取位于不同硬盘上的数据,可以避免产生I/O冲突B树索引:在B树的叶节点中存储索引字段的值与ROWID.唯一索引和不唯一索引都只是针对B树索引而言。Oracle最多允许包含32个字段的复合索引 Oracle索引创建策略 1.导入数据后再创建索引 2.不需要为很小的表创建索引 3.对于取值范围很小的字段(比如性别字段)应当建立位图索引 4.限制表中的索引的数目 5.为索引设置合适的PCTFREE值 6.存储索引的表空间最好单独设定 创建不唯一索引 1. create index emp_ename on employees(ename) 2. tablespace users 3. storage(……) 4. pctfree 0; 创建唯一索引 1. create unique index emp_email on employees(email) 2. tablespace users; 创建位图索引 1. create bitmap index emp_sex on employees(sex) 2. tablespace users; 创建反序索引 1. create unique index order_reinx on orders(order_num,order_date) 2. tablespace users 3. reverse; 创建函数索引(函数索引即可以是普通的B树索引,也可以是位图索引) 1. create index emp_substr_empno 2. on employees(substr(empno,1,2)) 3. tablespace users; 以上介绍Oracle索引创建策略。 在以下情况下推荐创建索引: 1.一个包含在一个范围内的. 2.一个列彪悍大量的null数值. 3.一列或者多列经常作为where字句或者join使用. 4.表很大并且查询频繁,获取表的数据小于2%到4%之间时候. 在以下情况下不推荐创建索引: 1.表频繁更改. 2.索引列为表达式的一部分. 3.表很小并且多数查询结果大于2%到4%之间时候. 4.列在查询条件中不经常使用. Synonym: 创建同义词synonym: create public synonym synonym_name for object; 删除同义词 drop synonym synonym_name; 第十一章数据库字典视图 desc dictionary; select * from dictionary where table_name = 'USER_OBJECTS'; user_objects select object_name ,object_type ,created ,status from user_objects order by object_type; all_objects; user_tables: desc user_tables; select table_name from user_tables; user_tab_columns: desc user_tab_columns; select column_name,data_type, data_length,data_precision,data_scale,nullable from user_tab_columns where table_name ='' user_constraints select constraint_name,constraint_type,search_condition,r_constraint_name, delete_rule,status from user_constraints where table_name='' user_cons_columns: select constraint_name,column_name from user_cons_columns where table_name='' user_views select distinct view_name from user_views; select text from user_views where view_name =''; user_sequences desc user_sequences select sequence_name,min_value,max_value,increment_by ,last_number from user_sequences; user_synonyms select * from user_synonyms 给表添加注释 comment on table table_name is 'EMPLOYEE INFORMATION'; user_tab_comments desc user_tab_comments; all_col_comments; user_col_comments: all_tab_comments; user_tab_comments;
发表评论
-
各种数据库分页Dialect的方法
2011-12-02 09:01 1967以下分页技术均来自hibernate-core-3.3.1.G ... -
Oracle控制文件管理
2011-10-18 17:00 2058每一个Oracle数据库都有一个二进制文件记录着数据库的物理结 ... -
Oracle 问题诊断工具ADRCI(ADRCI: ADR Command Interpreter)
2011-10-29 09:23 2063ADRCI is a command-line tool th ... -
Oracle正则表达式函数:regexp_like、regexp_substr、regexp_instr、regexp_replace
2011-10-17 17:07 8539Oracle使用正则表达式离 ... -
Oracle 10g SQL Fundamentals II(学习笔记二第7-8章)
2011-10-17 16:27 1841第七章分层检索 语法: SELECT [LE ... -
Oracle 10g SQL Fundamentals II(学习笔记二第5-6章)
2011-10-17 16:26 1433第五章不同时区管理数据 TIME_ZONE 会话参数 ... -
Oracle 10g SQL Fundamentals II(学习笔记二第3-4章)
2011-10-17 16:25 1646第三章 大数据集合 从一个表中拷贝数据 ... -
Oracle 10g SQL Fundamentals II(学习笔记二第1-2章)
2011-10-17 16:23 1879第一章用户访问 创建用户 create user us ... -
Oracle 10g SQL Fundamentals I(学习笔记二第7-8章)
2011-10-16 11:17 1130第七章使用各种操作Union/UNION ALL/MINUS/ ... -
ORACLE CTAS(create table as select)使用注意点
2011-10-09 11:28 6344ORACLE CTAS(create table as sel ... -
Oracle的小应用
2011-10-08 16:38 869今天同事打电话让我把数据库中的一个用户下所有表的注释导出 ... -
Oracle 10g SQL Fundamentals I(学习笔记二第4-6章)
2011-10-08 16:28 1506第四节: 分组函数: select [column, ... -
Oracle 10g SQL Fundamentals I(学习笔记第1-3章)
2011-10-08 16:25 1682第一章和第二章 distinct like 'S%' ... -
Oracle监控语句
2011-09-21 22:40 8311.监控事例的等待 select event,sum(de ... -
Oracle Rman 命令详解(List report backup configure)
2011-09-21 22:37 1503一、list常用命令总结备忘 list命令列出控制文件、 ... -
Oracle RMAN相关验证备份
2011-09-20 23:19 2154一.备份db并查看备份 list backup summ ... -
Oracle 的 Alert 日志
2011-09-20 23:18 2845从 Oracle 11g 开始,Oracle 数据库以XML与 ... -
Oracle 几个常用命令
2011-09-19 19:35 1259OEMC启动dbconsole进程1. emctl star ... -
Oracle中登录文件Login的定制
2011-09-14 10:55 1811在window系统针对Oracle登录调试设置登录 ... -
ORACLE使用dbv工具检验数据文件是否有坏块
2011-09-13 22:31 2723使用dbv工具检验数据文件是否有坏块 dbv工具可以用来验 ...
相关推荐
Oracle 11g SQL Fundamentals I
Oracle Database 10g SQL Fundamentals I
Oracle 11g Fundamentals I
Oracle 11g SQL Fundamentals II Studednt guide
详细解说了oracle技术,是本人的一个培训资料
[Oracle官方PPT讲义] Oracle DB 11g SQL Fundamentals I
oracle 10g sql Fundamentals,版本是2.1的
OCA 1z0-047 Oracle Database SQL Expert 的官方教材,pdf版本的Presentation。 047官方教材Oracle.Database.10g.SQL.Fundamentals.I&II(pdf...D17111GC11.Oracle.Database.10g.SQL.Fundamentals.II.August.2004.pdf
Oracle Database 11g: SQL Fundamentals I V1
Oracle 10g OCP官方课程列表: Oracle Database 10g: SQL Fundamentals Oracle Database 10g: Administration Workshop I Oracle Database 10g: Administration Workshop II
Oracle Database 11g SQL Fundamentals I Ed 2_V2_Z0_051
英文原版的Oracle Database 11g SQL Fundamentals,共有两部分。
oracle 11g 官方教学教材,sql篇,英文版
1Z0-051-Oracle.Database 11g SQL Fundamentals I Exam Guide Exam(OCA).rar
oracle 10g sql Fundamentals.part01.rar
资源名称:1z0-051-2 Oracle Database 11g: SQL Fundamentals I 类型: Practice Test 版本 Version 3.2 最新的oracle ocp认证考试题库,来自oracle官方授权的WDP机构,本资源为SQL Fundamentals I的下半部分,全...
Database 11g SQL Fundamentals I Ed 2 _V1(CN)_Z0_051