Monday, July 21, 2008

Prevent Execution of TRUNCATE Command in SQL*PLUS

Insert the following line in SYSTEM PRODUCT_USER_PROFILE:

SQL> insert into PRODUCT_USER_PROFILE (PRODUCT, USERID, ATTRIBUTE, CHAR_VALUE) values ('SQL*Plus','%','TRUNCATE','DISABLED') ;

A user can truncate his own tables by default and truncate other user's tables
if granted 'drop any table' privilege.

SQL*PLUS uses PRODUCT_USER_PROFILE to provide product-level security.
PRODUCT_USER_PROFILE can be used to disable certain SQL and SQL*Plus commands in the SQL*Plus environment on a per-user basis.

And to enable the SQL and SQL*Plus commands,
sql>conn system
sql>delete from PRODUCT_USER_PROFILE where........

In the same way, we can restrict commands like create,alter etc.

No comments:

search engine

Custom Search