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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Truncate another users table

RE: Truncate another users table

From: Khedr, Waleed <Waleed.Khedr_at_FMR.COM>
Date: Fri, 3 Dec 2004 22:06:11 -0500
Message-ID: <42BBD772AC30EA428B057864E203C9998AC933@MSGBOSCLF2WIN.DMN1.FMR.COM>


If the problem is limited only to the truncate, move the table to the schema owned by the user running the truncate, and create synonym in the other schema pointing to the new location. Also grant the needed priv's.

Waleed

-----Original Message-----
From: Larry Hahn [mailto:lhahn_60_at_yahoo.com]=20 Sent: Friday, December 03, 2004 3:01 PM
To: Bobak, Mark; Oracle-L_at_freelists.org
Subject: RE: Truncate another users table

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.=20

I am looking for a resolution in the mean time.

Larry

> Larry,

>=20

> Synonyms don't work on DDL statements, as you discovered.
>=20

> However, rather than granting a user DROP ANY TABLE,
> which
> it seems to me could be easily misused or abused, why not
> do:
>=20

> As user1:
> create function truncate_the_table as
> begin
> execute immediate 'truncate table this_table';
> end;
> /
> grant execute on truncate_the_table to user2;
>=20

> As user2:
>=20

> exec truncate_the_table;
>=20

> That may be a better solution for you....
>=20
>=20

> -Mark
>=20

> > -----Original Message-----
> > From: oracle-l-bounce_at_freelists.org
> > [mailto:oracle-l-bounce_at_freelists.org]On Behalf Of
> Larry Hahn
> > Sent: Friday, December 03, 2004 2:43 PM
> > To: Oracle-L_at_freelists.org
> > Subject: Truncate another users table
> >=20
> >=20
> > List,
> >=20
> > I am running version 8.1.7 on Sun.
> >=20
> > 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.=20
> >=20
> > 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?
> >=20
> > 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.=20
> >=20
> > Thanks in advance for any help.
> >=20
> > Larry Hahn
> >=20
> >=20
> > =09
> > __________________________________=20
> > Do you Yahoo!?
> > Send holiday email and support a worthy cause. Do good.
> > http://celebrity.mail.yahoo.com
> > --
> > http://www.freelists.org/webpage/oracle-l
> >=20

>=20

=3D=3D=3D=3D=3D

        =09

__________________________________=20

Do you Yahoo!?=20
Take Yahoo! Mail with you! Get it on your mobile phone.=20 http://mobile.yahoo.com/maildemo=20
--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Dec 03 2004 - 21:03:55 CST

Original text of this message

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