RE: Truncate another users table

  • From: "Bobak, Mark" <Mark.Bobak@xxxxxxxxxxxxxxx>
  • To: "Bobak, Mark" <Mark.Bobak@xxxxxxxxxxxxxxx>, "Goulet, Dick" <DGoulet@xxxxxxxx>, <lhahn_60@xxxxxxxxx>, <Oracle-L@xxxxxxxxxxxxx>
  • Date: Fri, 3 Dec 2004 15:38:03 -0500

(Cleaning up.....got bounced for over quoting)

In my last post, I said:
Oh, I absolutely agree it's a bad idea, no doubt about that.
=20
I don't see any good solution outside of the PL/SQL wrapper
and execute immediate, which the original poster already=20
pointed out won't work for him.

Ok, I just thought of this....

You'll have to tolerate the user having the DROP ANY TABLE
privilege.  I don't see any way around that. =20

What you're trying to do will work if you do this as user_a:
alter session set current_schema=3Duser_b;
truncate table truncate_me;

The preceding will truncate a table called truncate_me
owned by user_b, if user_a has DROP ANY TABLE priv.

Hope that helps,

-Mark

Dick Goulet said:
> > OK, I stand corrected.  But this is even more scary having=20
> a user with
> > the DROP ANY TABLE privilege.  The best option them would=20
> be to build
> > the table in the users schema & forget the synonym all together.=20

Mark Bobak said:
> > Not true.  Truncate on a table not owned by you requires DROP=20
> > ANY TABLE.
> >=20


Dick Goulet said:
> > > Well you could grant the user delete priviledges on the=20
> > table.  If you
> > > can delete from it you can truncate it.=20
--
//www.freelists.org/webpage/oracle-l

Other related posts: