The forum will be down for maintenance at some point from Friday, November 16 at 19:00 EDT until Sunday, November 18 at 23:59 EDT. Downtime will be minimized but the exact timing is unknown.

What I am going to do is to create a dbspace that contains a table(s) that is existing in the main database file. Anyone know how to do it?

asked 11 Apr '12, 10:14

pLee's gravatar image

pLee
216101119
accept rate: 0%

edited 11 Apr '12, 10:23

Volker%20Barth's gravatar image

Volker Barth
32.4k328476693


AFAIK, there is no SQL Statement to "move" a table, so you will have to

  1. "copy the table" (i.e. create a new one in the desired dbspace and move the data from the existing one over, and delete the existing one afterwards), or
  2. use a "modified reload" to rebuild the whole database with the according table put on the desired dbspace - from the v12 docs:

Splitting existing databases

If you want to split existing database objects among multiple dbspaces, you must unload your database and modify the generated command file (named reload.sql by default) for rebuilding the database. In the reload.sql file, add IN clauses to the CREATE TABLE statements to specify the dbspace for each table you do not want to place in the main file.

If you would like to move the table in order to "free" the space of the system dbspace, then I guess method 2 is necessary, as a dbspace won't shrink without a rebuild.

permanent link

answered 11 Apr '12, 10:21

Volker%20Barth's gravatar image

Volker Barth
32.4k328476693
accept rate: 32%

edited 11 Apr '12, 10:50

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×425
×21

question asked: 11 Apr '12, 10:14

question was seen: 2,258 times

last updated: 11 Apr '12, 10:50