Home > Database > Mysql Tutorial > 如何授权查询v$视图

如何授权查询v$视图

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:59:19
Original
1409 people have browsed it

在非sys,system用户的存储过程中,查询v$开头的视图,如v$mystat,v$statname等。这些视图查询是需要在sys下显示授权后才能在存储过程中使用。 但是,如果我们使用grant on v$view to username,则会收到ORA-02030错误。 如下所示: SQL grant select on v$mys

在非sys,system用户的存储过程中,查询v$开头的视图,如v$mystat,v$statname等。这些视图查询是需要在sys下显示授权后才能在存储过程中使用。

但是,如果我们使用grant on v$view to username,则会收到ORA-02030错误。

如下所示:

SQL> grant select on v$mystat to scott;
-


grant select on v$mystat to scott

ORA-02030: 只能从固定的表/视图查询

这是因为v$mystat不是一个视图,其实它是一个同义词。

因此,需要将同义词对应的视图进行授权。

SQL> grant select on v_$mystat to scott;

Grant succeeded

小技巧,你也可以试试看。
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template