Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Permission to TRUNCATE table

Re: Permission to TRUNCATE table

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 23 Oct 2003 06:52:47 -0700
Message-ID: <2687bb95.0310230552.25b97cc0@posting.google.com>


Daniel Morgan <damorgan_at_x.washington.edu> wrote in message news:<1066831917.433571_at_yasure>...
> Mark D Powell wrote:
>
> >There is no grantable truncate table privilege. By default only the
> >owner or a DBA may truncate a table.
> >
> >To get around this limitation create a procedure owned by the table
> >owner or a DBA id that issues the truncate command via an execute
> >immediate. To prevent truncating the wrong table it would be wise to
> >include a check against a list of authorized to be truncated tables.
> >
> >HTH -- Mark D Powell --
> >
> >
> The permission to TRUNCATE a table in another schema is DROP ANY TABLE.
>
> --
> Daniel Morgan
> damorgan_at_x.washington.edu
> (replace 'x' with a 'u' to reply)
>
> --

Technically true, but I find it undesirable to grant drop any table so I have modified my advice to take this option into account.

There is no directly grantable truncate table object privilege. By default only the owner of a table or a DBA may truncate a table. The ability to truncate a table is granted through the drop any table privilege; however, this privilege obviously includes the ability to drop the table.

To provide the ability to efficiently clear out a table's contents without allowing the table and its associated indexes, grants, and triggers from being dropped create a procedure owned by the table owner or an id that has drop any table privilege that issues the truncate command via an execute immediate statement. To prevent truncating the wrong table it would be wise to include a check against a list of authorized to be truncated tables within the routine.

Received on Thu Oct 23 2003 - 08:52:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US