Thanks for the question, Hubert.
Asked: February 21, 2024 - 1:47 pm UTC
Last updated: February 26, 2024 - 5:46 am UTC
Version: Oracle Database Version 19.20.0.0.0
Viewed 10K+ times! This question is
create or replace view myview_datafile as select file#, bytes/1024/1024||' MB' as "SIZE" from V$datafile; * ERROR at line 1: ORA-00942: table or view does not exist
SQL> conn system/admin Connected. SQL> create or replace view myview_datafile as select file#, bytes/1024/1024||' MB' as "SIZE" from V$datafile; create or replace view myview_datafile as select file#, bytes/1024/1024||' MB' as "SIZE" from V$datafile * ERROR at line 1: ORA-01031: insufficient privileges SQL> conn / as sysdba Connected. SQL> grant select on sys.V_$datafile to system; Grant succeeded. SQL> conn system/admin Connected. SQL> create or replace view myview_datafile as select file#, bytes/1024/1024||' MB' as "SIZE" from V$datafile; View created.
Rajeshwaran Jeyabal, February 23, 2024 - 11:46 am UTC
sys@PDB1> grant read on V_$datafile to demo; Grant succeeded.
SQL> select * from v$datafile for update; select * from v$datafile for update * ERROR at line 1: ORA-02030: can only select from fixed tables/views
Check out more PL/SQL tutorials on our LiveSQL tool.
PL/SQL reference manual from the Oracle documentation library