dbTalk Databases Forums  

Need Truncate Table Partition Command

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss Need Truncate Table Partition Command in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mark A
 
Posts: n/a

Default Need Truncate Table Partition Command - 08-24-2010 , 01:26 PM






Are there any plans for a truncate table partition command (with and without
save to side table)? We also need ability to reattach a partition (from the
table created during detach) with the same partition info as existed before
detach without having to specify it in detail.

Authorization for such a command would be separate from any existing
authorization (for an ETL person), or maybe included in LOAD authorization.
Right now I would have to grant DBADM to ETL team to do this (or control on
each table) and I don't want to give them that much authority just to
truncate the data in a partition. Currently I have to detach, load side
table from /dev/null, and attach side table back into the table as a new
partition.

In conjunction with this new authority should be the ability to attach a
table back as a partition using the same information (partition name,
ranges, etc) as existed when the detach took place. So an ETL person could
only be authorized to put a partition back exactly it was the way before it
was detached (but they could insert, update, delete, or truncate the data in
the side table before putting it back as a partition).

Reply With Quote
  #2  
Old   
Serge Rielau
 
Posts: n/a

Default Re: Need Truncate Table Partition Command - 08-24-2010 , 04:36 PM






On 8/24/2010 2:26 PM, Mark A wrote:
Quote:
Are there any plans for a truncate table partition command (with and without
save to side table)? We also need ability to reattach a partition (from the
table created during detach) with the same partition info as existed before
detach without having to specify it in detail.

Authorization for such a command would be separate from any existing
authorization (for an ETL person), or maybe included in LOAD authorization.
Right now I would have to grant DBADM to ETL team to do this (or control on
each table) and I don't want to give them that much authority just to
truncate the data in a partition. Currently I have to detach, load side
table from /dev/null, and attach side table back into the table as a new
partition.

In conjunction with this new authority should be the ability to attach a
table back as a partition using the same information (partition name,
ranges, etc) as existed when the detach took place. So an ETL person could
only be authorized to put a partition back exactly it was the way before it
was detached (but they could insert, update, delete, or truncate the data in
the side table before putting it back as a partition).
Uhm, I hope you don't think that usenet is the formal way for feature
requests....

--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab

Reply With Quote
  #3  
Old   
Mark A
 
Posts: n/a

Default Re: Need Truncate Table Partition Command - 08-24-2010 , 08:02 PM



"Serge Rielau" <srielau (AT) ca (DOT) ibm.com> wrote

Quote:
Uhm, I hope you don't think that usenet is the formal way for feature
requests....

--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab
I am not making a formal request, I am just asking if this is in the plans
so that I don't have to make a request.

You are more than welcome to steal this idea and make it your own, but if
think it would be best for me to make a formal request, then let me know how
to do that.

Reply With Quote
  #4  
Old   
Serge Rielau
 
Posts: n/a

Default Re: Need Truncate Table Partition Command - 08-25-2010 , 07:46 AM



On 8/24/2010 9:02 PM, Mark A wrote:
Quote:
"Serge Rielau"<srielau (AT) ca (DOT) ibm.com> wrote in message
news:8disagF8i2U1 (AT) mid (DOT) individual.net...
Uhm, I hope you don't think that usenet is the formal way for feature
requests....

--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab

I am not making a formal request, I am just asking if this is in the plans
so that I don't have to make a request.

You are more than welcome to steal this idea and make it your own, but if
think it would be best for me to make a formal request, then let me know how
to do that.


Comments from backstage:
Would need to get a better handle on whether they are truly trying to
empty a current partition and then roll data back into the same
partition definition or are they trying to empty a current partition and
then reattach as a new partition which will be used for roll in purposes.

If the former then they are truly looking for a truncate partition, if
the latter they are looking for the ability to attach and detach with
finer grained authority rules.

--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab

Reply With Quote
  #5  
Old   
Mark A
 
Posts: n/a

Default Re: Need Truncate Table Partition Command - 08-25-2010 , 09:33 AM



"Serge Rielau" <srielau (AT) ca (DOT) ibm.com> wrote

Quote:
Comments from backstage:
Would need to get a better handle on whether they are truly trying to
empty a current partition and then roll data back into the same partition
definition or are they trying to empty a current partition and then
reattach as a new partition which will be used for roll in purposes.

If the former then they are truly looking for a truncate partition, if the
latter they are looking for the ability to attach and detach with finer
grained authority rules.

--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab
The first scenario (empty a partition) is more important since it can
functionally be seen as an extension of DELETE authority on a table without
any DDL rights having to be granted. Often times when ETL team is loading
data, they discover a problem and need to start over on a particular
partition (whether it be a staging table or a final table). The ETL team
already has LOAD authority, but that only applies to the whole table, and
they need LOAD Replace from /dev/null (aka truncate) on a particular
partition.

The other scenario of creating a finer authorization granularity to allow
detach and attach authority without having CONTROL authority on the table
would also be a good idea IMO. I might even go further to distinguish the
following:

- Detach any partition within the authorized table
- Attach only what was previously detached and attach it with same
partitioning range (must be attached as same partition name, range, etc as
existed before detach
- Attach any partition to the authorized table

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.