Restore or some recreate a tablespace to another new tablespace on the side or empty db with only

294 Views Asked by At

On db2 LUW LInux: Is there a possibility to recreate tablespace somewhere aside pointing to a different tablespace name created only for the purpose of unloading data from the table. I'd like to be able to extract data or restore data from a damaged table so that you don't have to recreate the entire database, which usually takes a lot of disk space and time

1

There are 1 best solutions below

2
On

You can't do it back into the original db, but you could create a separate db that contains just the tablespace with the data you're interested in:

db2 restore db foo rebuild with tablespace ( syscatspace, mytbsp )
db2 rollforward db foo to end of logs and stop
db2 export to mytable.del of del select * from mytable