Oracle 授予更改序列
我有一个授予更改序列
给用户。但我必须指定模式名称
来更改序列,否则它会返回错误序列不存在
。是否可以以某种方式进行授权,这样我就不必指定架构名称?我可以在不指定架构名称的情况下执行select/insert/update
。
I have a grant alter sequence
to a user. But I have to specify the schema name
to alter the sequence otherwise it comes back with error sequence does not exist
. Is it possible to do the grant in a way so I don't have to specify the schema name? I can do select/insert/update
without specifying the schema name.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
听起来您以与拥有该序列的用户不同的用户身份连接到数据库。在这种情况下,您需要在序列前面加上模式,否则您所讨论的序列会很模糊。
如果您作为拥有用户连接到数据库,则不需要架构限定符:
It sounds like you're connected to your database as a different user than the one that owns the sequence. In that case, you will need to preface the sequence with the schema, otherwise it's ambiguous as to what sequence you're talking about.
If you are connected to your database as the owning user, you do not need the schema qualifier:
您可以:
ALTER SESSION SET CURRENT_SCHEMA myschema
..然后您可以引用所有不带限定符的项目。
you may:
ALTER SESSION SET CURRENT_SCHEMA myschema
..then you can reference all items without the qualifier.
名称解析和访问权限是不同的概念。
grant
授予您更改架构的权限,但您仍然受到所在命名空间的限制。有四种方法可以使一个架构中的名称在另一个select schema_name.sequence_name.nextval from Dual;
alter session set current_schema = schema_name;
create synonym sequence_name for schema_name.sequence_name;
create schema_name.sequence_name 的公共同义词sequence_name;
Name resolution and access privileges are separate concepts. The
grant
gives you permission to alter the schema, but you're still constrained by the namespace you're in. There are four ways to make a name in one schema resolve in another:select schema_name.sequence_name.nextval from dual;
alter session set current_schema = schema_name;
create synonym sequence_name for schema_name.sequence_name;
create public synonym sequence_name for schema_name.sequence_name;