Oracle DBA – A lifelong learning experience

Posts Tagged ‘adrci’

ADR presentation done and dusted

Posted by John Hallas on September 23, 2011

I was pleased with my the presentation on ADR I gave yesterday at the Unix SIG in Reading. The timing was bang on at 60 minutes and the audience had not seen or used many of the features I discussed so that was a bonus. I had the benefit of being able to give the same talk two days earlier to a team of DBAs at work and I learned a lot from the comments I received and that made for a better presentation yesterday.

One question I was asked afterwards was ‘ are Health Monitor and Support Workbench Enterprise Edition features or are they also available in Standard Edition?’. As we do not use Standard Edition I could only hazard a guess that these were tools that were advantageous to Oracle support as well as users and therefore I figured that they would be included in both editions. I have since looked at the list of features for 11GR1 and can see nothing that suggests that the features are licenseable or are different between editions. If anybody knows different then please feel free to correct me.

The presentation is available in PDF format from the UKOUG site,  provided you have a member access that is.


Posted in 11g new features, Oracle, UKOUG | Tagged: , , , , | 2 Comments »

Upcoming ADR presentation at UKOUG

Posted by John Hallas on September 16, 2011

I am presenting a talk around the use of the Automatic Diagnostic Repository at the UKOUG SIG in Reading on 22nd September 2011. I will be covering, amongst other things, the management of files, the Health Monitor, incidents and problems and the Support Workbench utility. I am hoping that, whilst everyone will probably be already aware of ADR, some of the things I mention might be new or have not been fully looked at before. The Health Monitor was new to me and the ease of use of the Support Workbench when raising an SR is certainly the way forward.

I will also be quite critical of how ADR has been delivered, particularly in respect of the management of diagnostic data and the trace and alert logs that are generated. ADR currently lacks features such as the management of the alert log which still needs external management using such commands as logrotate on unix. The standard alert log has not been replaced by an alert log in xml format (log.xml) and the old alert log is only created for backward compatibility and is not guaranteed to be available in the future. Listener logs are not purged and there are ongoing problems in removing core dumps (on HPUX at least). Overall I will be suggesting that ADR is not as automatic as it could be but some of the additional features other than file management are well worth investigating.

I look forward to meeting fellow UKOUG members and hopefully I may learn a few new things about ADR myself if I get good audience interaction.

Posted in 11g new features, Oracle, UKOUG | Tagged: , , , , | Leave a Comment »

Purging ADR log and trace files automatically

Posted by John Hallas on May 13, 2009

The following script was put together by a colleague, David Sutton, and shows a way to create a script to tidy up the logs and trace files generated in 11G. Note that the purge time is in seconds and this keep s 30 days online. This is probably too many on some of our systems and this is likely to be reduced to 14 days although we will keep incident history for longer

This is called each day from cron (or it could be run from dbms_scheduler, either directly or via an OEM job) 

# Description
# Shell script to interact with the ADR through ADRCI and purge ADR contents
# Tunables


# Start Of Functions
# tidyup – common fuction called if error has occured
tidyup () {
        rm -f ${LOCKFILE}
        echo “ERROR: Purge aborted at `date` with exit code ${ERR}”
        exit ${ERR}

# End Of Functions

### Main Program

# Check user is oracle
USERID=`/usr/bin/id -u -nr`
if [ $? -ne 0 ]
        echo “ERROR: unable to determine uid”
        exit 99
if [ “${USERID}” != “oracle” ]
        echo “ERROR: This script must be run as oracle”
        exit 98

echo “INFO: Purge started at `date`”

# Check if lockfile exists
if [ -f ${LOCKFILE} ]
        echo “ERROR: Lock file already exists”
        echo ”       Purge already active or incorrectly terminated”
        echo ”       If you are sure tidy isn’t active, please remove ”
        echo ”       ${LOCKFILE}”
        exit 97

# Create lock file
touch ${LOCKFILE} 2>/dev/null
if [ $? -ne 0 ]
        echo “ERROR: Unable to create lock file”
        exit 96

# Purge ADR contents
echo “INFO: adrci purge started at `date`”
/app/oracle/product/11.1.0/db_1/bin/adrci exec=”show homes”|grep -v : | while read file_line
  echo “INFO: adrci purging diagnostic destination ” $file_line
  echo “INFO: purging ALERT older than 90 days ….”
  /app/oracle/product/11.1.0/db_1/bin/adrci exec=”set homepath $file_line;purge -age 129600 -type ALERT”
  echo “INFO: purging INCIDENT older than 30 days ….”
  /app/oracle/product/11.1.0/db_1/bin/adrci exec=”set homepath $file_line;purge -age 43200 -type INCIDENT”
  echo “INFO: purging TRACE older than 30 days ….”
  /app/oracle/product/11.1.0/db_1/bin/adrci exec=”set homepath $file_line;purge -age 43200 -type TRACE”
  echo “INFO: purging CDUMP older than 30 days ….”
  /app/oracle/product/11.1.0/db_1/bin/adrci exec=”set homepath $file_line;purge -age 43200 -type CDUMP”
  echo “INFO: purging HM older than 30 days ….”
  /app/oracle/product/11.1.0/db_1/bin/adrci exec=”set homepath $file_line;purge -age 43200 -type HM”
  echo “”
  echo “”

echo “INFO: adrci purge finished at `date`”

# All completed
rm -f ${LOCKFILE}
echo “SUCC: Purge completed successfully at `date`”

exit 0

Posted in 11g new features, Oracle | Tagged: , , , | 12 Comments »

Location of diagnostic directories in 11g

Posted by John Hallas on April 3, 2009

Since the advent of 11g and the use of diagnostic_dest there is no requirement to create the bdump/cdump/udump  and other directories required for oracle trace and admin files. Well, that is true if you are happy to accept the default location under $ORACLE_BASE. However the path to the trace area where alert logs and dump files are kept is a long one and I prefer  to use an alias to get there.

In the .profile I set up two aliases to point to the trace areas for ASM and whichever database my current SID is set to

alias diagdest=’cd $ORACLE_BASE/`adrci exec=”show homes” | grep $ORACLE_SID`/trace’

alias diagdestasm=’cd $ORACLE_BASE/`adrci exec=”show homes” | grep ASM`/trace’

I am sure there are other ways of setting a similar alias and I am happy to hear of any that others use

Posted in 11g new features, ASM, Oracle | Tagged: , | 2 Comments »