Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How can I get a list of accessible tables

Re: How can I get a list of accessible tables

From: Daniel Morgan <damorgan_at_exxesolutions.com>
Date: Thu, 31 Jul 2003 08:48:21 -0700
Message-ID: <3F293A44.3EB6E523@exxesolutions.com>


MCArch wrote:

> Is there any way for an Oracle 8i user to get a list of tables to which he
> has been granted Select? He doesn't own the tables and they don't list
> selecting from tabs.

First, and most obviously, all tables in user_tables:

SELECT table_name
FROM user_tables

Secondly tables owned by other schemas to which you have been granted SELECT:

SELECT table_name
FROM user_tab_privs_recd
WHERE privilege = 'SELECT';

Then combine the two adding the owner:

SELECT 'MY SCHEMA' owner, table_name
FROM user_tables
UNION ALL
SELECT owner, table_name
FROM user_tab_privs_recd
WHERE privilege = 'SELECT';

--
Daniel Morgan
http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Thu Jul 31 2003 - 10:48:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US