HomeОбразованиеRelated VideosMore From: Manish Sharma

PL/SQL tutorial 18: DDL Trigger with Schema Auditing Example

429 ratings | 48517 views
Learn how to create a DDL Trigger in Oracle Database with Schema Auditing Example where we will learn how to keep an any on which object is created, altered or drop and by who. Manish Sharma From RebellionRider ------------------------------------------------------------------------ ►►►LINKS◄◄◄ Blog : http://bit.ly/DDL-Trigger Previous Tutorial ►PL/SQL Tut 14 Triggers Introduction https://youtu.be/R3fvX_xf5P4 ► PL/SQL Tut 17 Table Backup Using DML Trigger https://youtu.be/jSv1LIlNKU0 ------------------------------------------------------------------------- ►►►Let's Get Free Uber Cab◄◄◄ Use Referral Code UberRebellionRider and get $20 free for your first ride. ------------------------------------------------------------------------- ►Make sure you SUBSCRIBE and be the 1st one to see my videos! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ►►►Find me on Social Media◄◄◄ Follow What I am up to as it happens on https://twitter.com/rebellionrider https://www.facebook.com/imthebhardwaj http://instagram.com/rebellionrider https://plus.google.com/+Rebellionrider http://in.linkedin.com/in/mannbhardwaj/ http://rebellionrider.tumblr.com/ http://www.pinterest.com/rebellionrider/ You can also Email me at for E-mail address please check About section Please please LIKE and SHARE my videos it makes me happy. Thanks for liking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com ♥ I LOVE ALL MY VIEWERS AND SUBSCRIBERS
Html code for embedding videos on your blog
Text Comments (20)
Akash jain (3 months ago)
1.what if we drop the trigger itself ? 2. what if we drop the audit table itself ?
KIRAN NIKAM (4 months ago)
I tried creating DDL trogger on table. Well, we can not do that, it was an interview question for me. CREATE OR REPLACE TRIGGER ddl_emo_demo AFTER ALTER ON emp_demo BEGIN DBMS_OUTPUT.PUT_LINE(sys_context('userenv','current_user'),ora_dct_obj_type,ora_dct_obj_name); END; it gives error: ORA 30506: system triggers cannot be based on tables or views
rupam sinha roy (4 months ago)
i tried the same code on hr account in oracle 10g express edition but the table schema_audit remains empty . can anyone help me on this please !
Pushpa raj (6 months ago)
any body have this code in mysql
himanshu chouhan (9 months ago)
can we use 'DML' in DML triggers just like we used 'DDL' here ?
pavan medam (1 year ago)
Manish Sir, Watching And Practicising Your Video Tutorials Is The Most Constructive Part Of My Day!!! Your Videos Are Helping a Lot!!! Thank You Very Much Sir!!!
Mugilan Sankaran (1 year ago)
I want to create a trigger after insert and body of the trigger should create a user in database.. Is it possible?
Vilas Gaikwad (1 year ago)
awesome Manish...great job
Mohammad Mannan (1 year ago)
hai manish ....ur rocking sir love u from hydrabad .....i watch evry vedio ...once again thanks ..m
Luiiz López (1 year ago)
"insufficient privileges" What kind of GRANT can I use?
Mohammad Mannan (1 year ago)
Luiiz López connect to sysdba other thrown error ..
Robert Bhandari (1 year ago)
hr
Technology following (2 years ago)
Hi Manish..Thanks for the video..But I am getting a error when trying to create or alter table and the message is:ORA-00604: error occurred at recursive SQL level 1. I tried to solve, but I can't able to get it. Can you tell me the solution..
viki (1 year ago)
Hi, same issue... did you find a solution?
Muhammad Bilal Liaquat (2 years ago)
hi +Manish Sharma Great job man... kindly if you can help on which trigger should i use if i only want to delete data from one table and make a replica of it on the other??? Kindly do answer
Huzefa Patel (2 years ago)
+Manish Sharma, Great Job Brother... Thankyousoomuch for such free tutorials :)
Nigel Coutinho (3 years ago)
Hi Manish, I used sys_context('USERENV','CURRENT_USER') for DDL trigger on database, but it gave me the same user SYS. instead of Nigel. Then I used user and it worked. Did I miss something? Please help. Thanks in advance.
Kebing Li (3 years ago)
Thank man, you did a great job. Can you tell what is the hotkey for format the code when you create the table schema_audit?
Kebing Li (3 years ago)
+Manish Sharma Thank you so much!
Manish Sharma (3 years ago)
+Kebing Li Thank you so much for the appreciation it means a lot to me. For code formatting you can use CTRL+F7 and for advance formatting CTRL+SHIFT+F7

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.