Q

Getting a list of tablespaces

How can I see the list of databases? I know how to create a table using SQL statements, but how can I keep it in

a specific database or to create it under a specific database? It appears to me that you are not using the term "database" in the same manner that Oracle uses this term. The Oracle term you most likely want to use in this context is the term "tablespace." An Oracle tablespace is analagous to SQL Server's database.

To see a list of tablespaces in Oracle, issue the following query:

SELECT tablespace_name FROM dba_tablespaces;

Once you know which tablespace you want to house your table, you can create your table similar to the following:

CREATE TABLE my_table (
   id NUMBER,
   name VARCHAR2(30))
TABLESPACE user_tablespace;

The TABLESPACE clause in the CREATE TABLE command instructs Oracle to place the table in the correct location.

This was first published in July 2004

Dig deeper on Oracle database design and architecture

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close