Home » SQL & PL/SQL » SQL & PL/SQL » Trigger to prevent update/delete/insert operation
Trigger to prevent update/delete/insert operation [message #657866] Thu, 24 November 2016 17:09 Go to next message
ram_new_to_oracle
Messages: 1
Registered: November 2016
Junior Member
Hi,

I am new to this forum. I have an assignment in school to do. It is to create a trigger that will not allow user1 to update or delete table1. Also, show the audit results of the update/delete attempts. The Audit must display/show operating system user name, database username, date and action name.

Please let me know.

Thanks!!!
Re: Trigger to prevent update/delete/insert operation [message #657867 is a reply to message #657866] Thu, 24 November 2016 18:01 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum

Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read


BTW, we don't do homework for folks.
Re: Trigger to prevent update/delete/insert operation [message #657870 is a reply to message #657866] Fri, 25 November 2016 00:54 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Hints:
* PL/SQL Language Reference, Chapter 9 PL/SQL Triggers
* PL/SQL Packages and Types Reference, DBMS_OUTPUT
* SQL Language Reference, SYS_CONTEXT function

Re: Trigger to prevent update/delete/insert operation [message #657872 is a reply to message #657866] Fri, 25 November 2016 01:15 Go to previous messageGo to next message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
For the second question, you do not need to write any code at all: configuring either standard database audit (in release 11.x) or Unified Audit (release 12.x) will do this.
Re: Trigger to prevent update/delete/insert operation [message #657880 is a reply to message #657872] Fri, 25 November 2016 03:18 Go to previous message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
I rather imagine the question states that the trigger needs to write the audit records.
Previous Topic: Trigger to prevent delete according to select
Next Topic: using rownum
Goto Forum:
  


Current Time: Thu Apr 25 18:00:44 CDT 2024