Re: Questions abouts table info. and tablespaces.

From: Lamar Williams <lamar_at_moOFus.com>
Date: Mon, 20 Nov 2000 19:41:55 -0800
Message-ID: <3A19EF03.A60C6FF2_at_moOFus.com>


Thanks a million.

Lamar

Frank van Bortel wrote:

> Inline...
>
> Lamar Williams wrote:
>
> > Hello,
> >
> > I have 4 questions:
> >
> > 1) How do I make it such that different users
> > can access the same tablespace/tables? For example,
> > user scott creates a table named "emp", I want
> > user lamar to be able to access the table
> > without using "sys.emp".
> >
> > select * from sys.emp ; This works for lamar.
> >
> > select * from emp ; This does not work for lamar, why?
>
> Evaluates to select * from <lamar_default_ts>.emp;
> Create a synonym (logged as scott):
> create public synonym emp for emp;
> Or a private one - just for lamar: log in as lamar, and:
> create synonym emp for sys.emp;
>
> Of course, lamar should be granted to use emp from scott:
> as scott:
> grant [select, update, insert, delete, all] on emp to lamar;
>
> >
> >
> > 2) How can I determine what's a user default tablespace?
>
> Select default_tablespace from dba_users where username = <your user>;
>
> >
> >
> > 3) How can I determine what columns, and types are in a table ?
>
> desc <table_name>
>
> >
> >
> > 4) How can I determine what tables are in a tablespace?
>
> select tablespace_name, table_name from all_tables
> group by tablespace_name , table_name;
>
> >
> >
> > Thanks,
> >
> > Lamar_at_moOFus.com
>
> One remark: you seem to have installed scoot's tables in the
> sys tablespace - this is a bad idea. Always give _all_ users
> except sys, a default tablespace other than sys. Yes, that
> includes system.
>
> --
> Gtrz,
>
> Frank van Bortel
Received on Tue Nov 21 2000 - 04:41:55 CET

Original text of this message