RE: Truncate another users table

  • From: Larry Hahn <lhahn_60@xxxxxxxxx>
  • To: "Bobak, Mark" <Mark.Bobak@xxxxxxxxxxxxxxx>, Oracle-L@xxxxxxxxxxxxx
  • Date: Fri, 3 Dec 2004 12:00:32 -0800 (PST)

Mark,

I agree that would work better and be more secure. But the
actual truncate code is buried in the vendors code. It is
part of a bigger process that I cant get changed at the
moment. 

I am looking for a resolution in the mean time.

Larry

--- "Bobak, Mark" <Mark.Bobak@xxxxxxxxxxxxxxx> wrote:

> Larry,
> 
> Synonyms don't work on DDL statements, as you discovered.
> 
> However, rather than granting a user DROP ANY TABLE,
> which
> it seems to me could be easily misused or abused, why not
> do:
> 
> As user1:
> create function truncate_the_table as
> begin
>   execute immediate 'truncate table this_table';
> end;
> /
> grant execute on truncate_the_table to user2;
> 
> As user2:
> 
> exec truncate_the_table;
> 
> That may be a better solution for you....
> 
> 
> -Mark
> 
> > -----Original Message-----
> > From: oracle-l-bounce@xxxxxxxxxxxxx
> > [mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of
> Larry Hahn
> > Sent: Friday, December 03, 2004 2:43 PM
> > To: Oracle-L@xxxxxxxxxxxxx
> > Subject: Truncate another users table
> > 
> > 
> > List,
> > 
> > I am running version 8.1.7 on Sun.
> > 
> > I am trying to allow a user (A) to truncate another
> users
> > (B) table. I have already given the DROP ANY TABLE
> right to
> > A, and made a public synonym for the table owned by B. 
> > 
> > I can't do the truncate if I just give the table name,
> but
> > if I put the owner first (truncate table A.<tablename>)
> it
> > works. What have I missed?
> > 
> > Because the truncate command that I ultimately need to
> run
> > is buried in the vendors code, I am not able to create
> and
> > execute the stored procedure that I have seen suggested
> > here on the list in the past. 
> > 
> > Thanks in advance for any help.
> > 
> > Larry Hahn
> > 
> > 
> >             
> > __________________________________ 
> > Do you Yahoo!?
> > Send holiday email and support a worthy cause. Do good.
> > http://celebrity.mail.yahoo.com
> > --
> > //www.freelists.org/webpage/oracle-l
> > 
> 


=====



                
__________________________________ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 
--
//www.freelists.org/webpage/oracle-l

Other related posts: