Friday, October 01, 2010

adrci commands

ADRCI  commands

Log into the oracle user.
Set Oracle database environment, using
. oraenv

Start the ADR command line interpreter(ADRCI) by issuing the following command in the database directory:

adrci
ADRCI: Release 11.2.0.2.0
ADR base = "/ora01/oracle"


adrci> help
 HELP [topic]

adrci> help SHOW ALERT

  Usage: SHOW ALERT [-p ]  [-term]
                    [ [-tail [num] [-f]] | [-file ] ]
  Purpose: Show alert messages.
Examples:
    show alert
    show alert -p "message_text like '%incident%'"
    show alert -tail 20
    show alert -tail –f


adrci> show homes
ADR Homes:
diag/rdbms/demo/demo  ß oracle instance
diag/tnslsnr/lnx100/listener ß listener
diag/asm/+asm/+ASM ß ASM

adrci> set home diag/rdbms/demo/demo
adrci> show homes
ADR Homes:
diag/rdbms/demo/demo

adrci> show alert
Choose the alert log from the following homes to view:

1: diag/rdbms/demo/demo
2: diag/tnslsnr/lnx100/listener
3: diag/asm/+asm/+ASM
Q: to quit


adrci> help purge

  Usage: PURGE [[-i | ] |
               [-age [-type ALERT|INCIDENT|TRACE|CDUMP|HM|UTSCDMP]]]:

  Purpose: Purge the diagnostic data in the current ADR home. If no
           option is specified, the default purging policy will be used.
Examples:
    purge
    purge -i 123 456
    purge -age 60 -type incident


-- list all the trace files of the databases, lisetners
adrci > show tracefiles

-- list log files
adrci>  show tracefiles %.log
    diag/rdbms/tmcp/TMCP1/trace/alert_TMCP1.log
     diag/tnslsnr/lnx20015/listener/trace/listener.log
     diag/tnslsnr/lnx20015/listener_scan2/trace/listener_scan2.log
     diag/tnslsnr/lnx20015/listener_scan1/trace/listener_scan1.log
     diag/tnslsnr/lnx20015/listener_scan3/trace/listener_scan3.log
     diag/asm/+asm/+ASM1/trace/alert_+ASM1.log

-- to see the content of trace/log file
adrci > show trace diag/rdbms/tmcp/TMCP1/trace/alert_TMCP1.log
adrci> show trace diag/tnslsnr/lnx20015/listener/trace/listener.log

Useful links