0
votes

Couldn't find user

I tried this

grant execute on sys.dbms_crypto to "DB_Project";

But error: ORA-00942: table or view does not exist 00942. 00000 - "table or view does not exist"

Also tried this:

grant execute on sys.dbms_crypto to SYSTEM."DB_Project"; 

ERROR: 00000 - "SQL command not properly ended"

How to solve???

enter image description here

1
Try always to avoid double quotes in oracle. Without the double-quotes, oracle will assume uppercase names regardless if you write with upper or lower case.F.Madsen

1 Answers

1
votes

Connect as SYS and grant that privilege to a user:

SQL> show user
USER is "SYS"
SQL> grant execute on dbms_crypto to scott;

Grant succeeded.

SQL>

You granted it to "DB_Project" - did you really create user using mixed case? If not, remove double quotes.

Saying that you'd grant it to "user created inside SYSTEM" - what would that be? Users can't be created "inside" other users, each of them is separate. I'm trying to do what you told us:

SQL> create user "DB_Project" identified by test;

User created.

SQL> grant execute on dbms_crypto to db_project;
grant execute on dbms_crypto to db_project
                                *
ERROR at line 1:
ORA-01917: user or role 'DB_PROJECT' does not exist


SQL> grant execute on dbms_crypto to "DB_Project";

Grant succeeded.

SQL>

Apparently, it works when username is enclosed into double quotes (if it was created that way - I wouldn't recommend it, though).

Is there anything else you did (and didn't show us)? What caused ORA-00942? There's no table involved here ...

Oh, yes - saying that "you can't find user" - here's how you'd do that:

SQL> select * From all_users;

USERNAME                          USER_ID CREATED
------------------------------ ---------- --------
XS$NULL                        2147483638 29.05.14
DB_Project                             49 17.03.19
SCOTT                                  48 19.02.19
APEX_040000                            47 29.05.14
<snip>