audit purge

short way truncate table sys.aud$ =))) [code] BEGIN DBMS_AUDIT_MGMT.init_cleanup( audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_ALL, default_cleanup_interval => 24 /* hours */); END; /[/code] [code]SET SERVEROUTPUT ON BEGIN IF DBMS_AUDIT_MGMT.is_cleanup_initialized(DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD) THEN DBMS_OUTPUT.put_line(‘YES’); ELSE DBMS_OUTPUT.put_line(‘NO’); END IF; END; /[/code] [code]BEGIN DBMS_AUDIT_MGMT.set_last_archive_timestamp( audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, last_archive_time => SYSTIMESTAMP-31); END; /[/code] create purge audit job [code]—create STANDARD_AUDIT_TRAIL_PURGE_JOB BEGIN DBMS_AUDIT_MGMT.CREATE_PURGE_JOB ( AUDIT_TRAIL_TYPE => […]

postgrespro pg_stat_wait patch

usefull materials github postgrespro Waits monitoring on mail list of postgresql.org pgconf2015 slides Packages ubuntu: [code] apt-get install gcc libreadline-dev zlib1g-dev libxml2-dev libldap2-dev python-dev libssl-dev build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev libxslt-dev libssl-dev libperl-dev [/code] fedora: [code] yum install -y gcc bison-devel flex bison readline-devel zlib-devel openssl-devel wget perl-ExtUtils-MakeMaker perl-ExtUtils-Embed readline-devel zlib-devel libxml2-devel openldap-devel python-devel […]

awr report by hour

simplest way to generate awr report by hour after benchmark export awr [code language=»sql»]@?/rdbms/admin/awrextr.sql [/code] import awr [code language=»sql»]@?/rdbms/admin/awrload.sql[/code] — make sure to set line size appropriately — set linesize 152 generate awr [code language=»sql»] set termout off set linesize 80 set pagesize 10000 select ‘spool awrrpt_dwhfrn_’|| snap_id ||’.html’|| chr(13)|| ‘select output from table(dbms_workload_repository.awr_report_text(‘||dbid||’,1,’||snap_id||’,’|| LEAD […]