Difference between revisions of "Adrci"
(Created page with "===adrci=== A useful way to keep the purging of trace files under control.<br /> With an Oracle database environment setup, type: <pre> adrci </pre> To get out, type: <pre> ad...") |
|||
| (17 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | === | + | ===Reference links=== |
| + | * [http://intermediatesql.com/oracle/oracle-11g-xml-alert-logs-surprise-they-are-actually-more-convenient-to-work-with/ Convenient access to adrci log files] | ||
| + | * [http://arup.blogspot.co.uk/2013/04/switching-back-to-regular-listener-log.html Switch back to old-style listener log file - not using adr] | ||
| + | * [https://oracle-base.com/articles/11g/automatic-diagnostics-repository-11gr1 adrci at oracle-base.com] | ||
| + | The new way to package problems and their incidents up for Oracle Support.<br /> | ||
A useful way to keep the purging of trace files under control.<br /> | A useful way to keep the purging of trace files under control.<br /> | ||
With an Oracle database environment setup, type: | With an Oracle database environment setup, type: | ||
| Line 12: | Line 16: | ||
<pre> | <pre> | ||
adrci> help | adrci> help | ||
| + | </pre> | ||
| + | Show registered ORACLE_HOMEs | ||
| + | <pre> | ||
| + | show home | ||
| + | </pre> | ||
| + | Set one of the homes | ||
| + | <pre> | ||
| + | set home diag/rdbms/orcl | ||
| + | </pre> | ||
| + | tail the alert log (adrci reads the XML version of the alert log) | ||
| + | <pre> | ||
| + | show alert -tail -f | ||
| + | </pre> | ||
| + | Are there any problems? | ||
| + | <pre> | ||
| + | show problem | ||
| + | </pre> | ||
| + | Show the incident(s) of this problem | ||
| + | <pre> | ||
| + | show incident | ||
| + | </pre> | ||
| + | Show more detail about an incident | ||
| + | <pre> | ||
| + | show incident -mode detail -p "incident_id=<incident number>" | ||
| + | </pre> | ||
| + | Show the incident trace file for this incident | ||
| + | <pre> | ||
| + | show trace /u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_6201/orcl_ora_2299_i6201.trc | ||
| + | </pre> | ||
| + | Package a problem up for Oracle Support | ||
| + | <pre> | ||
| + | ips create package problem 1 correlate all | ||
| + | </pre> | ||
| + | Zip a problem package for Oracle Support | ||
| + | <pre> | ||
| + | ips generate package 2 in "/home/oracle" | ||
</pre> | </pre> | ||
To see current setup, type: | To see current setup, type: | ||
| Line 17: | Line 57: | ||
adrci> show control | adrci> show control | ||
</pre> | </pre> | ||
| + | |||
| + | ===Purging trace and dump files in 11g with adrci=== | ||
SHORTP_POLICY and LONGP_POLICY are number of hours to keep trace files and alert files respectively. These can be changed by typing: | SHORTP_POLICY and LONGP_POLICY are number of hours to keep trace files and alert files respectively. These can be changed by typing: | ||
<pre> | <pre> | ||
| Line 22: | Line 64: | ||
</pre> | </pre> | ||
Trace files will now be deleted after 10 days.<br /> | Trace files will now be deleted after 10 days.<br /> | ||
| − | If space is running low, you can manually delete trace files | + | If space is running low, you can manually delete trace files.<br /> |
| + | This deletes all trace files older than 1 day (note the age parameter is minutes, not hours). | ||
| + | <pre> | ||
| + | purge -age 3600 -type trace | ||
| + | </pre> | ||
| + | Show the tracefiles in reverse time order | ||
| + | <pre> | ||
| + | show tracefile -rt | ||
| + | </pre> | ||
| + | |||
| + | ===Use ADR command line interface from shell=== | ||
| + | <pre> | ||
| + | adrci exec="show homes" | ||
| + | adrci exec="set home diag/tnslsnr/ravjde01/listener_ravjde1;show control" | ||
| + | adrci exec="set home diag/tnslsnr/ravjde01/listener_ravjde1;set control (shortp_policy=360,longp_policy=720);purge;show control;" | ||
| + | </pre> | ||
| + | Show ADR homes related to databases | ||
| + | <pre> | ||
| + | $ORACLE_HOME/bin/adrci exec="show homes" | grep "rdbms" | ||
| + | </pre> | ||
| + | |||
| + | ===Shell script to purge ADR data=== | ||
| + | Found [http://www.dadbm.com/oracle-database-housekeeping-methods-adr-files-purge/ here] | ||
| + | <pre> | ||
| + | # Purge ADR contents (adr_purge.sh) | ||
| + | purge_log () { | ||
| + | purge_min=$(( 24 * 60 * $2 )) | ||
| + | echo “INFO: purging $1 older than $2 days” | ||
| + | adrci exec=”set homepath $file_line;purge -age $purge_min -type $1″ | ||
| + | } | ||
| + | |||
| + | echo “INFO: adrci purge started at `date`” | ||
| + | adrci exec=”show homes”|grep -v : | while read file_line | ||
| + | do | ||
| + | echo “INFO: adrci purging diagnostic destination ” $file_line | ||
| + | echo “——————————————————————————-” | ||
| + | purge_log ALERT 365 | ||
| + | purge_log INCIDENT 273 | ||
| + | purge_log TRACE 120 | ||
| + | purge_log CDUMP 75 | ||
| + | purge_log HM 75 | ||
| + | echo “——————————————————————————-” | ||
| + | done | ||
| + | echo | ||
| + | echo “INFO: adrci purge finished at `date`” | ||
| + | </pre> | ||
| + | ===Create a package to send to Oracle Support=== | ||
| + | A problem may consist of one or more incidents. | ||
| + | ====Find the problem id==== | ||
| + | <pre> | ||
| + | show incident -mode detail -p "incident_id=<incident_id>" | ||
| + | </pre> | ||
| + | ====Create a package containing all incidents for this problem==== | ||
| + | <pre> | ||
| + | ips create package problem <proble_id> correlate all | ||
| + | </pre> | ||
| + | ====Generate a zipped package file==== | ||
<pre> | <pre> | ||
| − | + | ips generate package <proble_id> in "/tmp" | |
</pre> | </pre> | ||
| − | |||
Latest revision as of 14:03, 28 November 2018
Contents
Reference links[edit]
- Convenient access to adrci log files
- Switch back to old-style listener log file - not using adr
- adrci at oracle-base.com
The new way to package problems and their incidents up for Oracle Support.
A useful way to keep the purging of trace files under control.
With an Oracle database environment setup, type:
adrci
To get out, type:
adrci> exit
To get help, type:
adrci> help
Show registered ORACLE_HOMEs
show home
Set one of the homes
set home diag/rdbms/orcl
tail the alert log (adrci reads the XML version of the alert log)
show alert -tail -f
Are there any problems?
show problem
Show the incident(s) of this problem
show incident
Show more detail about an incident
show incident -mode detail -p "incident_id=<incident number>"
Show the incident trace file for this incident
show trace /u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_6201/orcl_ora_2299_i6201.trc
Package a problem up for Oracle Support
ips create package problem 1 correlate all
Zip a problem package for Oracle Support
ips generate package 2 in "/home/oracle"
To see current setup, type:
adrci> show control
Purging trace and dump files in 11g with adrci[edit]
SHORTP_POLICY and LONGP_POLICY are number of hours to keep trace files and alert files respectively. These can be changed by typing:
set control (SHORTP_POLICY=240)
Trace files will now be deleted after 10 days.
If space is running low, you can manually delete trace files.
This deletes all trace files older than 1 day (note the age parameter is minutes, not hours).
purge -age 3600 -type trace
Show the tracefiles in reverse time order
show tracefile -rt
Use ADR command line interface from shell[edit]
adrci exec="show homes" adrci exec="set home diag/tnslsnr/ravjde01/listener_ravjde1;show control" adrci exec="set home diag/tnslsnr/ravjde01/listener_ravjde1;set control (shortp_policy=360,longp_policy=720);purge;show control;"
Show ADR homes related to databases
$ORACLE_HOME/bin/adrci exec="show homes" | grep "rdbms"
Shell script to purge ADR data[edit]
Found here
# Purge ADR contents (adr_purge.sh)
purge_log () {
purge_min=$(( 24 * 60 * $2 ))
echo “INFO: purging $1 older than $2 days”
adrci exec=”set homepath $file_line;purge -age $purge_min -type $1″
}
echo “INFO: adrci purge started at `date`”
adrci exec=”show homes”|grep -v : | while read file_line
do
echo “INFO: adrci purging diagnostic destination ” $file_line
echo “——————————————————————————-”
purge_log ALERT 365
purge_log INCIDENT 273
purge_log TRACE 120
purge_log CDUMP 75
purge_log HM 75
echo “——————————————————————————-”
done
echo
echo “INFO: adrci purge finished at `date`”
Create a package to send to Oracle Support[edit]
A problem may consist of one or more incidents.
Find the problem id[edit]
show incident -mode detail -p "incident_id=<incident_id>"
Create a package containing all incidents for this problem[edit]
ips create package problem <proble_id> correlate all
Generate a zipped package file[edit]
ips generate package <proble_id> in "/tmp"