A database schema vs a database tablespace?

后端 未结 3 1999
轮回少年
轮回少年 2021-02-01 03:38

Doing my databases reading when I read...

Schema: Is a container for objects

Tablespace: A logical storage unit for objects

Can anyone explain the differ

3条回答
  •  渐次进展
    2021-02-01 04:30

    Schema operates the logical structures.
    While Tablespaces operate physical datafiles that constitute the database.

    From Oracle documentation:

    Schema:
    A schema is a collection of database objects. A schema is owned by a database user and has the same name as that user. Schema objects are the logical structures that directly refer to the database's data. Schema objects include structures like tables, views, and indexes. (There is no relationship between a tablespace and a schema. Objects in the same schema can be in different tablespaces, and a tablespace can hold objects from different schemas.)

    Tablespaces:
    A database is divided into one or more logical storage units called tablespaces. Tablespaces are divided into logical units of storage called segments, which are further divided into extents. Extents are a collection of contiguous blocks. The size of a tablespace is the size of the datafiles that constitute the tablespace. The size of a database is the collective size of the tablespaces that constitute the database.

    You can enlarge a database in three ways:

    Add a datafile to a tablespace
    
    Add a new tablespace
    
    Increase the size of a datafile
    

提交回复
热议问题