Oracle ADR

Although I’m not a DBA, from time to time I do some DBA tasks. I decided to include them here.

Last friday, I got an alert of disk usage from an Oracle database server. As usual I started using the command “du” to trace the problem to the directory causing it. And I found the directory was called diag. After that I looked inside and found lots of trc files. After some google I knew it’s a new feature in 11G called Automatic Diagnostic Repository. Every time Oracle database has a problem, meaning returning some error, it stores a dump and some log files regarding the incident. The default policy is quite conservative, it stores traces for a whole year, while dump files for 30 days

To manage these files you should do it from a tool called “adrci”. Here is how I did the purge, after having a look to the policy used.

adrci> show control

ADR Home = <home_path>:
ADRID                SHORTP_POLICY        LONGP_POLICY         LAST_MOD_TIME                            LAST_AUTOPRG_TIME                        LAST_MANUPRG_TIME                        ADRDIR_VERSION       ADRSCHM_VERSION      ADRSCHMV_SUMMARY     ADRALERT_VERSION     CREATE_TIME                             
-------------------- -------------------- -------------------- ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------------- -------------------- -------------------- -------------------- ----------------------------------------
2741315226           720                  8760                 2012-03-27 08:25:55.733126 +01:00        2012-09-05 00:13:23.940809 +01:00                                                 1                    2                    80                   1                    2012-03-27 08:25:55.733126 +01:00      
1 rows fetched

adrci> purge


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: