dbTalk Databases Forums  

QUestion: how to list all the tablespaces?

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss QUestion: how to list all the tablespaces? in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Grace Tsai
 
Posts: n/a

Default QUestion: how to list all the tablespaces? - 12-15-2004 , 01:35 PM






Hi,

This is a really elementary question. What is the command to list all
the tablespaces in the database? Thanks.

Grace


Reply With Quote
  #2  
Old   
Turkbear
 
Posts: n/a

Default Re: QUestion: how to list all the tablespaces? - 12-15-2004 , 02:47 PM






Grace Tsai <gtsai (AT) bnl (DOT) gov> wrote:

Quote:
Hi,

This is a really elementary question. What is the command to list all
the tablespaces in the database? Thanks.

Grace
If DBA you can use

Select distinct tablespace_name from dba_tables order by tablespace_name;

Variants will be
all_tables ( all tables the user logged in has access to)
user_table ( tables owned by logged in user)
- These will limit the tablespaces you get back to those used by the table in the set..



Reply With Quote
  #3  
Old   
Michel Cadot
 
Posts: n/a

Default Re: QUestion: how to list all the tablespaces? - 12-15-2004 , 03:06 PM




"Grace Tsai" <gtsai (AT) bnl (DOT) gov> a écrit dans le message de news:cpq0mt$jfo$1 (AT) news (DOT) bnl.gov...
Quote:
Hi,

This is a really elementary question. What is the command to list all
the tablespaces in the database? Thanks.

Grace

select tablespace_name from dba_tablespaces;

Regards
Michel Cadot




Reply With Quote
  #4  
Old   
Turkbear
 
Posts: n/a

Default Re: QUestion: how to list all the tablespaces? - 12-15-2004 , 03:55 PM



"Michel Cadot" <micadot{at}altern{dot}org> wrote:

Quote:
"Grace Tsai" <gtsai (AT) bnl (DOT) gov> a écrit dans le message de news:cpq0mt$jfo$1 (AT) news (DOT) bnl.gov...
| Hi,
|
| This is a really elementary question. What is the command to list all
| the tablespaces in the database? Thanks.
|
| Grace
|

select tablespace_name from dba_tablespaces;

Regards
Michel Cadot


OK, so do it the easy way...

;-)





Reply With Quote
  #5  
Old   
Michel Cadot
 
Posts: n/a

Default Re: QUestion: how to list all the tablespaces? - 12-15-2004 , 04:11 PM




"Turkbear" <john.g (AT) dot (DOT) spamfree.com> a écrit dans le message de
news:tlc1s0tk9ighne76n90qs5kp72d8ng4b0h (AT) 4ax (DOT) com...
Quote:
"Michel Cadot" <micadot{at}altern{dot}org> wrote:


"Grace Tsai" <gtsai (AT) bnl (DOT) gov> a écrit dans le message de news:cpq0mt$jfo$1 (AT) news (DOT) bnl.gov...
| Hi,
|
| This is a really elementary question. What is the command to list all
| the tablespaces in the database? Thanks.
|
| Grace
|

select tablespace_name from dba_tablespaces;

Regards
Michel Cadot



OK, so do it the easy way...

;-)

We can also use user_tablespaces to to limit those on which we have access.

;-)
Michel Cadot




Reply With Quote
  #6  
Old   
joel-garry@home.com
 
Posts: n/a

Default Re: QUestion: how to list all the tablespaces? - 12-15-2004 , 05:47 PM



SQL> select tablespace_name from dba_tablespaces minus
2 Select distinct tablespace_name from dba_tables order by
tablespace_name;

TABLESPACE_NAME
------------------------------
INDX
RBS
TEMP_LOCAL
USERS

:-O

jg
--
@home.com is bogus.
Wondering why I get an extra blank row when I Select distinct
tablespace_name from dba_tables order by tablespace_name;


Reply With Quote
  #7  
Old   
Andy Hassall
 
Posts: n/a

Default Re: QUestion: how to list all the tablespaces? - 12-18-2004 , 06:58 AM



On 15 Dec 2004 15:47:38 -0800, joel-garry (AT) home (DOT) com wrote:

Quote:
Wondering why I get an extra blank row when I Select distinct
tablespace_name from dba_tables order by tablespace_name;
SQL> create table t1 (
2 c number not null,
3 constraint t1_pk
4 primary key (c)
5 );

Table created.

SQL> create table t2 (
2 c number not null,
3 constraint t2_pk
4 primary key (c)
5 )
6 organization index;

Table created.

SQL> create global temporary table t3 (
2 c number not null,
3 constraint t3_pk
4 primary key (c)
5 );

Table created.

SQL> select table_name, tablespace_name from user_tables
2 order by table_name;

TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
T1 USERS
T2
T3

SQL> select index_name, tablespace_name from user_indexes
2 order by index_name;

INDEX_NAME TABLESPACE_NAME
------------------------------ ------------------------------
T1_PK USERS
T2_PK USERS
T3_PK

--
Andy Hassall / <andy (AT) andyh (DOT) co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.