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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 13:43:52  来源:igfitidea点击:

Cannot find table v$parameter in Oracle

sqloracleoracle11g

提问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_ROLEor SELECT ANY DICTIONARYto 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 身份运行授权时更改任何表为我解决了这个问题。