---
title: "What is the schema ?"
author: "edwards0307"
date: "2011-12-20T15:18:24Z"
tags: []
categories: ["数据库"]
slug: "what-is-the-schema"
draft: false
lastmod: "2011-12-20T15:18:24Z"
id: 1317758
url: "https://killdbs.iteye.com/blog/1317758"
---

A **schema** is a collection of database objects owned by a specific database user,or schema objects.**Schema** has the same name as that user,every user has a single schema,so the two terms(Schema,User) are synonymous.

**Schema** objects include the segments(tables,indexes..etc) as we can see in the [**tablespaces**](http://www.oracleonlinux.cn/2009/11/05/managing-oracle-tablespaces-and-data-files/) as well as the nosegments database objects(constraints,views,procedures,synonyms and packages).But the roles,tablespaces,profiles and directories are not schema objects,cause they are not owned by one specific user.

In a word,if any object(table,view,index…) owned by one user,it’s schema object.Contrarily,the role,profile,tablespace and directory (not owned by one user) are not schema objects.

**Note:**

There is no relationship between schemas and tablespaces: a tablespace can contain objects from different schemas,and the objects for a schema can be contained in different tablespaces