吴裕雄--天生自然ORACLE数据库学习笔记:其它数据对象
create index emp_deptno_index on emp(deptno)
pctfree 25
tablespace users;
create bitmap index emp_salary_bmp
on employees(salary)
tablespace users;
connect scott/1qaz2wsx
create index emp_job_reverse
on emp(job) reverse
tablespace users;
create index emp_job_fun
on emp(lower(job));
alter index emp_deptno_index
coalesce deallocate unused;
alter index emp_deptno_index rebuild;
drop index emp_job_fun
connect system/1qaz2wsx
select index_name,index_type
from dba_indexes
where owner = 'HR';
column column_name for a30
select column_name ,column_length
from user_ind_columns
where index_name = 'EMP_DEPTNO_INDEX';
select tablespace_name,segment_type,bytes
from user_segments
where segment_name = 'EMP_DEPTNO_INDEX';
connect scott/1qaz2wsx
select column_expression
from user_ind_expressions
where index_name = 'EMP_JOB_FUN';
connect scott/1qaz2wsx
create or replace view emp_view as
select empno,ename,job,deptno
from emp
where deptno = 20;
create or replace view emp_view_readonly as
select * from dept
where deptno != 88
with read only;
create or replace view emp_view_complex as
select deptno 部门编号,max(sal) 最高工资,min(sal) 最低工资,avg(sal) 平均工资
from emp
group by deptno;
create or replace view emp_view_union as
select d.dname,d.loc,e.empno,e.ename
from emp e,dept d
where e.deptno = d.deptno and d.deptno = 20;
create public synonym public_dept for scott.dept;
create synonym private_dept for dept;
create sequence empno_seq
maxvalue 99999
start with 9000
increment by 100
cache 50;
alter sequence empno_seq
maxvalue 100000
increment by 200
cache 100
--创建表
create table tb_10_1(
stuno number(10) not null, --学号
stuname varchar2(8), --姓名
sex char(2), --性别
age int
); ---创建索引
create index tb_10_1_index on tb_10_1(sex)
pctfree 25
tablespace users;
--创建表
create table tb_10_2(
id number(10) not null, --编号
stuname varchar2(8), --姓名
sex char(2), --性别
age int
); --创建序列
create sequence id_seq
maxvalue 10000
start with 1
increment by 3
cache 50; --测试
insert into tb_10_2(id,stuname,sex,age)
values(id_seq.nextval,'东方','男',30);
吴裕雄--天生自然ORACLE数据库学习笔记:其它数据对象的更多相关文章
- 吴裕雄--天生自然ORACLE数据库学习笔记:数据导出与导入
create directory dump_dir as 'd:\dump'; grant read,write on directory dump_dir to scott; --在cmd下 exp ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:数据表对象
create table students( stuno ) not null, --学号 stuname ), --姓名 sex ), --性别 age int, --年龄 departno ) n ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:过程、函数、触发器和包
create procedure pro_insertDept is begin ,'市场拓展部','JILIN'); --插入数据记录 commit; --提交数据 dbms_output.put_ ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:Oracle数据备份与恢复
run{ allocate channel ch_1 device type disk format = 'd:\oraclebf\%u_%c.bak'; backup tablespace syst ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:PL/SQL编程
set serveroutput on declare a ; b ; c number; begin c:=(a+b)/(a-b); dbms_output.put_line(c); excepti ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:Oracle 11g的闪回技术
alter system set db_recovery_file_dest_size=4g scope=both; connect system/1qaz2wsx as sysdba; archiv ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:优化SQL语句
create or replace procedure trun_table(table_deleted in varchar2) as --创建一个存储过程,传入一个表示表名称的参数,实现清空指定的 ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:Oracle系统调优
--修改 alter system set large_pool_size=64m; --显示 show parameter large_pool_size; select sum(getmisses ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:用户管理与权限分配
create user mr identified by mrsoft default tablespace users temporary tablespace temp; create user ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:表分区与索引分区
create table ware_retail_part --创建一个描述商品零售的数据表 ( id integer primary key,--销售编号 retail_date date,--销售 ...
随机推荐
- 寒假安卓app开发学习记录(2)
今天属实是头疼的一天.开始的时候是简单了解了一下安卓的系统架构,了解到大概分为四个部分. 然后看了两节创建安卓项目的课程,准备去实践一下的时候突然发现我的eclipse里竟然没有Android选项.查 ...
- Python 之路
Python之路[第一篇]:Python简介和入门 Python之路[第二篇]:Python基础(一) Python之路[第三篇]:Python基础(二) Python之路[第四篇]:模块 Pytho ...
- org.apache.catalina.connector.ClientAbortException: java.io.IOException: 你的主机中的软件中止了一个已建立的连接。
org.apache.catalina.connector.ClientAbortException: java.io.IOException: 你的主机中的软件中止了一个已建立的连接. at org ...
- 发现一个比较好玩的,git的仓库可以转换
我们通过 git clone 下载一个仓库到本地, 1.这个本地的文件夹名字可以随便改. 2.如果你把本地仓库的全部文件,剪切到另一个文件夹内,这个新的文件夹就是git的本地仓库.
- 瀑布流无限加载infinitescroll插件与masonry插件使用
masonry官网地址http://masonry.desandro.com/,infinitescroll官网地址http://www.infinite-scroll.com/ 无限滚动原理:无限滚 ...
- JAVA 爬虫框架webmagic 初步使用Demo
一想到做爬虫大家第一个想到的语言一定是python,毕竟python比方便,而且最近也非常的火爆,但是python有一个全局锁的概念新能有瓶颈,所以用java还是比较牛逼的, webmagic 官网 ...
- C:字符数组 与 字符串
字符串与字符数组 C语言中没有字符串这种数据类型,可以通过char的数组来替代: 字符串一定是一个char的数组,但char的数组未必是字符串: 数字0(和字符'\0'等价)结尾的char数组就是一个 ...
- 1、json背景
教程链接 链接:http://pan.baidu.com/s/1mil4M1M 密码:vwsn JSON (JavaScript对象表示法)是一种轻量级的基于文本的开放标准,被设计用于可读的数据交换, ...
- 好用的px转rem插件cssrem
下载本项目,比如:git clone https://github.com/flashlizi/cssrem 进入packages目录:Sublime Text -> Preferences - ...
- 第六节:前后端交互之axios用法及async异步编程
一. axios用法 参考: API文档: https://www.kancloud.cn/yunye/axios/234845 GitHub: https://github.com/axios/ax ...