0

I can not select the current SCN, with the command that I previously could.

I tried with this command:

select current_scn from v$database;
ORA-00942: table or view does not exist

select dbms_flashback.get_system_change_number from dual;
ORA-00904: "DBMS_FLASHBACK"."GET_SYSTEM_CHANGE_NUMBER": invalid identifier

I get SCN only with this command:

select timestamp_to_scn(sysdate) from dual;

TIMESTAMP_TO_SCN(SYSDATE)
-------------------------
           835484

1 Answer 1

0

Users by default do not have the privilege to use those objects:

[oracle@o7ca1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Mar 4 20:42:48 2019
Version 19.2.0.0.0

Copyright (c) 1982, 2018, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.2.0.0.0

SQL> show user
USER is "SYS"
SQL> select current_scn from v$database;

CURRENT_SCN
-----------
     564558

SQL> create user u1 identified by u1;

User created.

SQL> grant create session to u1;

Grant succeeded.

SQL> conn u1/u1
Connected.
SQL> select current_scn from v$database;
select current_scn from v$database
                        *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> select dbms_flashback.get_system_change_number from dual;
select dbms_flashback.get_system_change_number from dual
       *
ERROR at line 1:
ORA-00904: "DBMS_FLASHBACK"."GET_SYSTEM_CHANGE_NUMBER": invalid identifier

DBMS_FLASHBACK

DBMS_FLASHBACK Security Model

To use the DBMS_FLASHBACK package, you must have the EXECUTE privilege on it.

About Dynamic Performance Views

After installation, only user SYS or anyone with SYSDBA privilege has access to the dynamic performance tables.

We do not know what privileges you had before, that you do not have now.

Ask your DBA to grant you the required privileges.

grant read on sys.v_$database to petar;

Or:

grant execute on dbms_flashback to petar;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.