1.同义词
1.1:同义词是数据库对象的一个别名,这些对象可以是表、视图、序列、过程、函数、程序包,甚至是其他同义词。
1.2:同义词的用途
简化SQL语句
隐藏对象的名称和所有者
为分布式数据库的远程对象提供了位置透明性
提供对对象的公共访问
1.3:类型
公有同义词
私有同义词
1.4:语法
create synonym 别名 for 原名;
公有同义词:create public synonym 别名 for 原名;
删除同义词:drop synonym 名称;
2.序列
语法:create sequence 名称
start with integer
increment by integer
maxvalue integer
minvalue integer
cycle
cache integer
start with:指定要生成序列的第一个序列值。
increment by:用于指定序列号之间的间隔
maxvalue:指定可以生成的最大值
minvalue:指定序列的最小值
更改序列:alert sequence 名称
删除序列:drop sequence 名称
3.视图
语法:create [or replace][force|noforce]view 名称
as
select语句
删除视图:drop view 名称
4.索引
语法:create index 名称 on 表名
类型:唯一索引:create unique index 名称 on 表名
组合索引:create index 名称 on 表名(column1,column2...)
反向键索引:create index 名称 on 表名(column)reverse
位图索引:create bitmap index 名称 on 表名
函数索引:create index 名称 on 表名(函数)