I want to get the number of sessions in Oracle using the SQL query:
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?
Answers. Connect with SYSDBA privilege and run: SQL> show user USER est "SYS" SQL> grant select on v_$parameter to test; Autorisation de privilèges (GRANT) acceptee.
V$PARAMETER displays information about the initialization parameters that are currently in effect for the session. A new session inherits parameter values from the instance-wide values displayed by the V$SYSTEM_PARAMETER view. Column. Datatype.
The default location in UNIX for the server parameter file or text initialization parameter file is $ORACLE_HOME/dbs. On Windows, the default location is ORACLE_HOME/dbs.
The hidden parameters in oracle database start with “_”. It is not possible to see the hidden parameters by command “show parameter” or querying v$parameter unless the hidden parameter set explicitly set in init. ora file. Following query can be use to see hidden parameters: SELECT x.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With