NAME TYPE VALUE
--------------------------------- ----------- ------------------------------
audit_trail string DB大家好!最近公司伺服器system資料表空間越來越大,segments logical reads,segments physical reads 越來越高,awr報告裡體現的對象是AUD$,很明顯可以定位是開啟審計功能導致。下面我來給大家介紹如何停止DataGuard架構的審計功能:
1.檢查應用串連停止狀態
SQL> select USERNAME,STATUS from v$session where username is not null;
USERNAME STATUS
------------------------------ --------------
SYS ACTIVE
2.停止主庫傳輸進程
alter system set LOG_ARCHIVE_DEST_STATE_2=defer scope=both;
3.停止備庫即時應用
alter database recover managed standby database cancel;
4.查看當前審計狀態
SQL> show parameter audit_trail;
NAME TYPE VALUE
--------------------------------- ----------- ------------------------------
audit_trail string DB
5.修改主庫審計參數
alter system set audit_trail=none scope=spfile;
6.查詢主庫審計表資料量
SQL> select count(*) from SYS.AUD$;
COUNT(*)
----------------
21545536
7.停止主庫資料庫
shutdown immediate;
8.啟動主庫資料庫
startup;
9.清理審計表資料
truncate table SYS.AUD$;
10.檢查審計參數設定是否正確
SQL> show parameter audit_trail;
NAME TYPE VALUE
------------------------------- ----------- ------------------------------
audit_trail string NONE
11.查看備庫審計參數
SQL> show parameter audit_trail;
NAME TYPE VALUE
-------------------------------- ----------- ------------------------------
audit_trail string OS