0

I have XE on my computer, using Oracle Database 18c. Earlier, I was able to execute function dbms_output.put_line(); even I logged in as sysadmin or with default role. Now, I only can run dbms_output.put_line() when I am logged in as sysadmin/sysdba. As a default user, I get the following message:

PLS-00201: identifier ‘DBMS_OUPUT.PUT_LINE’ must be declared

I tried to add privilege to execute dbms_output with command grant execute on DBMS_OUTPUT to username;, however, I got this message when I execute a command including dbms_output.put_line():

ORA-04067: not executed, package body "PERFSTAT.DBMS_OUTPUT" does not exist
ORA-06508: PL/SQL: could not find program unit being called: "PERFSTAT.DBMS_OUTPUT"

Using sqlplus, I get the following error as default user:

PLS-00201: identifier 'DBMS_OUTPUT.ENABLE' must be declared

How can I solve this problem?

  • Did you, perhaps, create a synonym while trying to fix your problem - which does originally seem to have just been a typo? What is 'the default user'? – Alex Poole Jun 30 '21 at 13:18
  • @AlexPoole, 'default user' wants to mean 'non-admin user'. It can be because I'm reading a book written by Tom Kyte, where there was a part we – setting up Statspack – create a schema named 'Perfstat'. – Blockedbycodes Jun 30 '21 at 13:23

1 Answers1

1

That's probably because you misnamed it:

No : DBMS_OUPUT.PUT_LINE      (not "ouput" but "output")
Yes: DBMS_OUTPUT.PUT_LINE

As of the 2nd message; well, this: PERFSTAT.DBMS_OUTPUT doesn't make sense, PERFSTAT doesn't own that package. It is called just as

begin
  dbms_output.put_line('Hello');
end;
/

and works for any user, no special grants required.

Littlefoot
  • 131,892
  • 15
  • 35
  • 57