Useful shortcuts for vi editor

Thursday, 27 October 2016

How see latest sql histories from audit view?

Check audit paramater
SQL> show parameter audit;
-- basic options; 'DB','DB,EXTENDED', 'OS', 'NONE'

Enable the paramater permanently
add this into initora file;
*.audit_trail='DB'

Flush the aud table
TRUNCATE TABLE sys.aud$

Backup related table
CREATE TABLE ALPER_AUD
AS
   SELECT * FROM dba_audit_trail

Examine the sessions
SELECT * FROM ALPER_AUD