-- 只要另外的用户对这个序列有select 权限,就可以从这个序列中取数据!-- 所以:没有什么独有不独有滴! 示例如下:scott@TBWORA> create sequence t_seq;序列已创建。scott@TBWORA> conn / as sysdba 已连接。 sys@TBWORA> create user lym identified by bee56915;用户已创建。sys@TBWORA> grant resource, create session to lym;授权成功。sys@TBWORA> alter user lym quota unlimited on users;用户已更改。sys@TBWORA> conn lym/bee56915 已连接。 lym@TBWORA> select scott.t_seq.nextval from dual; select scott.t_seq.nextval from dual * 第 1 行出现错误: ORA-00942: 表或视图不存在 lym@TBWORA> conn scott/bee56915 已连接。 scott@TBWORA> grant select on t_seq; grant select on t_seq * 第 1 行出现错误: ORA-00905: 缺失关键字 scott@TBWORA> grant select on t_seq to lym;授权成功。scott@TBWORA> conn lym/bee56915 已连接。 lym@TBWORA> select scott.t_seq.nextval from dual; NEXTVAL ---------- 1
建完序列后,哪些用户可以使用,取决于你给该序列赋了哪几个用户使用的权限。
grant all on 序列名 to 用户名
已连接。
sys@TBWORA> create user lym identified by bee56915;用户已创建。sys@TBWORA> grant resource, create session to lym;授权成功。sys@TBWORA> alter user lym quota unlimited on users;用户已更改。sys@TBWORA> conn lym/bee56915
已连接。
lym@TBWORA> select scott.t_seq.nextval from dual;
select scott.t_seq.nextval from dual
*
第 1 行出现错误:
ORA-00942: 表或视图不存在
lym@TBWORA> conn scott/bee56915
已连接。
scott@TBWORA> grant select on t_seq;
grant select on t_seq
*
第 1 行出现错误:
ORA-00905: 缺失关键字
scott@TBWORA> grant select on t_seq to lym;授权成功。scott@TBWORA> conn lym/bee56915
已连接。
lym@TBWORA> select scott.t_seq.nextval from dual; NEXTVAL
----------
1