Avatar of marrowyung
marrowyung

asked on 

find out oracle database object permission.

hi,

how can I list out all oracle objects permission of a schema(s) ?
Oracle DatabaseSecurity

Avatar of undefined
Last Comment
marrowyung
Avatar of Mark Geerlings
Mark Geerlings
Flag of United States of America image

This will work if you are connected to Oracle as the schema owner:

select * from user_tab_privs where owner = user
order by table_name, grantee;
Avatar of marrowyung
marrowyung

ASKER

I am not connected as schema owner but I will connect as root.

then in SQL developer I will browse to that schema and see what object it has.

"select * from user_tab_privs where owner = user
order by table_name, grantee;
Is this your solution?"

can I do sth like change the owner = <schema>  ?

if I do that I seems it has an error:

Error starting at line : 19 in command -
select * from user_tab_privs where owner = CISUAT
order by table_name, grantee
Error at Command Line : 19 Column : 44
Error report -
SQL Error: ORA-00904: "CISUAT": invalid identifier
00904. 00000 -  "%s: invalid identifier"
*Cause:    
*Action:

Open in new window


So can't replace with a schema name!

then can I find out permission about particular schema(s) ?
"I am not connected as schema owner but I will connect as root."

Those are two different things.  Connecting as root is in the O/S  *outside* of the database.

Connecting as the schema owner (or as a DBA) is *inside* the database.  (And that is usually easier if you connect in the O/S not as root, but as the Oracle software owner.)  If you can't or don't want to connect in the database as the schema owner, then you cannot use this query from user_tab_privs, since that view does not include an owner column.

You can instead select from either all_tab_privs or dba_tab_privs (if you have DBA privilege in Oracle).  But this syntax is invalid in Oracle:
where owner = CISUAT

You can only use that syntax for numeric values and numeric columns.  For CHAR, VARCHAR2, DATE or TIMESTAMP columns you have to provide single quotes around your literal value like this:
where owner = 'CISUAT'
Avatar of marrowyung
marrowyung

ASKER

"Those are two different things.  Connecting as root is in the O/S  *outside* of the database".

but root can login right ? or when login it will be SYSTEM login ? I connect using SYSTEM to login.

"And that is usually easier if you connect in the O/S not as root, but as the Oracle software owner"

sometime yes.

"You can instead select from either all_tab_privs or dba_tab_privs (if you have DBA privilege in Oracle).  But this syntax is invalid in Oracle:"

do you have an updated one for me ?
"root can login [to an Oracle database] right?"
No. Root is an O/S user, not an Oracle user.

"when [I] login [to Oracle] it will be SYSTEM login?
Maybe.  That depends on which Oracle username you provide.  I usually log in to Oracle as a schema owner, or I use "sqlplus / as sysdba" to connect as SYS (not SYSTEM) if I need DBA privileges.  In Oracle, the SYS user has more privileges than the SYSTEM user.  

"I connect [to Oracle] using SYSTEM to login"
That is legal in Oracle, but not common in most Oracle systems.  Most users connect to Oracle either as a schema owner, or as a different user who has been given the permission they need to use tables in other schemas.

This query should work for you:
select * from dba_tab_privs where owner = 'CISUAT';
Avatar of marrowyung
marrowyung

ASKER

"No. Root is an O/S user, not an Oracle user."

yeah I agree. I login using SYSTEM oracle account.

"In Oracle, the SYS user has more privileges than the SYSTEM user.  "

tks.

"  Most users connect to Oracle either as a schema owner, or as a different user who has been given the permission they need to use tables in other schemas."

yeah.. I agree, but I am the owner of that oracle system.

"This query should work for you:
select * from dba_tab_privs where owner = 'CISUAT';"

that one seems too simple, and it don't say table, permission and owner in the same result
ASKER CERTIFIED SOLUTION
Avatar of Mark Geerlings
Mark Geerlings
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of marrowyung
marrowyung

ASKER

tks.
Oracle Database
Oracle Database

Oracle is an object-relational database management system. It supports a large number of languages and application development frameworks. Its primary languages are SQL, PL/SQL and Java, but it also includes support for C and C++. Oracle also has its own enterprise modules and application server software.

81K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo