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数据库学习笔记:其它数据对象的更多相关文章

  1. 吴裕雄--天生自然ORACLE数据库学习笔记:数据导出与导入

    create directory dump_dir as 'd:\dump'; grant read,write on directory dump_dir to scott; --在cmd下 exp ...

  2. 吴裕雄--天生自然ORACLE数据库学习笔记:数据表对象

    create table students( stuno ) not null, --学号 stuname ), --姓名 sex ), --性别 age int, --年龄 departno ) n ...

  3. 吴裕雄--天生自然ORACLE数据库学习笔记:过程、函数、触发器和包

    create procedure pro_insertDept is begin ,'市场拓展部','JILIN'); --插入数据记录 commit; --提交数据 dbms_output.put_ ...

  4. 吴裕雄--天生自然ORACLE数据库学习笔记:Oracle数据备份与恢复

    run{ allocate channel ch_1 device type disk format = 'd:\oraclebf\%u_%c.bak'; backup tablespace syst ...

  5. 吴裕雄--天生自然ORACLE数据库学习笔记:PL/SQL编程

    set serveroutput on declare a ; b ; c number; begin c:=(a+b)/(a-b); dbms_output.put_line(c); excepti ...

  6. 吴裕雄--天生自然ORACLE数据库学习笔记:Oracle 11g的闪回技术

    alter system set db_recovery_file_dest_size=4g scope=both; connect system/1qaz2wsx as sysdba; archiv ...

  7. 吴裕雄--天生自然ORACLE数据库学习笔记:优化SQL语句

    create or replace procedure trun_table(table_deleted in varchar2) as --创建一个存储过程,传入一个表示表名称的参数,实现清空指定的 ...

  8. 吴裕雄--天生自然ORACLE数据库学习笔记:Oracle系统调优

    --修改 alter system set large_pool_size=64m; --显示 show parameter large_pool_size; select sum(getmisses ...

  9. 吴裕雄--天生自然ORACLE数据库学习笔记:用户管理与权限分配

    create user mr identified by mrsoft default tablespace users temporary tablespace temp; create user ...

  10. 吴裕雄--天生自然ORACLE数据库学习笔记:表分区与索引分区

    create table ware_retail_part --创建一个描述商品零售的数据表 ( id integer primary key,--销售编号 retail_date date,--销售 ...

随机推荐

  1. 使用Python处理非对称加密-测试大佬常用的处理方式

    一.思考❓❔ 1.什么是非对称加密? 公钥加密系统,广泛用于数据加密传输 更详细的解释可参考维基百科( https://en.wikipedia.org/wiki/RSA_(cryptosystem) ...

  2. UITextField的内存泄漏问题

    背景: 项目中使用了Facebook的FBRetainCycleDetector框架检测内存泄漏问题. 登录VC的view中放置了一个UITextField对象. 产品的要求是当进入登录界面的时候,让 ...

  3. eclipse 切换主题Theme

    eclipse切换主题theme 1. 打开help -> eclipse marketplace,搜索theme 2. 点击右侧安装后一直继续,直到安装完成 3. 安装完成后会重启eclips ...

  4. innerAudiocontext的坑

    链接:https://blog.csdn.net/sourcemyx/article/details/79424004 像wx.onNetworkStatusChange(function(){})回 ...

  5. Go之NSQ

    文章引用自 NSQ NSQ是目前比较流行的一个分布式的消息队列,本文主要介绍了NSQ及Go语言如何操作NSQ. NSQ介绍 NSQ是Go语言编写的一个开源的实时分布式内存消息队列,其性能十分优异. N ...

  6. RTT学习之软件包

    网络工具集 (NetUtils) Ping 工具: 是一种网络诊断工具,用来测试数据包能否通过 IP 协议到达特定主机,依赖于LWIP,支持域名和IP访问: NTP 工具:NTP 是网络时间协议 (N ...

  7. 「CF1042F」Leaf Sets

    传送门 Luogu 解题思路 比较显然的一种做法: 我们把一个点的子树高度抠出来并排序记为 \(L_i\),找到最大的 \(i\) 使得 \(L_{i-1}+L_i\le K\). 于是我们把前 \( ...

  8. svn服务器IP/URL地址更换,修改本地的仓库地址

    TortoiseSVN服务器ip地址修改后如何使用_windows和linux下svn切换新仓库地址的方法 windows下svn切换仓库地址 右键项目文件夹 TortoiseSVN => Re ...

  9. Manjaro 与 Windows 双系统时间相差8小时

    Manjaro 与 Windows 双系统时间相差8小时 产生原因: Windows 将本地硬件时间作为设定时区(如 UTC+8)的区时,而 Linux 默认将其作为 UTC 时间. 解决方式: 让 ...

  10. scrapy item处理----cooperator和parallel()函数

    twisted的task之cooperator和scrapy的parallel()函数 本文是关于下载结果返回后调用item处理的过程实现研究. 从scrapy的结果处理说起 def handle_s ...