Re: Questions abouts table info. and tablespaces.
Date: Mon, 20 Nov 2000 20:27:24 GMT
Message-ID: <3A22C3DD.3B0AA0BD_at_home.nl>
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 BortelReceived on Mon Nov 20 2000 - 21:27:24 CET