Problem solve Get help with specific problems with your technologies, process and projects.

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 last published in July 2004

Dig Deeper on Oracle database design and architecture

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.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.