desc dba_objects
select d.object_type,count(*)
from dba_objects d
group by d.object_type
where count(*)>100
order by count(*) desc;
常见的数据库对象
同义词
表
视图
序列
索引
还有常用的函数,存储过程,物化视图,外部表和JOB等。
英语:synonym,index,view,trigger,function,sequence,index partition,table partition,procedure
约束
dba_objects 很重要。如果要查表的创建时间,是要在dba_objects 里面查的。
创建序列:CREATE SEQUENCE sequence
查询序列:NEXTVAL 和 CURRVAL 两个伪列实现
修改序列:ALTER SEQUENCE sequence
删除序列:DROP SEQUENCE sequence
CREATE SEQUENCE dept_deptid_seq
INCREMENT BY 10 ---以每次10的速度增长
START WITH 120 ---从120开始增长
MAXVALUE 9999 ---最大值9999
Nocache ---不缓存
NOCYCLE ---不循环
select * from dba_sequences d where d.sequence_name=‘dept_deptid_seq‘;
select dept_deptid_seq.NEXTVAL from dual;
select dept_deptid_seq.CURRVAL from dual;