SQL 在 Oracle 中找不到表 v$parameter
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14924681/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cannot find table v$parameter in Oracle
提问by Peter Penzov
I want to get the number of sessions in Oracle using the SQL query:
我想使用 SQL 查询获取 Oracle 中的会话数:
SELECT value FROM v$parameter WHERE name = 'sessions'
But I get this error:
但我收到此错误:
Error starting at line 1 in command:
SELECT value FROM v$parameter WHERE name = 'sessions'
Error at Command Line:1 Column:18
Error report:
SQL Error: ORA-00942: table or view does not exist
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Maybe the Oracle user that I use is not privileged?
也许我使用的 Oracle 用户没有特权?
回答by steve
Generally the better approach is to use a procedure and grant the necessary privileges to this procedure. However if you want use SQL directly, you can grant SELECT_CATALOG_ROLE
or SELECT ANY DICTIONARY
to the user.
通常,更好的方法是使用一个过程并为该过程授予必要的权限。但是,如果您想直接使用 SQL,则可以授予SELECT_CATALOG_ROLE
或授予SELECT ANY DICTIONARY
用户。
回答by Plouf
Probably. To grant the rights, you need to use the table name as V_$PARAMETER
. It comes from some restriction when granting rights on dynamic views.
大概。要授予权限,您需要使用表名作为V_$PARAMETER
. 它来自授予动态视图权限时的一些限制。
回答by GreenGlassDragon
using the privileges: - select any table, alter any tablewhen running the grant as SYS with SYSDBA in Oracle 12c solved the issue for me.
使用特权: -选择任何表,在 Oracle 12c 中使用 SYSDBA 以 SYS 身份运行授权时更改任何表为我解决了这个问题。