HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

In Oracle how do you move a Schema to a different Tablespace?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
tablespaceyoumovedifferenthoworacleschema

Problem

I noticed that a Schema has been created in the USERS Tablespace but our local rule is that it should be in a Tablespace by itself. In Oracle how do you move a Schema to a different Tablespace?

Solution

A schema itself can not be stored nor can have changed tablespace en bloc in any way. In fact, it is just a meta-structucre. Instead - there is DEFAULT TABLESPACE attribute of underlying USER. If you change it, then new objects are created in this tablespace by default (unless you excplicitly specify another one).

In addition, each type of structure (Table/Index/Partition...) has it's own way of moving to another tablespace. (i.e. moving a table does not move indexes built upon it - which would be rather undesirable, because you want to store indexes in another filesystem for better performance). This means, that you will have to move contents of the schema object by object.

Context

StackExchange Database Administrators Q#19537, answer score: 7

Revisions (0)

No revisions yet.