Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Database vs tablespace, what's the difference?

In oracle what's the differences between a database and a table space?

like image 878
001 Avatar asked Jul 01 '13 17:07

001


People also ask

What is the difference between tablespace and database?

An Oracle database consists of one or more logical storage units called tablespaces, which collectively store all of the database's data. Each tablespace in an Oracle database consists of one or more files called datafiles, which are physical structures that conform with the operating system in which Oracle is running.

What is a tablespace in database?

A table space is a storage structure containing tables, indexes, large objects, and long data. They are used to organize data in a database into logical storage groupings that relate to where data is stored on a system. Table spaces are stored in database partition groups.

What is difference between table and tablespace?

The tablespace is where tables gets stored. It links the physical storage layer (files on disks) and the logical storage layer (tables, indexes).

What is a tablespace in SQL?

A tablespace is a unit of database storage that is roughly equivalent to a file group in Microsoft SQL Server. Tablespaces allow storage and management of database objects within individual groups. For more information, see the Oracle documentation.


1 Answers

A little terminology:

Oracle defines a database as the set of files that you find on your Oracle system. This means all data in your Oracle system is in these database files, commonly known as "data files". There are other files in the database such as parameter files and redo logs.

On the other hand, an instance consists of the processes and memory areas that Oracle database uses. Together, a database and an instance make up a database system. (For more information, see the Oracle Concept guide)

Logically, you will want to define different spaces within that database. This is done via tablespaces (see Oracle Concept guide). A tablespace usually consists of one or more data files. When you define a table with CREATE TABLE, you can specify in which tablespace the table should be created. This allows you to seperate different applications on the same database system, for example.

The Oracle Concepts guide is an excellent source of information for questions like these. See this picture on how data files and tablespaces are composed.

like image 144
Simon Avatar answered Oct 08 '22 02:10

Simon