I'm enclosing the trigger code I wrote:
create or replace trigger LOGG_TRAIL before alter on database when (ora_dict_obj_type = 'USER' and ora_dict_obj_name != user and sys_context('USERENV','ISDBA') = 'FALSE' ); declare by_user varchar2(30); to_user varchar2(30); vprofile varchar2(30); begin select to.PROFILE into vprofile from DBA_USERS by, DBA_USERS to where by.USERNAME = user and to.USER_NAME = ora_dict_obj_name and by.PROFILE = to.PROFILE; insert into TRAIL_TEMP (USER_ALTERED, PASSWORD_MODIFIED_BY, PASSWORD_MODIFIED_DATE, PROFILE) values (ora_dict_obj_name, user, sysdate, vprofile); exception when others then raise_application_error (-20001,'can''t alter user'); end; /This gives errors. Can you please check it? Your help will be highly appreciated.
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.