View previous topic :: View next topic
|
Author |
Message |
Musab Ahmed
New User
Joined: 10 Dec 2012 Posts: 37 Location: India
|
|
|
|
HI All,
There is a production job which uses LOAD utility to load a table. It is as follows.
LOAD DATA
REPLACE COPYDDN (COPY01)
STATISTICS TABLE (ALL) INDEX (ALL) UPDATE ALL
LOG NO
SORTKEYS 900000 SORTDEVT SYSDA
DISCARDS 0
INTO TABLE DB2FS001.TFSA092_UPC_HIER
(
I know that LOAD REPLACE statement would first delete any existing row and replaces the data with the new data.
I just want to know when the existing rows are deleted, will the space occupied by the rows also get freed up or should a reorg is to be performed to free the space? |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
read manuals |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi Musab,
Welcome to IBMMAINFRAMES!
When you do a LOAD REPLACE, db2 will redefine the dataset itself, so space occupied by the existing rows will be gone along with the dataset. For DB2 to do that below conditions should be satisified.
1) Tablespace should have been created in DB2 managed storage groups.
2) REUSE option should not be used.
Regards,
Sushanth |
|
Back to top |
|
|
Musab Ahmed
New User
Joined: 10 Dec 2012 Posts: 37 Location: India
|
|
|
|
Hi Sushanth,
Sorry for my ignorance, but what do you actually mean by
"space occupied by the existing rows will be gone along with the dataset"
Does this mean the space will be re-utilized for the new LOAD statement? |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi Musab,
redefine = delete the existing dataset -> create new dataset
So, i said
Quote: |
When you do a LOAD REPLACE, db2 will redefine the dataset itself, so space occupied by the existing rows will be gone along with the dataset.
|
Since rows will be loaded to new dataset
Thanks,
Sushanth |
|
Back to top |
|
|
|