Home » SQL & PL/SQL » SQL & PL/SQL » TRUNCATE PARTITION
TRUNCATE PARTITION [message #252445] Wed, 18 July 2007 17:51 Go to next message
serafo
Messages: 24
Registered: May 2006
Junior Member
Hello.

I have to schemas : Schema A an Schema B.

Schema B has a partition table called tbl_datos. I am trying to truncate a partition of the table tbl_datos from schema A but I get the ORA-01031: insufficient privileges message.

Which privileges must schema A have?

Thanks a Lot.



Re: TRUNCATE PARTITION [message #252449 is a reply to message #252445] Wed, 18 July 2007 18:09 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
dROP ANY TABLE.
Re: TRUNCATE PARTITION [message #252450 is a reply to message #252445] Wed, 18 July 2007 18:13 Go to previous messageGo to next message
BlackSwan
Messages: 25035
Registered: January 2009
Location: SoCal
Senior Member
A more secure solution is to write a PL/SQL procedure owned by schemaB that uses EXECUTE IMMEDIATE to truncate the partition.
The GRANT EXECUTE on <new_procedure> to schemaA.
This avoids having schemaA dropping a table belonging to schemaC;
as could be done with DROP ANY TABLE.
Re: TRUNCATE PARTITION [message #252641 is a reply to message #252445] Thu, 19 July 2007 08:51 Go to previous message
serafo
Messages: 24
Registered: May 2006
Junior Member

have to schemas : Schema A an Schema B.

Schema B has a partition table called tbl_datos. I am trying to truncate a partition of the table tbl_datos from schema A but I get the ORA-01031: insufficient privileges message.

Which privileges must schema A have?

Thanks a Lot.




DreamzZ Thaks a lot. It works!!

anacedent. Thanks por the advise, I will move tables from schema A to B and execute the stored procedure from schema B. I am plannig to do a exchange partition and maybe its better inside the same schema.

Thank Very Much
Previous Topic: logic in single SQL query
Next Topic: dual table
Goto Forum:
  


Current Time: Sat Dec 03 16:26:25 CST 2016

Total time taken to generate the page: 0.04931 seconds